ZhanYaoHandler.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /*-----------------------------------------------
  2. *本文件由代码生成器自动生成,
  3. *千万不要修改本文件的任何代码,
  4. *修改的的任何代码都会被覆盖掉!
  5. --------------------------------------------------*/
  6. using System.IO;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using Pomelo.DotNetClient;
  12. namespace pomelo.zhanyao
  13. {
  14. public class ZhanYaoHandler
  15. {
  16. private PomeloClient _socket;
  17. public GetZhanYaoMainDataponse lastGetZhanYaoMainDataponse { get { return _socket.GetLastResponse<GetZhanYaoMainDataponse>(); } }
  18. public UpgradeYaoQiLevelResponse lastUpgradeYaoQiLevelResponse { get { return _socket.GetLastResponse<UpgradeYaoQiLevelResponse>(); } }
  19. public GetTodayZhanYaoAwardResponse lastGetTodayZhanYaoAwardResponse { get { return _socket.GetLastResponse<GetTodayZhanYaoAwardResponse>(); } }
  20. public GetPlayerShareYaoQiResponse lastGetPlayerShareYaoQiResponse { get { return _socket.GetLastResponse<GetPlayerShareYaoQiResponse>(); } }
  21. public ZhanyaoLotteryResponse lastZhanyaoLotteryResponse { get { return _socket.GetLastResponse<ZhanyaoLotteryResponse>(); } }
  22. public ReceiveZhanyaoRewardBoxResponse lastReceiveZhanyaoRewardBoxResponse { get { return _socket.GetLastResponse<ReceiveZhanyaoRewardBoxResponse>(); } }
  23. public SearchDemonResponse lastSearchDemonResponse { get { return _socket.GetLastResponse<SearchDemonResponse>(); } }
  24. public UpgradeGourdResponse lastUpgradeGourdResponse { get { return _socket.GetLastResponse<UpgradeGourdResponse>(); } }
  25. public ClearSearchDemonFlagResponse lastClearSearchDemonFlagResponse { get { return _socket.GetLastResponse<ClearSearchDemonFlagResponse>(); } }
  26. public SoulLampResponse lastSoulLampResponse { get { return _socket.GetLastResponse<SoulLampResponse>(); } }
  27. public GetStoryAwardResponse lastGetStoryAwardResponse { get { return _socket.GetLastResponse<GetStoryAwardResponse>(); } }
  28. public MosaicSoulBallResponse lastMosaicSoulBallResponse { get { return _socket.GetLastResponse<MosaicSoulBallResponse>(); } }
  29. public SwitchSkillResponse lastSwitchSkillResponse { get { return _socket.GetLastResponse<SwitchSkillResponse>(); } }
  30. public UpgradeYaojueSkillResponse lastUpgradeYaojueSkillResponse { get { return _socket.GetLastResponse<UpgradeYaojueSkillResponse>(); } }
  31. public AlchemyResponse lastAlchemyResponse { get { return _socket.GetLastResponse<AlchemyResponse>(); } }
  32. public ReceiveAlchemyItemResponse lastReceiveAlchemyItemResponse { get { return _socket.GetLastResponse<ReceiveAlchemyItemResponse>(); } }
  33. public RemoveSoulBallResponse lastRemoveSoulBallResponse { get { return _socket.GetLastResponse<RemoveSoulBallResponse>(); } }
  34. static ZhanYaoHandler()
  35. {
  36. EventTypes.RegistPushType("zhanyao.zhanYaoPush.playerYaoQiSharePush", typeof(PlayerYaoQiSharePush));
  37. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getZhanYaoMainDataRequest", typeof(GetZhanYaoMainDataRequest), typeof(GetZhanYaoMainDataponse));
  38. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.upgradeYaoQiLevelRequest", typeof(UpgradeYaoQiLevelRequest), typeof(UpgradeYaoQiLevelResponse));
  39. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getTodayZhanYaoAwardRequest", typeof(GetTodayZhanYaoAwardRequest), typeof(GetTodayZhanYaoAwardResponse));
  40. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getPlayerShareYaoQiRequest", typeof(GetPlayerShareYaoQiRequest), typeof(GetPlayerShareYaoQiResponse));
  41. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.zhanyaoLotteryRequest", typeof(ZhanyaoLotteryRequest), typeof(ZhanyaoLotteryResponse));
  42. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.receiveZhanyaoRewardBoxRequest", typeof(ReceiveZhanyaoRewardBoxRequest), typeof(ReceiveZhanyaoRewardBoxResponse));
  43. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.searchDemonRequest", typeof(SearchDemonRequest), typeof(SearchDemonResponse));
  44. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.upgradeGourdRequest", typeof(UpgradeGourdRequest), typeof(UpgradeGourdResponse));
  45. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.clearSearchDemonFlagRequest", typeof(ClearSearchDemonFlagRequest), typeof(ClearSearchDemonFlagResponse));
  46. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.soulLampRequest", typeof(SoulLampRequest), typeof(SoulLampResponse));
  47. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.getStoryAwardRequest", typeof(GetStoryAwardRequest), typeof(GetStoryAwardResponse));
  48. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.mosaicSoulBallRequest", typeof(MosaicSoulBallRequest), typeof(MosaicSoulBallResponse));
  49. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.switchSkillRequest", typeof(SwitchSkillRequest), typeof(SwitchSkillResponse));
  50. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.upgradeYaojueSkillRequest", typeof(UpgradeYaojueSkillRequest), typeof(UpgradeYaojueSkillResponse));
  51. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.alchemyRequest", typeof(AlchemyRequest), typeof(AlchemyResponse));
  52. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.receiveAlchemyItemRequest", typeof(ReceiveAlchemyItemRequest), typeof(ReceiveAlchemyItemResponse));
  53. EventTypes.RegistRequestType("zhanyao.zhanYaoHandler.removeSoulBallRequest", typeof(RemoveSoulBallRequest), typeof(RemoveSoulBallResponse));
  54. }
  55. public ZhanYaoHandler(PomeloClient socket)
  56. {
  57. this._socket = socket;
  58. }
  59. public void getZhanYaoMainDataRequest(Action<PomeloException,GetZhanYaoMainDataponse> cb,object option = null)
  60. {
  61. var request = new GetZhanYaoMainDataRequest();
  62. _socket.request<GetZhanYaoMainDataponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  63. var rsp = msg as GetZhanYaoMainDataponse;
  64. s2c_code = rsp.s2c_code;
  65. s2c_msg = rsp.s2c_msg;
  66. return s2c_code == 200;
  67. }, cb, option);
  68. }
  69. public void upgradeYaoQiLevelRequest(Action<PomeloException,UpgradeYaoQiLevelResponse> cb,object option = null)
  70. {
  71. var request = new UpgradeYaoQiLevelRequest();
  72. _socket.request<UpgradeYaoQiLevelResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  73. var rsp = msg as UpgradeYaoQiLevelResponse;
  74. s2c_code = rsp.s2c_code;
  75. s2c_msg = rsp.s2c_msg;
  76. return s2c_code == 200;
  77. }, cb, option);
  78. }
  79. public void getTodayZhanYaoAwardRequest(int c2s_awardId,Action<PomeloException,GetTodayZhanYaoAwardResponse> cb,object option = null)
  80. {
  81. var request = new GetTodayZhanYaoAwardRequest();
  82. request.c2s_awardId= c2s_awardId;
  83. _socket.request<GetTodayZhanYaoAwardResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  84. var rsp = msg as GetTodayZhanYaoAwardResponse;
  85. s2c_code = rsp.s2c_code;
  86. s2c_msg = rsp.s2c_msg;
  87. return s2c_code == 200;
  88. }, cb, option);
  89. }
  90. public void getPlayerShareYaoQiRequest(int c2s_areaId,int c2s_itemShareId,Action<PomeloException,GetPlayerShareYaoQiResponse> cb,object option = null)
  91. {
  92. var request = new GetPlayerShareYaoQiRequest();
  93. request.c2s_areaId= c2s_areaId;
  94. request.c2s_itemShareId= c2s_itemShareId;
  95. _socket.request<GetPlayerShareYaoQiResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  96. var rsp = msg as GetPlayerShareYaoQiResponse;
  97. s2c_code = rsp.s2c_code;
  98. s2c_msg = rsp.s2c_msg;
  99. return s2c_code == 200;
  100. }, cb, option);
  101. }
  102. public void zhanyaoLotteryRequest(Action<PomeloException,ZhanyaoLotteryResponse> cb,object option = null)
  103. {
  104. var request = new ZhanyaoLotteryRequest();
  105. _socket.request<ZhanyaoLotteryResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  106. var rsp = msg as ZhanyaoLotteryResponse;
  107. s2c_code = rsp.s2c_code;
  108. s2c_msg = rsp.s2c_msg;
  109. return s2c_code == 200;
  110. }, cb, option);
  111. }
  112. public void receiveZhanyaoRewardBoxRequest(Action<PomeloException,ReceiveZhanyaoRewardBoxResponse> cb,object option = null)
  113. {
  114. var request = new ReceiveZhanyaoRewardBoxRequest();
  115. _socket.request<ReceiveZhanyaoRewardBoxResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  116. var rsp = msg as ReceiveZhanyaoRewardBoxResponse;
  117. s2c_code = rsp.s2c_code;
  118. s2c_msg = rsp.s2c_msg;
  119. return s2c_code == 200;
  120. }, cb, option);
  121. }
  122. public void searchDemonRequest(Action<PomeloException,SearchDemonResponse> cb,object option = null)
  123. {
  124. var request = new SearchDemonRequest();
  125. _socket.request<SearchDemonResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  126. var rsp = msg as SearchDemonResponse;
  127. s2c_code = rsp.s2c_code;
  128. s2c_msg = rsp.s2c_msg;
  129. return s2c_code == 200;
  130. }, cb, option);
  131. }
  132. public void upgradeGourdRequest(int opType,Action<PomeloException,UpgradeGourdResponse> cb,object option = null)
  133. {
  134. var request = new UpgradeGourdRequest();
  135. request.opType= opType;
  136. _socket.request<UpgradeGourdResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  137. var rsp = msg as UpgradeGourdResponse;
  138. s2c_code = rsp.s2c_code;
  139. s2c_msg = rsp.s2c_msg;
  140. return s2c_code == 200;
  141. }, cb, option);
  142. }
  143. public void clearSearchDemonFlagRequest(Action<PomeloException,ClearSearchDemonFlagResponse> cb,object option = null)
  144. {
  145. var request = new ClearSearchDemonFlagRequest();
  146. _socket.request<ClearSearchDemonFlagResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  147. var rsp = msg as ClearSearchDemonFlagResponse;
  148. s2c_code = rsp.s2c_code;
  149. s2c_msg = rsp.s2c_msg;
  150. return s2c_code == 200;
  151. }, cb, option);
  152. }
  153. public void soulLampRequest(Action<PomeloException,SoulLampResponse> cb,object option = null)
  154. {
  155. var request = new SoulLampRequest();
  156. _socket.request<SoulLampResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  157. var rsp = msg as SoulLampResponse;
  158. s2c_code = rsp.s2c_code;
  159. s2c_msg = rsp.s2c_msg;
  160. return s2c_code == 200;
  161. }, cb, option);
  162. }
  163. public void getStoryAwardRequest(int memoriesId,Action<PomeloException,GetStoryAwardResponse> cb,object option = null)
  164. {
  165. var request = new GetStoryAwardRequest();
  166. request.memoriesId= memoriesId;
  167. _socket.request<GetStoryAwardResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  168. var rsp = msg as GetStoryAwardResponse;
  169. s2c_code = rsp.s2c_code;
  170. s2c_msg = rsp.s2c_msg;
  171. return s2c_code == 200;
  172. }, cb, option);
  173. }
  174. public void mosaicSoulBallRequest(int skillId,int pos,Action<PomeloException,MosaicSoulBallResponse> cb,object option = null)
  175. {
  176. var request = new MosaicSoulBallRequest();
  177. request.skillId= skillId;
  178. request.pos= pos;
  179. _socket.request<MosaicSoulBallResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  180. var rsp = msg as MosaicSoulBallResponse;
  181. s2c_code = rsp.s2c_code;
  182. s2c_msg = rsp.s2c_msg;
  183. return s2c_code == 200;
  184. }, cb, option);
  185. }
  186. public void switchSkillRequest(Action<PomeloException,SwitchSkillResponse> cb,object option = null)
  187. {
  188. var request = new SwitchSkillRequest();
  189. _socket.request<SwitchSkillResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  190. var rsp = msg as SwitchSkillResponse;
  191. s2c_code = rsp.s2c_code;
  192. s2c_msg = rsp.s2c_msg;
  193. return s2c_code == 200;
  194. }, cb, option);
  195. }
  196. public void upgradeYaojueSkillRequest(Action<PomeloException,UpgradeYaojueSkillResponse> cb,object option = null)
  197. {
  198. var request = new UpgradeYaojueSkillRequest();
  199. _socket.request<UpgradeYaojueSkillResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  200. var rsp = msg as UpgradeYaojueSkillResponse;
  201. s2c_code = rsp.s2c_code;
  202. s2c_msg = rsp.s2c_msg;
  203. return s2c_code == 200;
  204. }, cb, option);
  205. }
  206. public void alchemyRequest(int destId,List<pomelo.zhanyao.AlchemyItem> chooseItem,Action<PomeloException,AlchemyResponse> cb,object option = null)
  207. {
  208. var request = new AlchemyRequest();
  209. request.destId= destId;
  210. request.chooseItem.AddRange(chooseItem);
  211. _socket.request<AlchemyResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  212. var rsp = msg as AlchemyResponse;
  213. s2c_code = rsp.s2c_code;
  214. s2c_msg = rsp.s2c_msg;
  215. return s2c_code == 200;
  216. }, cb, option);
  217. }
  218. public void receiveAlchemyItemRequest(int index,Action<PomeloException,ReceiveAlchemyItemResponse> cb,object option = null)
  219. {
  220. var request = new ReceiveAlchemyItemRequest();
  221. request.index= index;
  222. _socket.request<ReceiveAlchemyItemResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  223. var rsp = msg as ReceiveAlchemyItemResponse;
  224. s2c_code = rsp.s2c_code;
  225. s2c_msg = rsp.s2c_msg;
  226. return s2c_code == 200;
  227. }, cb, option);
  228. }
  229. public void removeSoulBallRequest(int skillId,int pos,Action<PomeloException,RemoveSoulBallResponse> cb,object option = null)
  230. {
  231. var request = new RemoveSoulBallRequest();
  232. request.skillId= skillId;
  233. request.pos= pos;
  234. _socket.request<RemoveSoulBallResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  235. var rsp = msg as RemoveSoulBallResponse;
  236. s2c_code = rsp.s2c_code;
  237. s2c_msg = rsp.s2c_msg;
  238. return s2c_code == 200;
  239. }, cb, option);
  240. }
  241. public void onPlayerYaoQiSharePush(Action<PlayerYaoQiSharePush> cb)
  242. {
  243. _socket.listen_once<PlayerYaoQiSharePush>(cb);
  244. }
  245. }
  246. }