/// <summary> /// Sends the message. /// </summary> /// <param name="pID">P I.</param> /// <param name="msg">Message.</param> /// <param name="action">Action.</param> public void sendMsg(LobbyProtocol pID, msgReqOpenTalentslot msg, Action <Message> action) { JsonObject jsonMsg = new JsonObject(); jsonMsg.Add("game", (int)msg.game); jsonMsg.Add("openBy", (int)msg.openBy); sendMsg(pID, jsonMsg, action); }
public void onEventReqOpenTalentslot(object data) { LobbyEvent.sV2C_OpenTalentslot ot = (LobbyEvent.sV2C_OpenTalentslot)data; //需要判断是否有足够的金币或者钻石开槽,避免多余的网络请求 msgReqOpenTalentslot msg = new msgReqOpenTalentslot(); msg.game = GameType.GAME_LIANQI; msg.openBy = ot.type; ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_OPENTALENTSLOT, msg, OnRespOpenTalentslot); ViewManagerEvent.EM().InvokeEvent(ViewManagerEvent.EVENT.SHOW_LOADING_ANI, true); }