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; } } }
private void OnJoinRoomBtnClick(EventContext context) { _DTO_room_info sdto = ( _DTO_room_info )this._joinPopup.data; this._root.ShowModalWait(); NetModule.instance.Send(ProtocolManager.PACKET_HALL_QCMD_JOIN_ROOM(sdto.roomId)); }
private void OnRoomCreated(Packet packet) { GList list = this._root["list"].asList; GComponent item = list.AddItemFromPoolAt(0).asCom; _DTO_room_info roomDTO = (( _PACKET_HALL_ACMD_BRO_ROOM_CREATED )packet).dto; item["id"].asTextField.text = string.Empty + roomDTO.roomId; item["name"].asTextField.text = roomDTO.name; item.data = roomDTO; }
private _DTO_room_info[] GetRoomDTOList(int from, int length) { Room[] rooms = this._hallBiz.GetRoomList(from, length); int count = rooms.Length; var roomDTOs = new _DTO_room_info[count]; for (int i = 0; i < count; i++) { roomDTOs[i] = DTOHelper.GetRoomDTO(rooms[i]); } return(roomDTOs); }
private void OnRoomList(Packet packet) { this._root.CloseModalWait(); GRoot.inst.HidePopup(); GList list = this._root["list"].asList; _DTO_room_list dto = (( _PACKET_HALL_ACMD_ROOM_LIST )packet).dto; _DTO_room_info[] rooms = dto.rs; int count = rooms.Length; for (int i = 0; i < count; i++) { GComponent item = list.AddItemFromPool().asCom; _DTO_room_info roomDTO = rooms[i]; item["id"].asTextField.text = string.Empty + roomDTO.roomId; item["name"].asTextField.text = roomDTO.name; item.data = roomDTO; } }