WeekendStarDungeonHandler.lua 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "weekendStarDungeonHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------WeekendStarDungeonHandler-------------------------------
  12. Pomelo.WeekendStarDungeonHandler = {}
  13. local function weekendStarDungeonEnterNpcRequestEncoder(msg)
  14. local input = weekendStarDungeonHandler_pb.WeekendStarDungeonEnterNpcRequest()
  15. protobuf.FromMessage(input,msg)
  16. return (input:SerializeToString())
  17. end
  18. local function weekendStarDungeonEnterNpcRequestDecoder(stream)
  19. local res = weekendStarDungeonHandler_pb.WeekendStarDungeonEnterNpcResponse()
  20. res:ParseFromString(stream)
  21. return res
  22. end
  23. function Pomelo.WeekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest(cb,option)
  24. local input = nil
  25. Socket.OnRequestStart("area.weekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest", option)
  26. Socket.Request("area.weekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest", input, function(res)
  27. if(res.s2c_code == 200) then
  28. Pomelo.WeekendStarDungeonHandler.lastWeekendStarDungeonEnterNpcResponse = res
  29. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest", 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.weekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest decode error!!"
  39. end
  40. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest", false,ex.Code,ex.Message)
  41. cb(ex,nil)
  42. end
  43. end, weekendStarDungeonEnterNpcRequestEncoder, weekendStarDungeonEnterNpcRequestDecoder)
  44. end
  45. local function weekendStarDungeonRecvRequestEncoder(msg)
  46. local input = weekendStarDungeonHandler_pb.WeekendStarDungeonRecvRequest()
  47. protobuf.FromMessage(input,msg)
  48. return (input:SerializeToString())
  49. end
  50. local function weekendStarDungeonRecvRequestDecoder(stream)
  51. local res = weekendStarDungeonHandler_pb.WeekendStarDungeonRecvResponse()
  52. res:ParseFromString(stream)
  53. return res
  54. end
  55. function Pomelo.WeekendStarDungeonHandler.weekendStarDungeonRecvRequest(s2c_id,cb,option)
  56. local msg = {}
  57. msg.s2c_id = s2c_id
  58. Socket.OnRequestStart("area.weekendStarDungeonHandler.weekendStarDungeonRecvRequest", option)
  59. Socket.Request("area.weekendStarDungeonHandler.weekendStarDungeonRecvRequest", msg, function(res)
  60. if(res.s2c_code == 200) then
  61. Pomelo.WeekendStarDungeonHandler.lastWeekendStarDungeonRecvResponse = res
  62. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonRecvRequest", 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.weekendStarDungeonHandler.weekendStarDungeonRecvRequest decode error!!"
  72. end
  73. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonRecvRequest", false,ex.Code,ex.Message)
  74. cb(ex,nil)
  75. end
  76. end, weekendStarDungeonRecvRequestEncoder, weekendStarDungeonRecvRequestDecoder)
  77. end
  78. local function weekendStarDungeonSelectTypeRequestEncoder(msg)
  79. local input = weekendStarDungeonHandler_pb.WeekendStarDungeonSelectTypeRequest()
  80. protobuf.FromMessage(input,msg)
  81. return (input:SerializeToString())
  82. end
  83. local function weekendStarDungeonSelectTypeRequestDecoder(stream)
  84. local res = weekendStarDungeonHandler_pb.WeekendStarDungeonSelectTypeResponse()
  85. res:ParseFromString(stream)
  86. return res
  87. end
  88. function Pomelo.WeekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest(cb,option)
  89. local input = nil
  90. Socket.OnRequestStart("area.weekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest", option)
  91. Socket.Request("area.weekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest", input, function(res)
  92. if(res.s2c_code == 200) then
  93. Pomelo.WeekendStarDungeonHandler.lastWeekendStarDungeonSelectTypeResponse = res
  94. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest", 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.weekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest decode error!!"
  104. end
  105. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest", false,ex.Code,ex.Message)
  106. cb(ex,nil)
  107. end
  108. end, weekendStarDungeonSelectTypeRequestEncoder, weekendStarDungeonSelectTypeRequestDecoder)
  109. end
  110. local function weekendStarDungeonRecvListRequestEncoder(msg)
  111. local input = weekendStarDungeonHandler_pb.WeekendStarDungeonRecvListRequest()
  112. protobuf.FromMessage(input,msg)
  113. return (input:SerializeToString())
  114. end
  115. local function weekendStarDungeonRecvListRequestDecoder(stream)
  116. local res = weekendStarDungeonHandler_pb.WeekendStarDungeonRecvListResponse()
  117. res:ParseFromString(stream)
  118. return res
  119. end
  120. function Pomelo.WeekendStarDungeonHandler.weekendStarDungeonRecvListRequest(cb,option)
  121. local input = nil
  122. Socket.OnRequestStart("area.weekendStarDungeonHandler.weekendStarDungeonRecvListRequest", option)
  123. Socket.Request("area.weekendStarDungeonHandler.weekendStarDungeonRecvListRequest", input, function(res)
  124. if(res.s2c_code == 200) then
  125. Pomelo.WeekendStarDungeonHandler.lastWeekendStarDungeonRecvListResponse = res
  126. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonRecvListRequest", true)
  127. cb(nil,res)
  128. else
  129. local ex = {}
  130. if(res.s2c_code) then
  131. ex.Code = res.s2c_code
  132. ex.Message = res.s2c_msg
  133. else
  134. ex.Code = 501
  135. ex.Message = "[LuaXmdsNetClient] area.weekendStarDungeonHandler.weekendStarDungeonRecvListRequest decode error!!"
  136. end
  137. Socket.OnRequestEnd("area.weekendStarDungeonHandler.weekendStarDungeonRecvListRequest", false,ex.Code,ex.Message)
  138. cb(ex,nil)
  139. end
  140. end, weekendStarDungeonRecvListRequestEncoder, weekendStarDungeonRecvListRequestDecoder)
  141. end
  142. local function onWeekendStarDungeonEnterNumPushDecoder(stream)
  143. local res = weekendStarDungeonHandler_pb.OnWeekendStarDungeonEnterNumPush()
  144. res:ParseFromString(stream)
  145. return res
  146. end
  147. function Pomelo.WeekendStarDungeonHandler.onWeekendStarDungeonEnterNumPush(cb)
  148. Socket.On("area.weekendStarDungeonPush.onWeekendStarDungeonEnterNumPush", function(res)
  149. Pomelo.WeekendStarDungeonHandler.lastOnWeekendStarDungeonEnterNumPush = res
  150. cb(nil,res)
  151. end, onWeekendStarDungeonEnterNumPushDecoder)
  152. end
  153. local function onWeekendStarDungeonBossOrderPushDecoder(stream)
  154. local res = weekendStarDungeonHandler_pb.OnWeekendStarDungeonBossOrderPush()
  155. res:ParseFromString(stream)
  156. return res
  157. end
  158. function Pomelo.WeekendStarDungeonHandler.onWeekendStarDungeonBossOrderPush(cb)
  159. Socket.On("area.weekendStarDungeonPush.onWeekendStarDungeonBossOrderPush", function(res)
  160. Pomelo.WeekendStarDungeonHandler.lastOnWeekendStarDungeonBossOrderPush = res
  161. cb(nil,res)
  162. end, onWeekendStarDungeonBossOrderPushDecoder)
  163. end
  164. local function onWeekendStarDungeonRankChangePushDecoder(stream)
  165. local res = weekendStarDungeonHandler_pb.OnWeekendStarDungeonRankChangePush()
  166. res:ParseFromString(stream)
  167. return res
  168. end
  169. function Pomelo.WeekendStarDungeonHandler.onWeekendStarDungeonRankChangePush(cb)
  170. Socket.On("area.weekendStarDungeonPush.onWeekendStarDungeonRankChangePush", function(res)
  171. Pomelo.WeekendStarDungeonHandler.lastOnWeekendStarDungeonRankChangePush = res
  172. cb(nil,res)
  173. end, onWeekendStarDungeonRankChangePushDecoder)
  174. end
  175. --------------------------------Pomelo-------------------------------
  176. return Pomelo