示例#1
0
        private void OnRoomDestroy(Packet packet)
        {
            _DTO_int sdto = (( _PACKET_HALL_ACMD_BRO_ROOM_DESTROIED )packet).dto;

            if (this._joinPopup.parent != null)
            {
                _DTO_room_info dto = ( _DTO_room_info )this._joinPopup.data;
                if (dto.roomId == sdto.value)
                {
                    GRoot.inst.HidePopup();
                }
            }
            GList list     = this._root["list"].asList;
            int   numItems = list.numItems;

            for (int i = 0; i < numItems; i++)
            {
                GComponent     item    = list.GetChildAt(i).asCom;
                _DTO_room_info roomDTO = ( _DTO_room_info )item.data;
                if (roomDTO.roomId == sdto.value)
                {
                    list.RemoveChildToPoolAt(i);
                    break;
                }
            }
        }
示例#2
0
        private void RoomInfo(IUserToken token, _DTO_int dto)
        {
            Room    room;
            PResult result = dto.value == -1 ? this._roomBiz.GetUserRoom(token, out room) : this._roomBiz.Get(dto.value, out room);

            if (result != PResult.SUCCESS)
            {
                this.Reply(token, Module.ROOM, Command.QCMD_ROOM_INFO, result);
            }
            else
            {
                this.RoomInfo(token, room);
            }
        }
示例#3
0
        public void ProcessMessage(IUserToken token, Packet packet)
        {
            if (!this.CheckAndReplyAccountOnline(token, packet))                 //账号还没有登录,忽略所有数据
            {
                return;
            }

            if (!this.CheckAndReplyUserOnline(token, packet))                 //账号还没有登录,忽略所有数据
            {
                return;
            }

            switch (packet.command)
            {
            case Command.QCMD_ROOM_LIST:
            {
                _DTO_request_room_list sdto  = (( _PACKET_HALL_QCMD_ROOM_LIST )packet).dto;
                _DTO_room_info[]       rooms = this.GetRoomDTOList(sdto.from, sdto.count);
                token.CALL_HALL_ACMD_ROOM_LIST(rooms);
            }
            break;

            case Command.QCMD_CREATE_ROOM:
            {
                _DTO_string sdto = (( _PACKET_HALL_QCMD_CREATE_ROOM )packet).dto;
                this.CreateRoom(token, sdto.value);
            }
            break;

            case Command.QCMD_JOIN_ROOM:
            {
                _DTO_int sdto = (( _PACKET_HALL_QCMD_JOIN_ROOM )packet).dto;
                this.JoinRoom(token, sdto.value);
            }
            break;
            }
        }
示例#4
0
        private void OnEnterRoom(Packet packet)
        {
            _DTO_int dto = (( _PACKET_HALL_ACMD_JOIN_ROOM )packet).dto;

            UIManager.EnterRoom(dto.value);
        }