public void sendMsg(GameProtocol pID, msgReqRoomList msg, Action <Message> action) { JsonObject jsonMsg = new JsonObject(); jsonMsg.Add("game", (int)msg.game); jsonMsg.Add("areaID", msg.areaID); jsonMsg.Add("begin", msg.begin); jsonMsg.Add("reqCnt", msg.reqCnt); sendMsg(pID, jsonMsg, action); }
void onEventGetRoomList(object data) { SelfData self = Account.getSelfData(); RoomEvent.sV2C_GetRoomList getRoom = (RoomEvent.sV2C_GetRoomList)data; msgReqRoomList rl = new msgReqRoomList(); rl.areaID = self.area; //原则上来说,以后这两个数据需要传过来 rl.begin = getRoom.currentPage * getRoom.perCnt; rl.reqCnt = getRoom.perCnt; //所有 rl.game = GameType.GAME_LIANQI; ProtocolManager.getInstance().sendMsg(GameProtocol.P_GAME_REQ_ROOMLIST, rl, OnRespRoomList); ViewManagerEvent.EM().InvokeEvent(ViewManagerEvent.EVENT.SHOW_LOADING_ANI, true); }