AbyssDungeonHandler.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.area
  13. {
  14. public class AbyssDungeonHandler
  15. {
  16. private PomeloClient _socket;
  17. public AbyssDungeonInfoResponse lastAbyssDungeonInfoResponse { get { return _socket.GetLastResponse<AbyssDungeonInfoResponse>(); } }
  18. public AbyssDungeonDiscardResponse lastAbyssDungeonDiscardResponse { get { return _socket.GetLastResponse<AbyssDungeonDiscardResponse>(); } }
  19. public AbyssDungeonMatchLessStartResponse lastAbyssDungeonMatchLessStartResponse { get { return _socket.GetLastResponse<AbyssDungeonMatchLessStartResponse>(); } }
  20. static AbyssDungeonHandler()
  21. {
  22. EventTypes.RegistPushType("area.abyssDungeonPush.abyssDungeonBossDeadPush", typeof(AbyssDungeonBossDeadPush));
  23. EventTypes.RegistPushType("area.abyssDungeonPush.abyssDungeonEnterPush", typeof(AbyssDungeonEnterPush));
  24. EventTypes.RegistPushType("area.abyssDungeonPush.abyssDungeonSkillChangePush", typeof(AbyssDungeonSkillChangePush));
  25. EventTypes.RegistPushType("area.abyssDungeonPush.abyssDungeonMatchlessPush", typeof(AbyssDungeonMatchlessPush));
  26. EventTypes.RegistRequestType("area.abyssDungeonHandler.abyssDungeonInfoRequest", typeof(AbyssDungeonInfoRequest), typeof(AbyssDungeonInfoResponse));
  27. EventTypes.RegistRequestType("area.abyssDungeonHandler.abyssDungeonDiscardRequest", typeof(AbyssDungeonDiscardRequest), typeof(AbyssDungeonDiscardResponse));
  28. EventTypes.RegistRequestType("area.abyssDungeonHandler.abyssDungeonMatchLessStartRequest", typeof(AbyssDungeonMatchLessStartRequest), typeof(AbyssDungeonMatchLessStartResponse));
  29. }
  30. public AbyssDungeonHandler(PomeloClient socket)
  31. {
  32. this._socket = socket;
  33. }
  34. public void abyssDungeonInfoRequest(Action<PomeloException,AbyssDungeonInfoResponse> cb,object option = null)
  35. {
  36. var request = new AbyssDungeonInfoRequest();
  37. _socket.request<AbyssDungeonInfoResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  38. var rsp = msg as AbyssDungeonInfoResponse;
  39. s2c_code = rsp.s2c_code;
  40. s2c_msg = rsp.s2c_msg;
  41. return s2c_code == 200;
  42. }, cb, option);
  43. }
  44. public void abyssDungeonDiscardRequest(int index,Action<PomeloException,AbyssDungeonDiscardResponse> cb,object option = null)
  45. {
  46. var request = new AbyssDungeonDiscardRequest();
  47. request.index= index;
  48. _socket.request<AbyssDungeonDiscardResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  49. var rsp = msg as AbyssDungeonDiscardResponse;
  50. s2c_code = rsp.s2c_code;
  51. s2c_msg = rsp.s2c_msg;
  52. return s2c_code == 200;
  53. }, cb, option);
  54. }
  55. public void abyssDungeonMatchLessStartRequest(Action<PomeloException,AbyssDungeonMatchLessStartResponse> cb,object option = null)
  56. {
  57. var request = new AbyssDungeonMatchLessStartRequest();
  58. _socket.request<AbyssDungeonMatchLessStartResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  59. var rsp = msg as AbyssDungeonMatchLessStartResponse;
  60. s2c_code = rsp.s2c_code;
  61. s2c_msg = rsp.s2c_msg;
  62. return s2c_code == 200;
  63. }, cb, option);
  64. }
  65. public void onAbyssDungeonBossDeadPush(Action<AbyssDungeonBossDeadPush> cb)
  66. {
  67. _socket.listen_once<AbyssDungeonBossDeadPush>(cb);
  68. }
  69. public void onAbyssDungeonEnterPush(Action<AbyssDungeonEnterPush> cb)
  70. {
  71. _socket.listen_once<AbyssDungeonEnterPush>(cb);
  72. }
  73. public void onAbyssDungeonSkillChangePush(Action<AbyssDungeonSkillChangePush> cb)
  74. {
  75. _socket.listen_once<AbyssDungeonSkillChangePush>(cb);
  76. }
  77. public void onAbyssDungeonMatchlessPush(Action<AbyssDungeonMatchlessPush> cb)
  78. {
  79. _socket.listen_once<AbyssDungeonMatchlessPush>(cb);
  80. }
  81. }
  82. }