示例#1
0
        public void AppendKindItem(SGameKindItem item)
        {
            foreach (var name in _gameList.KindList)
            {
                if (name.ID == item.ID)
                {
                    _gameList.KindList.Remove(name);
                    break;
                }
            }

            _gameList.KindList.Add(item);
        }
示例#2
0
        ////通过GameID分类
        //public void OnSendGameItem()
        //{
        //    List<SGameKindItem> tempGameList = GameApp.GameListMgr.FindKindList();

        //    List<HallTransfer.GameInfoS> gameIDList = new List<HallTransfer.GameInfoS>();

        //    foreach (SGameKindItem tempName in tempGameList)
        //    {
        //        //pc
        //        if (((tempName.JoinID & 0x01) != 0) && !Application.isMobilePlatform ||
        //           ((tempName.JoinID & 0x02) != 0) && Application.isMobilePlatform)
        //        {
        //            HallTransfer.GameInfoS tempNameInfo = new HallTransfer.GameInfoS();
        //            tempNameInfo.TypeID = tempName.KindID;
        //            tempNameInfo.ID = tempName.ID;
        //            tempNameInfo.SortID = tempName.SortID;
        //            tempNameInfo.Name = tempName.Name;
        //            gameIDList.Add(tempNameInfo);
        //        }
        //    }
        //    HallTransfer.Instance.cnSetGameIDs(gameIDList);//发送游戏列表
        //}

        //通过NodeID分类
        public void OnSendAllRoomInfo(uint NodeID)
        {
            List <SGameRoomItem> GameNameList = GameApp.GameListMgr.FindRoomListByNodeID(NodeID);

            List <HallTransfer.RoomInfoS> RoomInfo = new List <HallTransfer.RoomInfoS>();

            foreach (var GameItem in GameNameList)
            {
                SGameKindItem tempKind = GameApp.GameListMgr.FindKindItem(GameItem.GameNameID);
                if (tempKind == null)
                {
                    continue;
                }

                //过滤配置
                if (GameApp.GameMgr.GetGameConfig((int)GameItem.GameNameID) == null)
                {
                    continue;
                }

                //过滤平台
                if (((tempKind.JoinID & 0x01) != 0) && !Application.isMobilePlatform ||
                    ((tempKind.JoinID & 0x02) != 0) && Application.isMobilePlatform)
                {
                    HallTransfer.RoomInfoS tempRoomInfo = new HallTransfer.RoomInfoS();
                    tempRoomInfo.roomId            = GameItem.ID;
                    tempRoomInfo.roomName          = GameItem.Name;
                    tempRoomInfo.roomPeopleCnt     = GameItem.OnlineCnt;
                    tempRoomInfo.roomPeopleUplimit = GameItem.FullCount;
                    tempRoomInfo.roomDifen         = GameItem.BasePoint;
                    tempRoomInfo.roomRuchang       = GameItem.LessMoney2Enter;
                    RoomInfo.Add(tempRoomInfo);
                }
            }
            //HallTransfer.Instance.cnSetGameRoomInfo(NodeID, RoomInfo);//发送房间信息
            CGameRoomManger._instance.SetRoomList(NodeID, RoomInfo);
        }