Exemple #1
0
        //广播文字消息
        public void BroadcastMsg(GameBase.Config.BROADCASTMSGTYPE type, String msg)
        {
            foreach (BaseObject obj in mDicObject.Values)
            {
                if (obj.type != OBJECTTYPE.PLAYER)
                {
                    continue;
                }
                PlayerObject play = obj as PlayerObject;
                if (obj.GetGameSession() != null)
                {
                    switch (type)
                    {
                    case GameBase.Config.BROADCASTMSGTYPE.LEFT:
                    {
                        play.LeftNotice(msg);
                        break;
                    }

                    case GameBase.Config.BROADCASTMSGTYPE.CHAT:
                    {
                        play.ChatNotice(msg);
                        break;
                    }

                    case GameBase.Config.BROADCASTMSGTYPE.SCREEN:
                    {
                        UserEngine.Instance().SceneNotice(msg);
                        break;
                    }
                    }
                }
            }
        }
Exemple #2
0
        //广播文字消息
        public void BroadcastMsg(GameBase.Config.BROADCASTMSGTYPE type, String msg)
        {
            foreach (PlayerObject obj in m_DicPlayerObject.Values)
            {
                if (obj.GetGameSession() != null)
                {
                    switch (type)
                    {
                    case GameBase.Config.BROADCASTMSGTYPE.LEFT:
                    {
                        obj.LeftNotice(msg);
                        break;
                    }

                    case GameBase.Config.BROADCASTMSGTYPE.CHAT:
                    {
                        obj.ChatNotice(msg);
                        break;
                    }

                    case GameBase.Config.BROADCASTMSGTYPE.SCREEN:
                    {
                        UserEngine.Instance().SceneNotice(msg);
                        break;
                    }
                    }
                }
            }
        }