AbyssDungeonHandler.lua 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "abyssDungeonHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------AbyssDungeonHandler-------------------------------
  12. Pomelo.AbyssDungeonHandler = {}
  13. local function abyssDungeonInfoRequestEncoder(msg)
  14. local input = abyssDungeonHandler_pb.AbyssDungeonInfoRequest()
  15. protobuf.FromMessage(input,msg)
  16. return (input:SerializeToString())
  17. end
  18. local function abyssDungeonInfoRequestDecoder(stream)
  19. local res = abyssDungeonHandler_pb.AbyssDungeonInfoResponse()
  20. res:ParseFromString(stream)
  21. return res
  22. end
  23. function Pomelo.AbyssDungeonHandler.abyssDungeonInfoRequest(cb,option)
  24. local input = nil
  25. Socket.OnRequestStart("area.abyssDungeonHandler.abyssDungeonInfoRequest", option)
  26. Socket.Request("area.abyssDungeonHandler.abyssDungeonInfoRequest", input, function(res)
  27. if(res.s2c_code == 200) then
  28. Pomelo.AbyssDungeonHandler.lastAbyssDungeonInfoResponse = res
  29. Socket.OnRequestEnd("area.abyssDungeonHandler.abyssDungeonInfoRequest", true)
  30. cb(nil,res)
  31. else
  32. local ex = {}
  33. if(res.s2c_code) then
  34. ex.Code = res.s2c_code
  35. ex.Message = res.s2c_msg
  36. else
  37. ex.Code = 501
  38. ex.Message = "[LuaXmdsNetClient] area.abyssDungeonHandler.abyssDungeonInfoRequest decode error!!"
  39. end
  40. Socket.OnRequestEnd("area.abyssDungeonHandler.abyssDungeonInfoRequest", false,ex.Code,ex.Message)
  41. cb(ex,nil)
  42. end
  43. end, abyssDungeonInfoRequestEncoder, abyssDungeonInfoRequestDecoder)
  44. end
  45. local function abyssDungeonDiscardRequestEncoder(msg)
  46. local input = abyssDungeonHandler_pb.AbyssDungeonDiscardRequest()
  47. protobuf.FromMessage(input,msg)
  48. return (input:SerializeToString())
  49. end
  50. local function abyssDungeonDiscardRequestDecoder(stream)
  51. local res = abyssDungeonHandler_pb.AbyssDungeonDiscardResponse()
  52. res:ParseFromString(stream)
  53. return res
  54. end
  55. function Pomelo.AbyssDungeonHandler.abyssDungeonDiscardRequest(index,cb,option)
  56. local msg = {}
  57. msg.index = index
  58. Socket.OnRequestStart("area.abyssDungeonHandler.abyssDungeonDiscardRequest", option)
  59. Socket.Request("area.abyssDungeonHandler.abyssDungeonDiscardRequest", msg, function(res)
  60. if(res.s2c_code == 200) then
  61. Pomelo.AbyssDungeonHandler.lastAbyssDungeonDiscardResponse = res
  62. Socket.OnRequestEnd("area.abyssDungeonHandler.abyssDungeonDiscardRequest", true)
  63. cb(nil,res)
  64. else
  65. local ex = {}
  66. if(res.s2c_code) then
  67. ex.Code = res.s2c_code
  68. ex.Message = res.s2c_msg
  69. else
  70. ex.Code = 501
  71. ex.Message = "[LuaXmdsNetClient] area.abyssDungeonHandler.abyssDungeonDiscardRequest decode error!!"
  72. end
  73. Socket.OnRequestEnd("area.abyssDungeonHandler.abyssDungeonDiscardRequest", false,ex.Code,ex.Message)
  74. cb(ex,nil)
  75. end
  76. end, abyssDungeonDiscardRequestEncoder, abyssDungeonDiscardRequestDecoder)
  77. end
  78. local function abyssDungeonMatchLessStartRequestEncoder(msg)
  79. local input = abyssDungeonHandler_pb.AbyssDungeonMatchLessStartRequest()
  80. protobuf.FromMessage(input,msg)
  81. return (input:SerializeToString())
  82. end
  83. local function abyssDungeonMatchLessStartRequestDecoder(stream)
  84. local res = abyssDungeonHandler_pb.AbyssDungeonMatchLessStartResponse()
  85. res:ParseFromString(stream)
  86. return res
  87. end
  88. function Pomelo.AbyssDungeonHandler.abyssDungeonMatchLessStartRequest(cb,option)
  89. local input = nil
  90. Socket.OnRequestStart("area.abyssDungeonHandler.abyssDungeonMatchLessStartRequest", option)
  91. Socket.Request("area.abyssDungeonHandler.abyssDungeonMatchLessStartRequest", input, function(res)
  92. if(res.s2c_code == 200) then
  93. Pomelo.AbyssDungeonHandler.lastAbyssDungeonMatchLessStartResponse = res
  94. Socket.OnRequestEnd("area.abyssDungeonHandler.abyssDungeonMatchLessStartRequest", true)
  95. cb(nil,res)
  96. else
  97. local ex = {}
  98. if(res.s2c_code) then
  99. ex.Code = res.s2c_code
  100. ex.Message = res.s2c_msg
  101. else
  102. ex.Code = 501
  103. ex.Message = "[LuaXmdsNetClient] area.abyssDungeonHandler.abyssDungeonMatchLessStartRequest decode error!!"
  104. end
  105. Socket.OnRequestEnd("area.abyssDungeonHandler.abyssDungeonMatchLessStartRequest", false,ex.Code,ex.Message)
  106. cb(ex,nil)
  107. end
  108. end, abyssDungeonMatchLessStartRequestEncoder, abyssDungeonMatchLessStartRequestDecoder)
  109. end
  110. local function abyssDungeonBossDeadPushDecoder(stream)
  111. local res = abyssDungeonHandler_pb.AbyssDungeonBossDeadPush()
  112. res:ParseFromString(stream)
  113. return res
  114. end
  115. function Pomelo.AbyssDungeonHandler.abyssDungeonBossDeadPush(cb)
  116. Socket.On("area.abyssDungeonPush.abyssDungeonBossDeadPush", function(res)
  117. Pomelo.AbyssDungeonHandler.lastAbyssDungeonBossDeadPush = res
  118. cb(nil,res)
  119. end, abyssDungeonBossDeadPushDecoder)
  120. end
  121. local function abyssDungeonEnterPushDecoder(stream)
  122. local res = abyssDungeonHandler_pb.AbyssDungeonEnterPush()
  123. res:ParseFromString(stream)
  124. return res
  125. end
  126. function Pomelo.AbyssDungeonHandler.abyssDungeonEnterPush(cb)
  127. Socket.On("area.abyssDungeonPush.abyssDungeonEnterPush", function(res)
  128. Pomelo.AbyssDungeonHandler.lastAbyssDungeonEnterPush = res
  129. cb(nil,res)
  130. end, abyssDungeonEnterPushDecoder)
  131. end
  132. local function abyssDungeonSkillChangePushDecoder(stream)
  133. local res = abyssDungeonHandler_pb.AbyssDungeonSkillChangePush()
  134. res:ParseFromString(stream)
  135. return res
  136. end
  137. function Pomelo.AbyssDungeonHandler.abyssDungeonSkillChangePush(cb)
  138. Socket.On("area.abyssDungeonPush.abyssDungeonSkillChangePush", function(res)
  139. Pomelo.AbyssDungeonHandler.lastAbyssDungeonSkillChangePush = res
  140. cb(nil,res)
  141. end, abyssDungeonSkillChangePushDecoder)
  142. end
  143. local function abyssDungeonMatchlessPushDecoder(stream)
  144. local res = abyssDungeonHandler_pb.AbyssDungeonMatchlessPush()
  145. res:ParseFromString(stream)
  146. return res
  147. end
  148. function Pomelo.AbyssDungeonHandler.abyssDungeonMatchlessPush(cb)
  149. Socket.On("area.abyssDungeonPush.abyssDungeonMatchlessPush", function(res)
  150. Pomelo.AbyssDungeonHandler.lastAbyssDungeonMatchlessPush = res
  151. cb(nil,res)
  152. end, abyssDungeonMatchlessPushDecoder)
  153. end
  154. --------------------------------Pomelo-------------------------------
  155. return Pomelo