/*----------------------------------------------- *本文件由代码生成器自动生成, *千万不要修改本文件的任何代码, *修改的的任何代码都会被覆盖掉! --------------------------------------------------*/ using System.IO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Pomelo.DotNetClient; namespace pomelo.zhanyao { public class ZhanYaoHandler { private PomeloClient _socket; public GetZhanYaoMainDataponse lastGetZhanYaoMainDataponse { get { return _socket.GetLastResponse(); } } public UpgradeYaoQiLevelResponse lastUpgradeYaoQiLevelResponse { get { return _socket.GetLastResponse(); } } public GetTodayZhanYaoAwardResponse lastGetTodayZhanYaoAwardResponse { get { return _socket.GetLastResponse(); } } public GetPlayerShareYaoQiResponse lastGetPlayerShareYaoQiResponse { get { return _socket.GetLastResponse(); } } public ZhanyaoLotteryResponse lastZhanyaoLotteryResponse { get { return _socket.GetLastResponse(); } } public ReceiveZhanyaoRewardBoxResponse lastReceiveZhanyaoRewardBoxResponse { get { return _socket.GetLastResponse(); } } public SearchDemonResponse lastSearchDemonResponse { get { return _socket.GetLastResponse(); } } public UpgradeGourdResponse lastUpgradeGourdResponse { get { return _socket.GetLastResponse(); } } public ClearSearchDemonFlagResponse lastClearSearchDemonFlagResponse { get { return _socket.GetLastResponse(); } } public SoulLampResponse lastSoulLampResponse { get { return _socket.GetLastResponse(); } } public GetStoryAwardResponse lastGetStoryAwardResponse { get { return _socket.GetLastResponse(); } } public MosaicSoulBallResponse lastMosaicSoulBallResponse { get { return _socket.GetLastResponse(); } } public SwitchSkillResponse lastSwitchSkillResponse { get { return _socket.GetLastResponse(); } } public UpgradeYaojueSkillResponse lastUpgradeYaojueSkillResponse { get { return _socket.GetLastResponse(); } } public AlchemyResponse lastAlchemyResponse { get { return _socket.GetLastResponse(); } } public ReceiveAlchemyItemResponse lastReceiveAlchemyItemResponse { get { return _socket.GetLastResponse(); } } public RemoveSoulBallResponse lastRemoveSoulBallResponse { get { return _socket.GetLastResponse(); } } static ZhanYaoHandler() { EventTypes.RegistPushType("zhanyao.zhanYaoPush.playerYaoQiSharePush", typeof(PlayerYaoQiSharePush)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getZhanYaoMainDataRequest", typeof(GetZhanYaoMainDataRequest), typeof(GetZhanYaoMainDataponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.upgradeYaoQiLevelRequest", typeof(UpgradeYaoQiLevelRequest), typeof(UpgradeYaoQiLevelResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getTodayZhanYaoAwardRequest", typeof(GetTodayZhanYaoAwardRequest), typeof(GetTodayZhanYaoAwardResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getPlayerShareYaoQiRequest", typeof(GetPlayerShareYaoQiRequest), typeof(GetPlayerShareYaoQiResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.zhanyaoLotteryRequest", typeof(ZhanyaoLotteryRequest), typeof(ZhanyaoLotteryResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.receiveZhanyaoRewardBoxRequest", typeof(ReceiveZhanyaoRewardBoxRequest), typeof(ReceiveZhanyaoRewardBoxResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.searchDemonRequest", typeof(SearchDemonRequest), typeof(SearchDemonResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.upgradeGourdRequest", typeof(UpgradeGourdRequest), typeof(UpgradeGourdResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.clearSearchDemonFlagRequest", typeof(ClearSearchDemonFlagRequest), typeof(ClearSearchDemonFlagResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.soulLampRequest", typeof(SoulLampRequest), typeof(SoulLampResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getStoryAwardRequest", typeof(GetStoryAwardRequest), typeof(GetStoryAwardResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.mosaicSoulBallRequest", typeof(MosaicSoulBallRequest), typeof(MosaicSoulBallResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.switchSkillRequest", typeof(SwitchSkillRequest), typeof(SwitchSkillResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.upgradeYaojueSkillRequest", typeof(UpgradeYaojueSkillRequest), typeof(UpgradeYaojueSkillResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.alchemyRequest", typeof(AlchemyRequest), typeof(AlchemyResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.receiveAlchemyItemRequest", typeof(ReceiveAlchemyItemRequest), typeof(ReceiveAlchemyItemResponse)); EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.removeSoulBallRequest", typeof(RemoveSoulBallRequest), typeof(RemoveSoulBallResponse)); } public ZhanYaoHandler(PomeloClient socket) { this._socket = socket; } public void getZhanYaoMainDataRequest(Action cb,object option = null) { var request = new GetZhanYaoMainDataRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetZhanYaoMainDataponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void upgradeYaoQiLevelRequest(Action cb,object option = null) { var request = new UpgradeYaoQiLevelRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as UpgradeYaoQiLevelResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getTodayZhanYaoAwardRequest(int c2s_awardId,Action cb,object option = null) { var request = new GetTodayZhanYaoAwardRequest(); request.c2s_awardId= c2s_awardId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetTodayZhanYaoAwardResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getPlayerShareYaoQiRequest(int c2s_areaId,int c2s_itemShareId,Action cb,object option = null) { var request = new GetPlayerShareYaoQiRequest(); request.c2s_areaId= c2s_areaId; request.c2s_itemShareId= c2s_itemShareId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetPlayerShareYaoQiResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void zhanyaoLotteryRequest(Action cb,object option = null) { var request = new ZhanyaoLotteryRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ZhanyaoLotteryResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void receiveZhanyaoRewardBoxRequest(Action cb,object option = null) { var request = new ReceiveZhanyaoRewardBoxRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ReceiveZhanyaoRewardBoxResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void searchDemonRequest(Action cb,object option = null) { var request = new SearchDemonRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as SearchDemonResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void upgradeGourdRequest(int opType,Action cb,object option = null) { var request = new UpgradeGourdRequest(); request.opType= opType; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as UpgradeGourdResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void clearSearchDemonFlagRequest(Action cb,object option = null) { var request = new ClearSearchDemonFlagRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ClearSearchDemonFlagResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void soulLampRequest(Action cb,object option = null) { var request = new SoulLampRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as SoulLampResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getStoryAwardRequest(int memoriesId,Action cb,object option = null) { var request = new GetStoryAwardRequest(); request.memoriesId= memoriesId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetStoryAwardResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void mosaicSoulBallRequest(int skillId,int pos,Action cb,object option = null) { var request = new MosaicSoulBallRequest(); request.skillId= skillId; request.pos= pos; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as MosaicSoulBallResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void switchSkillRequest(Action cb,object option = null) { var request = new SwitchSkillRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as SwitchSkillResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void upgradeYaojueSkillRequest(Action cb,object option = null) { var request = new UpgradeYaojueSkillRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as UpgradeYaojueSkillResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void alchemyRequest(int destId,List chooseItem,Action cb,object option = null) { var request = new AlchemyRequest(); request.destId= destId; request.chooseItem.AddRange(chooseItem); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as AlchemyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void receiveAlchemyItemRequest(int index,Action cb,object option = null) { var request = new ReceiveAlchemyItemRequest(); request.index= index; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ReceiveAlchemyItemResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void removeSoulBallRequest(int skillId,int pos,Action cb,object option = null) { var request = new RemoveSoulBallRequest(); request.skillId= skillId; request.pos= pos; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as RemoveSoulBallResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void onPlayerYaoQiSharePush(Action cb) { _socket.listen_once(cb); } } }