DemonTowerHandler.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "demonTowerHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------DemonTowerHandler-------------------------------
  12. Pomelo.DemonTowerHandler = {}
  13. local function getDemonTowerInfoRequestEncoder(msg)
  14. local input = demonTowerHandler_pb.GetDemonTowerInfoRequest()
  15. protobuf.FromMessage(input,msg)
  16. return (input:SerializeToString())
  17. end
  18. local function getDemonTowerInfoRequestDecoder(stream)
  19. local res = demonTowerHandler_pb.GetDemonTowerInfoResponse()
  20. res:ParseFromString(stream)
  21. return res
  22. end
  23. function Pomelo.DemonTowerHandler.getDemonTowerInfoRequest(floorId,cb,option)
  24. local msg = {}
  25. msg.floorId = floorId
  26. Socket.OnRequestStart("area.demonTowerHandler.getDemonTowerInfoRequest", option)
  27. Socket.Request("area.demonTowerHandler.getDemonTowerInfoRequest", msg, function(res)
  28. if(res.s2c_code == 200) then
  29. Pomelo.DemonTowerHandler.lastGetDemonTowerInfoResponse = res
  30. Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerInfoRequest", true)
  31. cb(nil,res)
  32. else
  33. local ex = {}
  34. if(res.s2c_code) then
  35. ex.Code = res.s2c_code
  36. ex.Message = res.s2c_msg
  37. else
  38. ex.Code = 501
  39. ex.Message = "[LuaXmdsNetClient] area.demonTowerHandler.getDemonTowerInfoRequest decode error!!"
  40. end
  41. Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerInfoRequest", false,ex.Code,ex.Message)
  42. cb(ex,nil)
  43. end
  44. end, getDemonTowerInfoRequestEncoder, getDemonTowerInfoRequestDecoder)
  45. end
  46. local function getDemonTowerSweepInfoRequestEncoder(msg)
  47. local input = demonTowerHandler_pb.GetDemonTowerSweepInfoRequest()
  48. protobuf.FromMessage(input,msg)
  49. return (input:SerializeToString())
  50. end
  51. local function getDemonTowerSweepInfoRequestDecoder(stream)
  52. local res = demonTowerHandler_pb.GetDemonTowerSweepInfoResponse()
  53. res:ParseFromString(stream)
  54. return res
  55. end
  56. function Pomelo.DemonTowerHandler.getDemonTowerSweepInfoRequest(cb,option)
  57. local input = nil
  58. Socket.OnRequestStart("area.demonTowerHandler.getDemonTowerSweepInfoRequest", option)
  59. Socket.Request("area.demonTowerHandler.getDemonTowerSweepInfoRequest", input, function(res)
  60. if(res.s2c_code == 200) then
  61. Pomelo.DemonTowerHandler.lastGetDemonTowerSweepInfoResponse = res
  62. Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerSweepInfoRequest", 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.demonTowerHandler.getDemonTowerSweepInfoRequest decode error!!"
  72. end
  73. Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerSweepInfoRequest", false,ex.Code,ex.Message)
  74. cb(ex,nil)
  75. end
  76. end, getDemonTowerSweepInfoRequestEncoder, getDemonTowerSweepInfoRequestDecoder)
  77. end
  78. local function startToSweepDemonTowerRequestEncoder(msg)
  79. local input = demonTowerHandler_pb.StartToSweepDemonTowerRequest()
  80. protobuf.FromMessage(input,msg)
  81. return (input:SerializeToString())
  82. end
  83. local function startToSweepDemonTowerRequestDecoder(stream)
  84. local res = demonTowerHandler_pb.StartToSweepDemonTowerResponse()
  85. res:ParseFromString(stream)
  86. return res
  87. end
  88. function Pomelo.DemonTowerHandler.startToSweepDemonTowerRequest(cb,option)
  89. local input = nil
  90. Socket.OnRequestStart("area.demonTowerHandler.startToSweepDemonTowerRequest", option)
  91. Socket.Request("area.demonTowerHandler.startToSweepDemonTowerRequest", input, function(res)
  92. if(res.s2c_code == 200) then
  93. Pomelo.DemonTowerHandler.lastStartToSweepDemonTowerResponse = res
  94. Socket.OnRequestEnd("area.demonTowerHandler.startToSweepDemonTowerRequest", 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.demonTowerHandler.startToSweepDemonTowerRequest decode error!!"
  104. end
  105. Socket.OnRequestEnd("area.demonTowerHandler.startToSweepDemonTowerRequest", false,ex.Code,ex.Message)
  106. cb(ex,nil)
  107. end
  108. end, startToSweepDemonTowerRequestEncoder, startToSweepDemonTowerRequestDecoder)
  109. end
  110. local function startDemonTowerRequestEncoder(msg)
  111. local input = demonTowerHandler_pb.StartDemonTowerRequest()
  112. protobuf.FromMessage(input,msg)
  113. return (input:SerializeToString())
  114. end
  115. local function startDemonTowerRequestDecoder(stream)
  116. local res = demonTowerHandler_pb.StartDemonTowerResponse()
  117. res:ParseFromString(stream)
  118. return res
  119. end
  120. function Pomelo.DemonTowerHandler.startDemonTowerRequest(floorId,cb,option)
  121. local msg = {}
  122. msg.floorId = floorId
  123. Socket.OnRequestStart("area.demonTowerHandler.startDemonTowerRequest", option)
  124. Socket.Request("area.demonTowerHandler.startDemonTowerRequest", msg, function(res)
  125. if(res.s2c_code == 200) then
  126. Pomelo.DemonTowerHandler.lastStartDemonTowerResponse = res
  127. Socket.OnRequestEnd("area.demonTowerHandler.startDemonTowerRequest", true)
  128. cb(nil,res)
  129. else
  130. local ex = {}
  131. if(res.s2c_code) then
  132. ex.Code = res.s2c_code
  133. ex.Message = res.s2c_msg
  134. else
  135. ex.Code = 501
  136. ex.Message = "[LuaXmdsNetClient] area.demonTowerHandler.startDemonTowerRequest decode error!!"
  137. end
  138. Socket.OnRequestEnd("area.demonTowerHandler.startDemonTowerRequest", false,ex.Code,ex.Message)
  139. cb(ex,nil)
  140. end
  141. end, startDemonTowerRequestEncoder, startDemonTowerRequestDecoder)
  142. end
  143. local function finishSweepDemonTowerRequestEncoder(msg)
  144. local input = demonTowerHandler_pb.FinishSweepDemonTowerRequest()
  145. protobuf.FromMessage(input,msg)
  146. return (input:SerializeToString())
  147. end
  148. local function finishSweepDemonTowerRequestDecoder(stream)
  149. local res = demonTowerHandler_pb.FinishSweepDemonTowerResponse()
  150. res:ParseFromString(stream)
  151. return res
  152. end
  153. function Pomelo.DemonTowerHandler.finishSweepDemonTowerRequest(cb,option)
  154. local input = nil
  155. Socket.OnRequestStart("area.demonTowerHandler.finishSweepDemonTowerRequest", option)
  156. Socket.Request("area.demonTowerHandler.finishSweepDemonTowerRequest", input, function(res)
  157. if(res.s2c_code == 200) then
  158. Pomelo.DemonTowerHandler.lastFinishSweepDemonTowerResponse = res
  159. Socket.OnRequestEnd("area.demonTowerHandler.finishSweepDemonTowerRequest", true)
  160. cb(nil,res)
  161. else
  162. local ex = {}
  163. if(res.s2c_code) then
  164. ex.Code = res.s2c_code
  165. ex.Message = res.s2c_msg
  166. else
  167. ex.Code = 501
  168. ex.Message = "[LuaXmdsNetClient] area.demonTowerHandler.finishSweepDemonTowerRequest decode error!!"
  169. end
  170. Socket.OnRequestEnd("area.demonTowerHandler.finishSweepDemonTowerRequest", false,ex.Code,ex.Message)
  171. cb(ex,nil)
  172. end
  173. end, finishSweepDemonTowerRequestEncoder, finishSweepDemonTowerRequestDecoder)
  174. end
  175. local function sweepDemonTowerEndPushDecoder(stream)
  176. local res = demonTowerHandler_pb.SweepDemonTowerEndPush()
  177. res:ParseFromString(stream)
  178. return res
  179. end
  180. function Pomelo.DemonTowerHandler.sweepDemonTowerEndPush(cb)
  181. Socket.On("area.demonTowerPush.sweepDemonTowerEndPush", function(res)
  182. Pomelo.DemonTowerHandler.lastSweepDemonTowerEndPush = res
  183. cb(nil,res)
  184. end, sweepDemonTowerEndPushDecoder)
  185. end
  186. --------------------------------Pomelo-------------------------------
  187. return Pomelo