ResourceDungeonHandler.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "resourceDungeonHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------ResourceDungeonHandler-------------------------------
  12. Pomelo.ResourceDungeonHandler = {}
  13. local function queryResourceDugeonInfoRequestEncoder(msg)
  14. local input = resourceDungeonHandler_pb.QueryResourceDugeonInfoRequest()
  15. protobuf.FromMessage(input,msg)
  16. return (input:SerializeToString())
  17. end
  18. local function queryResourceDugeonInfoRequestDecoder(stream)
  19. local res = resourceDungeonHandler_pb.QueryResourceDugeonInfoResponse()
  20. res:ParseFromString(stream)
  21. return res
  22. end
  23. function Pomelo.ResourceDungeonHandler.queryResourceDugeonInfoRequest(cb,option)
  24. local input = nil
  25. Socket.OnRequestStart("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", option)
  26. Socket.Request("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", input, function(res)
  27. if(res.s2c_code == 200) then
  28. Pomelo.ResourceDungeonHandler.lastQueryResourceDugeonInfoResponse = res
  29. Socket.OnRequestEnd("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", 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.resourceDungeonHandler.queryResourceDugeonInfoRequest decode error!!"
  39. end
  40. Socket.OnRequestEnd("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", false,ex.Code,ex.Message)
  41. cb(ex,nil)
  42. end
  43. end, queryResourceDugeonInfoRequestEncoder, queryResourceDugeonInfoRequestDecoder)
  44. end
  45. local function buyTimesRequestEncoder(msg)
  46. local input = resourceDungeonHandler_pb.BuyTimesRequest()
  47. protobuf.FromMessage(input,msg)
  48. return (input:SerializeToString())
  49. end
  50. local function buyTimesRequestDecoder(stream)
  51. local res = resourceDungeonHandler_pb.BuyTimesResponse()
  52. res:ParseFromString(stream)
  53. return res
  54. end
  55. function Pomelo.ResourceDungeonHandler.buyTimesRequest(dungeonId,cb,option)
  56. local msg = {}
  57. msg.dungeonId = dungeonId
  58. Socket.OnRequestStart("area.resourceDungeonHandler.buyTimesRequest", option)
  59. Socket.Request("area.resourceDungeonHandler.buyTimesRequest", msg, function(res)
  60. if(res.s2c_code == 200) then
  61. Pomelo.ResourceDungeonHandler.lastBuyTimesResponse = res
  62. Socket.OnRequestEnd("area.resourceDungeonHandler.buyTimesRequest", 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.resourceDungeonHandler.buyTimesRequest decode error!!"
  72. end
  73. Socket.OnRequestEnd("area.resourceDungeonHandler.buyTimesRequest", false,ex.Code,ex.Message)
  74. cb(ex,nil)
  75. end
  76. end, buyTimesRequestEncoder, buyTimesRequestDecoder)
  77. end
  78. local function enterResourceDugeonInfoRequestEncoder(msg)
  79. local input = resourceDungeonHandler_pb.EnterResourceDugeonInfoRequest()
  80. protobuf.FromMessage(input,msg)
  81. return (input:SerializeToString())
  82. end
  83. local function enterResourceDugeonInfoRequestDecoder(stream)
  84. local res = resourceDungeonHandler_pb.EnterResourceDugeonInfoResponse()
  85. res:ParseFromString(stream)
  86. return res
  87. end
  88. function Pomelo.ResourceDungeonHandler.enterResourceDugeonInfoRequest(dungeonId,cb,option)
  89. local msg = {}
  90. msg.dungeonId = dungeonId
  91. Socket.OnRequestStart("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", option)
  92. Socket.Request("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", msg, function(res)
  93. if(res.s2c_code == 200) then
  94. Pomelo.ResourceDungeonHandler.lastEnterResourceDugeonInfoResponse = res
  95. Socket.OnRequestEnd("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", true)
  96. cb(nil,res)
  97. else
  98. local ex = {}
  99. if(res.s2c_code) then
  100. ex.Code = res.s2c_code
  101. ex.Message = res.s2c_msg
  102. else
  103. ex.Code = 501
  104. ex.Message = "[LuaXmdsNetClient] area.resourceDungeonHandler.enterResourceDugeonInfoRequest decode error!!"
  105. end
  106. Socket.OnRequestEnd("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", false,ex.Code,ex.Message)
  107. cb(ex,nil)
  108. end
  109. end, enterResourceDugeonInfoRequestEncoder, enterResourceDugeonInfoRequestDecoder)
  110. end
  111. local function receiveDoubleRewardRequestEncoder(msg)
  112. local input = resourceDungeonHandler_pb.ReceiveDoubleRewardRequest()
  113. protobuf.FromMessage(input,msg)
  114. return (input:SerializeToString())
  115. end
  116. local function receiveDoubleRewardRequestDecoder(stream)
  117. local res = resourceDungeonHandler_pb.ReceiveDoubleRewardResponse()
  118. res:ParseFromString(stream)
  119. return res
  120. end
  121. function Pomelo.ResourceDungeonHandler.receiveDoubleRewardRequest(dungeonId,cb,option)
  122. local msg = {}
  123. msg.dungeonId = dungeonId
  124. Socket.OnRequestStart("area.resourceDungeonHandler.receiveDoubleRewardRequest", option)
  125. Socket.Request("area.resourceDungeonHandler.receiveDoubleRewardRequest", msg, function(res)
  126. if(res.s2c_code == 200) then
  127. Pomelo.ResourceDungeonHandler.lastReceiveDoubleRewardResponse = res
  128. Socket.OnRequestEnd("area.resourceDungeonHandler.receiveDoubleRewardRequest", true)
  129. cb(nil,res)
  130. else
  131. local ex = {}
  132. if(res.s2c_code) then
  133. ex.Code = res.s2c_code
  134. ex.Message = res.s2c_msg
  135. else
  136. ex.Code = 501
  137. ex.Message = "[LuaXmdsNetClient] area.resourceDungeonHandler.receiveDoubleRewardRequest decode error!!"
  138. end
  139. Socket.OnRequestEnd("area.resourceDungeonHandler.receiveDoubleRewardRequest", false,ex.Code,ex.Message)
  140. cb(ex,nil)
  141. end
  142. end, receiveDoubleRewardRequestEncoder, receiveDoubleRewardRequestDecoder)
  143. end
  144. local function resourceCountDownRequestEncoder(msg)
  145. local input = resourceDungeonHandler_pb.ResourceCountDownRequest()
  146. protobuf.FromMessage(input,msg)
  147. return (input:SerializeToString())
  148. end
  149. local function resourceCountDownRequestDecoder(stream)
  150. local res = resourceDungeonHandler_pb.ResourceCountDownResponse()
  151. res:ParseFromString(stream)
  152. return res
  153. end
  154. function Pomelo.ResourceDungeonHandler.resourceCountDownRequest(dungeonId,cb,option)
  155. local msg = {}
  156. msg.dungeonId = dungeonId
  157. Socket.OnRequestStart("area.resourceDungeonHandler.resourceCountDownRequest", option)
  158. Socket.Request("area.resourceDungeonHandler.resourceCountDownRequest", msg, function(res)
  159. if(res.s2c_code == 200) then
  160. Pomelo.ResourceDungeonHandler.lastResourceCountDownResponse = res
  161. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceCountDownRequest", true)
  162. cb(nil,res)
  163. else
  164. local ex = {}
  165. if(res.s2c_code) then
  166. ex.Code = res.s2c_code
  167. ex.Message = res.s2c_msg
  168. else
  169. ex.Code = 501
  170. ex.Message = "[LuaXmdsNetClient] area.resourceDungeonHandler.resourceCountDownRequest decode error!!"
  171. end
  172. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceCountDownRequest", false,ex.Code,ex.Message)
  173. cb(ex,nil)
  174. end
  175. end, resourceCountDownRequestEncoder, resourceCountDownRequestDecoder)
  176. end
  177. local function resourceSweepRequestEncoder(msg)
  178. local input = resourceDungeonHandler_pb.ResourceSweepRequest()
  179. protobuf.FromMessage(input,msg)
  180. return (input:SerializeToString())
  181. end
  182. local function resourceSweepRequestDecoder(stream)
  183. local res = resourceDungeonHandler_pb.ResourceSweepResponse()
  184. res:ParseFromString(stream)
  185. return res
  186. end
  187. function Pomelo.ResourceDungeonHandler.resourceSweepRequest(dungeonId,cb,option)
  188. local msg = {}
  189. msg.dungeonId = dungeonId
  190. Socket.OnRequestStart("area.resourceDungeonHandler.resourceSweepRequest", option)
  191. Socket.Request("area.resourceDungeonHandler.resourceSweepRequest", msg, function(res)
  192. if(res.s2c_code == 200) then
  193. Pomelo.ResourceDungeonHandler.lastResourceSweepResponse = res
  194. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSweepRequest", true)
  195. cb(nil,res)
  196. else
  197. local ex = {}
  198. if(res.s2c_code) then
  199. ex.Code = res.s2c_code
  200. ex.Message = res.s2c_msg
  201. else
  202. ex.Code = 501
  203. ex.Message = "[LuaXmdsNetClient] area.resourceDungeonHandler.resourceSweepRequest decode error!!"
  204. end
  205. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSweepRequest", false,ex.Code,ex.Message)
  206. cb(ex,nil)
  207. end
  208. end, resourceSweepRequestEncoder, resourceSweepRequestDecoder)
  209. end
  210. local function resourceSitUnsafeRequestEncoder(msg)
  211. local input = resourceDungeonHandler_pb.ResourceSitUnsafeRequest()
  212. protobuf.FromMessage(input,msg)
  213. return (input:SerializeToString())
  214. end
  215. local function resourceSitUnsafeRequestDecoder(stream)
  216. local res = resourceDungeonHandler_pb.ResourceSitUnsafeResponse()
  217. res:ParseFromString(stream)
  218. return res
  219. end
  220. function Pomelo.ResourceDungeonHandler.resourceSitUnsafeRequest(sit_unsafe,cb,option)
  221. local msg = {}
  222. msg.sit_unsafe = sit_unsafe
  223. Socket.OnRequestStart("area.resourceDungeonHandler.resourceSitUnsafeRequest", option)
  224. Socket.Request("area.resourceDungeonHandler.resourceSitUnsafeRequest", msg, function(res)
  225. if(res.s2c_code == 200) then
  226. Pomelo.ResourceDungeonHandler.lastResourceSitUnsafeResponse = res
  227. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeRequest", true)
  228. cb(nil,res)
  229. else
  230. local ex = {}
  231. if(res.s2c_code) then
  232. ex.Code = res.s2c_code
  233. ex.Message = res.s2c_msg
  234. else
  235. ex.Code = 501
  236. ex.Message = "[LuaXmdsNetClient] area.resourceDungeonHandler.resourceSitUnsafeRequest decode error!!"
  237. end
  238. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeRequest", false,ex.Code,ex.Message)
  239. cb(ex,nil)
  240. end
  241. end, resourceSitUnsafeRequestEncoder, resourceSitUnsafeRequestDecoder)
  242. end
  243. local function resourceSitUnsafeObtainQiRequestEncoder(msg)
  244. local input = resourceDungeonHandler_pb.ResourceSitUnsafeObtainQiRequest()
  245. protobuf.FromMessage(input,msg)
  246. return (input:SerializeToString())
  247. end
  248. local function resourceSitUnsafeObtainQiRequestDecoder(stream)
  249. local res = resourceDungeonHandler_pb.ResourceSitUnsafeObtainQiResponse()
  250. res:ParseFromString(stream)
  251. return res
  252. end
  253. function Pomelo.ResourceDungeonHandler.resourceSitUnsafeObtainQiRequest(cb,option)
  254. local input = nil
  255. Socket.OnRequestStart("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", option)
  256. Socket.Request("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", input, function(res)
  257. if(res.s2c_code == 200) then
  258. Pomelo.ResourceDungeonHandler.lastResourceSitUnsafeObtainQiResponse = res
  259. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", true)
  260. cb(nil,res)
  261. else
  262. local ex = {}
  263. if(res.s2c_code) then
  264. ex.Code = res.s2c_code
  265. ex.Message = res.s2c_msg
  266. else
  267. ex.Code = 501
  268. ex.Message = "[LuaXmdsNetClient] area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest decode error!!"
  269. end
  270. Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", false,ex.Code,ex.Message)
  271. cb(ex,nil)
  272. end
  273. end, resourceSitUnsafeObtainQiRequestEncoder, resourceSitUnsafeObtainQiRequestDecoder)
  274. end
  275. local function onResourceInfoPushDecoder(stream)
  276. local res = resourceDungeonHandler_pb.OnResourceInfoPush()
  277. res:ParseFromString(stream)
  278. return res
  279. end
  280. function Pomelo.ResourceDungeonHandler.onResourceInfoPush(cb)
  281. Socket.On("area.resourceDungeonPush.onResourceInfoPush", function(res)
  282. Pomelo.ResourceDungeonHandler.lastOnResourceInfoPush = res
  283. cb(nil,res)
  284. end, onResourceInfoPushDecoder)
  285. end
  286. local function onFishPushDecoder(stream)
  287. local res = resourceDungeonHandler_pb.OnFishPush()
  288. res:ParseFromString(stream)
  289. return res
  290. end
  291. function Pomelo.ResourceDungeonHandler.onFishPush(cb)
  292. Socket.On("area.resourceDungeonPush.onFishPush", function(res)
  293. Pomelo.ResourceDungeonHandler.lastOnFishPush = res
  294. cb(nil,res)
  295. end, onFishPushDecoder)
  296. end
  297. --------------------------------Pomelo-------------------------------
  298. return Pomelo