public void StatusMatchReq(MsgStatusMatchReq msg) { _httpService.Send((int)GameProtocol.STATUS_MATCH_REQ, "matchstatus", JsonConvert.SerializeObject(msg)); }
//public delegate Task<string> OpenBoxReqDelegate(MsgOpenBoxReq msg); //public OpenBoxReqDelegate OpenBoxReq; //public delegate void OpenBoxAckDelegate(MsgOpenBoxAck msg); //public OpenBoxAckDelegate OpenBoxAck; //public delegate Task<string> LevelUpDiceReqDelegate(MsgLevelUpDiceReq msg); //public LevelUpDiceReqDelegate LevelUpDiceReq; //public delegate void LevelUpDiceAckDelegate(MsgLevelUpDiceAck msg); //public LevelUpDiceAckDelegate LevelUpDiceAck; //public delegate Task<string> SeasonInfoReqDelegate(MsgSeasonInfoReq msg); //public SeasonInfoReqDelegate SeasonInfoReq; //public delegate void SeasonInfoAckDelegate(MsgSeasonInfoAck msg); //public SeasonInfoAckDelegate SeasonInfoAck; //public delegate Task<string> SeasonResetReqDelegate(MsgSeasonResetReq msg); //public SeasonResetReqDelegate SeasonResetReq; //public delegate void SeasonResetAckDelegate(MsgSeasonResetAck msg); //public SeasonResetAckDelegate SeasonResetAck; //public delegate Task<string> GetRankReqDelegate(MsgGetRankReq msg); //public GetRankReqDelegate GetRankReq; //public delegate void GetRankAckDelegate(MsgGetRankAck msg); //public GetRankAckDelegate GetRankAck; //public delegate Task<string> SeasonPassInfoReqDelegate(MsgSeasonPassInfoReq msg); //public SeasonPassInfoReqDelegate SeasonPassInfoReq; //public delegate void SeasonPassInfoAckDelegate(MsgSeasonPassInfoAck msg); //public SeasonPassInfoAckDelegate SeasonPassInfoAck; //public delegate Task<string> SeasonPassRewardStepReqDelegate(MsgSeasonPassRewardStepReq msg); //public SeasonPassRewardStepReqDelegate SeasonPassRewardStepReq; //public delegate void SeasonPassRewardStepAckDelegate(MsgSeasonPassRewardStepAck msg); //public SeasonPassRewardStepAckDelegate SeasonPassRewardStepAck; //public delegate Task<string> GetSeasonPassRewardReqDelegate(MsgGetSeasonPassRewardReq msg); //public GetSeasonPassRewardReqDelegate GetSeasonPassRewardReq; //public delegate void GetSeasonPassRewardAckDelegate(MsgGetSeasonPassRewardAck msg); //public GetSeasonPassRewardAckDelegate GetSeasonPassRewardAck; //public delegate Task<string> ClassRewardInfoReqDelegate(MsgClassRewardInfoReq msg); //public ClassRewardInfoReqDelegate ClassRewardInfoReq; //public delegate void ClassRewardInfoAckDelegate(MsgClassRewardInfoAck msg); //public ClassRewardInfoAckDelegate ClassRewardInfoAck; //public delegate Task<string> GetClassRewardReqDelegate(MsgGetClassRewardReq msg); //public GetClassRewardReqDelegate GetClassRewardReq; //public delegate void GetClassRewardAckDelegate(MsgGetClassRewardAck msg); //public GetClassRewardAckDelegate GetClassRewardAck; //public delegate Task<string> QuestInfoReqDelegate(MsgQuestInfoReq msg); //public QuestInfoReqDelegate QuestInfoReq; //public delegate void QuestInfoAckDelegate(MsgQuestInfoAck msg); //public QuestInfoAckDelegate QuestInfoAck; //public delegate Task<string> QuestRewardReqDelegate(MsgQuestRewardReq msg); //public QuestRewardReqDelegate QuestRewardReq; //public delegate void QuestRewardAckDelegate(MsgQuestRewardAck msg); //public QuestRewardAckDelegate QuestRewardAck; //public delegate Task<string> QuestDayRewardReqDelegate(MsgQuestDayRewardReq msg); //public QuestDayRewardReqDelegate QuestDayRewardReq; //public delegate void QuestDayRewardAckDelegate(MsgQuestDayRewardAck msg); //public QuestDayRewardAckDelegate QuestDayRewardAck; public async Task <string> ProcessAsync(int protocolId, string json) { string ackJson = string.Empty; switch ((GameProtocol)protocolId) { //case GameProtocol.AUTH_USER_REQ: // { // if (AuthUserReq == null) // return ackJson; // MsgUserAuthReq msg = JsonConvert.DeserializeObject<MsgUserAuthReq>(json); // ackJson = await AuthUserReq(msg); // } // break; //case GameProtocol.EDIT_USER_NAME_REQ: // { // if (EditUserNameReq == null) // return ackJson; // MsgEditUserNameReq msg = JsonConvert.DeserializeObject<MsgEditUserNameReq>(json); // ackJson = await EditUserNameReq(msg); // } // break; //case GameProtocol.UPDATE_DECK_REQ: // { // if (UpdateDeckReq == null) // return ackJson; // MsgUpdateDeckReq msg = JsonConvert.DeserializeObject<MsgUpdateDeckReq>(json); // ackJson = await UpdateDeckReq(msg); // } // break; //case GameProtocol.END_TUTORIAL_REQ: // { // if (EndTutorialReq == null) // return ackJson; // MsgEndTutorialReq msg = JsonConvert.DeserializeObject<MsgEndTutorialReq>(json); // ackJson = await EndTutorialReq(msg); // } // break; case GameProtocol.START_MATCH_REQ: { if (StartMatchReq == null) { return(ackJson); } MsgStartMatchReq msg = JsonConvert.DeserializeObject <MsgStartMatchReq>(json); ackJson = await StartMatchReq(msg); } break; case GameProtocol.STATUS_MATCH_REQ: { if (StatusMatchReq == null) { return(ackJson); } MsgStatusMatchReq msg = JsonConvert.DeserializeObject <MsgStatusMatchReq>(json); ackJson = await StatusMatchReq(msg); } break; case GameProtocol.STOP_MATCH_REQ: { if (StopMatchReq == null) { return(ackJson); } MsgStopMatchReq msg = JsonConvert.DeserializeObject <MsgStopMatchReq>(json); ackJson = await StopMatchReq(msg); } break; //case GameProtocol.OPEN_BOX_REQ: // { // if (OpenBoxReq == null) // return ackJson; // MsgOpenBoxReq msg = JsonConvert.DeserializeObject<MsgOpenBoxReq>(json); // ackJson = await OpenBoxReq(msg); // } // break; //case GameProtocol.LEVELUP_DICE_REQ: // { // if (LevelUpDiceReq == null) // return ackJson; // MsgLevelUpDiceReq msg = JsonConvert.DeserializeObject<MsgLevelUpDiceReq>(json); // ackJson = await LevelUpDiceReq(msg); // } // break; //case GameProtocol.SEASON_INFO_REQ: // { // if (SeasonInfoReq == null) // return ackJson; // MsgSeasonInfoReq msg = JsonConvert.DeserializeObject<MsgSeasonInfoReq>(json); // ackJson = await SeasonInfoReq(msg); // } // break; //case GameProtocol.SEASON_RESET_REQ: // { // if (SeasonResetReq == null) // return ackJson; // MsgSeasonResetReq msg = JsonConvert.DeserializeObject<MsgSeasonResetReq>(json); // ackJson = await SeasonResetReq(msg); // } // break; //case GameProtocol.GET_RANK_REQ: // { // if (GetRankReq == null) // return ackJson; // MsgGetRankReq msg = JsonConvert.DeserializeObject<MsgGetRankReq>(json); // ackJson = await GetRankReq(msg); // } // break; //case GameProtocol.SEASON_PASS_INFO_REQ: // { // if (SeasonPassInfoReq == null) // return ackJson; // MsgSeasonPassInfoReq msg = JsonConvert.DeserializeObject<MsgSeasonPassInfoReq>(json); // ackJson = await SeasonPassInfoReq(msg); // } // break; //case GameProtocol.SEASON_PASS_REWARD_STEP_REQ: // { // if (SeasonPassRewardStepReq == null) // return ackJson; // MsgSeasonPassRewardStepReq msg = JsonConvert.DeserializeObject<MsgSeasonPassRewardStepReq>(json); // ackJson = await SeasonPassRewardStepReq(msg); // } // break; //case GameProtocol.GET_SEASON_PASS_REWARD_REQ: // { // if (GetSeasonPassRewardReq == null) // return ackJson; // MsgGetSeasonPassRewardReq msg = JsonConvert.DeserializeObject<MsgGetSeasonPassRewardReq>(json); // ackJson = await GetSeasonPassRewardReq(msg); // } // break; //case GameProtocol.CLASS_REWARD_INFO_REQ: // { // if (ClassRewardInfoReq == null) // return ackJson; // MsgClassRewardInfoReq msg = JsonConvert.DeserializeObject<MsgClassRewardInfoReq>(json); // ackJson = await ClassRewardInfoReq(msg); // } // break; //case GameProtocol.GET_CLASS_REWARD_REQ: // { // if (GetClassRewardReq == null) // return ackJson; // MsgGetClassRewardReq msg = JsonConvert.DeserializeObject<MsgGetClassRewardReq>(json); // ackJson = await GetClassRewardReq(msg); // } // break; //case GameProtocol.QUEST_INFO_REQ: // { // if (QuestInfoReq == null) // return ackJson; // MsgQuestInfoReq msg = JsonConvert.DeserializeObject<MsgQuestInfoReq>(json); // ackJson = await QuestInfoReq(msg); // } // break; //case GameProtocol.QUEST_REWARD_REQ: // { // if (QuestRewardReq == null) // return ackJson; // MsgQuestRewardReq msg = JsonConvert.DeserializeObject<MsgQuestRewardReq>(json); // ackJson = await QuestRewardReq(msg); // } // break; //case GameProtocol.QUEST_DAY_REWARD_REQ: // { // if (QuestDayRewardReq == null) // return ackJson; // MsgQuestDayRewardReq msg = JsonConvert.DeserializeObject<MsgQuestDayRewardReq>(json); // ackJson = await QuestDayRewardReq(msg); // } // break; } return(ackJson); }