예제 #1
0
파일: GameMap.cs 프로젝트: tangfengray/soul
        //广播文字消息
        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;
                    }
                    }
                }
            }
        }
예제 #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;
                    }
                    }
                }
            }
        }