ConsignmentLineHandler.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "consignmentLineHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------ConsignmentLineHandler-------------------------------
  12. Pomelo.ConsignmentLineHandler = {}
  13. local function addConsignmentRequestEncoder(msg)
  14. local input = consignmentLineHandler_pb.AddConsignmentRequest()
  15. protobuf.FromMessage(input,msg)
  16. return (input:SerializeToString())
  17. end
  18. local function addConsignmentRequestDecoder(stream)
  19. local res = consignmentLineHandler_pb.AddConsignmentResponse()
  20. res:ParseFromString(stream)
  21. return res
  22. end
  23. function Pomelo.ConsignmentLineHandler.addConsignmentRequest(c2s_index,c2s_number,c2s_price,c2s_global,c2s_isAnonymous,c2s_id,cb,option)
  24. local msg = {}
  25. msg.c2s_index = c2s_index
  26. msg.c2s_number = c2s_number
  27. msg.c2s_price = c2s_price
  28. msg.c2s_global = c2s_global
  29. msg.c2s_isAnonymous = c2s_isAnonymous
  30. msg.c2s_id = c2s_id
  31. Socket.OnRequestStart("area.consignmentLineHandler.addConsignmentRequest", option)
  32. Socket.Request("area.consignmentLineHandler.addConsignmentRequest", msg, function(res)
  33. if(res.s2c_code == 200) then
  34. Pomelo.ConsignmentLineHandler.lastAddConsignmentResponse = res
  35. Socket.OnRequestEnd("area.consignmentLineHandler.addConsignmentRequest", true)
  36. cb(nil,res)
  37. else
  38. local ex = {}
  39. if(res.s2c_code) then
  40. ex.Code = res.s2c_code
  41. ex.Message = res.s2c_msg
  42. else
  43. ex.Code = 501
  44. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.addConsignmentRequest decode error!!"
  45. end
  46. Socket.OnRequestEnd("area.consignmentLineHandler.addConsignmentRequest", false,ex.Code,ex.Message)
  47. cb(ex,nil)
  48. end
  49. end, addConsignmentRequestEncoder, addConsignmentRequestDecoder)
  50. end
  51. local function removeConsignmentRequestEncoder(msg)
  52. local input = consignmentLineHandler_pb.RemoveConsignmentRequest()
  53. protobuf.FromMessage(input,msg)
  54. return (input:SerializeToString())
  55. end
  56. local function removeConsignmentRequestDecoder(stream)
  57. local res = consignmentLineHandler_pb.RemoveConsignmentResponse()
  58. res:ParseFromString(stream)
  59. return res
  60. end
  61. function Pomelo.ConsignmentLineHandler.removeConsignmentRequest(c2s_id,c2s_global,cb,option)
  62. local msg = {}
  63. msg.c2s_id = c2s_id
  64. msg.c2s_global = c2s_global
  65. Socket.OnRequestStart("area.consignmentLineHandler.removeConsignmentRequest", option)
  66. Socket.Request("area.consignmentLineHandler.removeConsignmentRequest", msg, function(res)
  67. if(res.s2c_code == 200) then
  68. Pomelo.ConsignmentLineHandler.lastRemoveConsignmentResponse = res
  69. Socket.OnRequestEnd("area.consignmentLineHandler.removeConsignmentRequest", true)
  70. cb(nil,res)
  71. else
  72. local ex = {}
  73. if(res.s2c_code) then
  74. ex.Code = res.s2c_code
  75. ex.Message = res.s2c_msg
  76. else
  77. ex.Code = 501
  78. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.removeConsignmentRequest decode error!!"
  79. end
  80. Socket.OnRequestEnd("area.consignmentLineHandler.removeConsignmentRequest", false,ex.Code,ex.Message)
  81. cb(ex,nil)
  82. end
  83. end, removeConsignmentRequestEncoder, removeConsignmentRequestDecoder)
  84. end
  85. local function buyConsignmentRequestEncoder(msg)
  86. local input = consignmentLineHandler_pb.BuyConsignmentRequest()
  87. protobuf.FromMessage(input,msg)
  88. return (input:SerializeToString())
  89. end
  90. local function buyConsignmentRequestDecoder(stream)
  91. local res = consignmentLineHandler_pb.BuyConsignmentResponse()
  92. res:ParseFromString(stream)
  93. return res
  94. end
  95. function Pomelo.ConsignmentLineHandler.buyConsignmentRequest(c2s_id,c2s_global,c2s_num,cb,option)
  96. local msg = {}
  97. msg.c2s_id = c2s_id
  98. msg.c2s_global = c2s_global
  99. msg.c2s_num = c2s_num
  100. Socket.OnRequestStart("area.consignmentLineHandler.buyConsignmentRequest", option)
  101. Socket.Request("area.consignmentLineHandler.buyConsignmentRequest", msg, function(res)
  102. if(res.s2c_code == 200) then
  103. Pomelo.ConsignmentLineHandler.lastBuyConsignmentResponse = res
  104. Socket.OnRequestEnd("area.consignmentLineHandler.buyConsignmentRequest", true)
  105. cb(nil,res)
  106. else
  107. local ex = {}
  108. if(res.s2c_code) then
  109. ex.Code = res.s2c_code
  110. ex.Message = res.s2c_msg
  111. else
  112. ex.Code = 501
  113. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.buyConsignmentRequest decode error!!"
  114. end
  115. Socket.OnRequestEnd("area.consignmentLineHandler.buyConsignmentRequest", false,ex.Code,ex.Message)
  116. cb(ex,nil)
  117. end
  118. end, buyConsignmentRequestEncoder, buyConsignmentRequestDecoder)
  119. end
  120. local function consignmentListRequestEncoder(msg)
  121. local input = consignmentLineHandler_pb.ConsignmentListRequest()
  122. protobuf.FromMessage(input,msg)
  123. return (input:SerializeToString())
  124. end
  125. local function consignmentListRequestDecoder(stream)
  126. local res = consignmentLineHandler_pb.ConsignmentListResponse()
  127. res:ParseFromString(stream)
  128. return res
  129. end
  130. function Pomelo.ConsignmentLineHandler.consignmentListRequest(c2s_pro,c2s_qcolor,c2s_order,c2s_itemSecondType,c2s_page,c2s_global,c2s_itemType,c2s_level,c2s_condition,cb,option)
  131. local msg = {}
  132. msg.c2s_pro = c2s_pro
  133. msg.c2s_qcolor = c2s_qcolor
  134. msg.c2s_order = c2s_order
  135. msg.c2s_itemSecondType = c2s_itemSecondType
  136. msg.c2s_page = c2s_page
  137. msg.c2s_global = c2s_global
  138. msg.c2s_itemType = c2s_itemType
  139. msg.c2s_level = c2s_level
  140. msg.c2s_condition = c2s_condition
  141. Socket.OnRequestStart("area.consignmentLineHandler.consignmentListRequest", option)
  142. Socket.Request("area.consignmentLineHandler.consignmentListRequest", msg, function(res)
  143. if(res.s2c_code == 200) then
  144. Pomelo.ConsignmentLineHandler.lastConsignmentListResponse = res
  145. Socket.OnRequestEnd("area.consignmentLineHandler.consignmentListRequest", true)
  146. cb(nil,res)
  147. else
  148. local ex = {}
  149. if(res.s2c_code) then
  150. ex.Code = res.s2c_code
  151. ex.Message = res.s2c_msg
  152. else
  153. ex.Code = 501
  154. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.consignmentListRequest decode error!!"
  155. end
  156. Socket.OnRequestEnd("area.consignmentLineHandler.consignmentListRequest", false,ex.Code,ex.Message)
  157. cb(ex,nil)
  158. end
  159. end, consignmentListRequestEncoder, consignmentListRequestDecoder)
  160. end
  161. local function myConsignmentRequestEncoder(msg)
  162. local input = consignmentLineHandler_pb.MyConsignmentRequest()
  163. protobuf.FromMessage(input,msg)
  164. return (input:SerializeToString())
  165. end
  166. local function myConsignmentRequestDecoder(stream)
  167. local res = consignmentLineHandler_pb.MyConsignmentResponse()
  168. res:ParseFromString(stream)
  169. return res
  170. end
  171. function Pomelo.ConsignmentLineHandler.myConsignmentRequest(c2s_global,cb,option)
  172. local msg = {}
  173. msg.c2s_global = c2s_global
  174. Socket.OnRequestStart("area.consignmentLineHandler.myConsignmentRequest", option)
  175. Socket.Request("area.consignmentLineHandler.myConsignmentRequest", msg, function(res)
  176. if(res.s2c_code == 200) then
  177. Pomelo.ConsignmentLineHandler.lastMyConsignmentResponse = res
  178. Socket.OnRequestEnd("area.consignmentLineHandler.myConsignmentRequest", true)
  179. cb(nil,res)
  180. else
  181. local ex = {}
  182. if(res.s2c_code) then
  183. ex.Code = res.s2c_code
  184. ex.Message = res.s2c_msg
  185. else
  186. ex.Code = 501
  187. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.myConsignmentRequest decode error!!"
  188. end
  189. Socket.OnRequestEnd("area.consignmentLineHandler.myConsignmentRequest", false,ex.Code,ex.Message)
  190. cb(ex,nil)
  191. end
  192. end, myConsignmentRequestEncoder, myConsignmentRequestDecoder)
  193. end
  194. local function searchConsignmentRequestEncoder(msg)
  195. local input = consignmentLineHandler_pb.SearchConsignmentRequest()
  196. protobuf.FromMessage(input,msg)
  197. return (input:SerializeToString())
  198. end
  199. local function searchConsignmentRequestDecoder(stream)
  200. local res = consignmentLineHandler_pb.SearchConsignmentResponse()
  201. res:ParseFromString(stream)
  202. return res
  203. end
  204. function Pomelo.ConsignmentLineHandler.searchConsignmentRequest(c2s_condition,c2s_global,cb,option)
  205. local msg = {}
  206. msg.c2s_condition = c2s_condition
  207. msg.c2s_global = c2s_global
  208. Socket.OnRequestStart("area.consignmentLineHandler.searchConsignmentRequest", option)
  209. Socket.Request("area.consignmentLineHandler.searchConsignmentRequest", msg, function(res)
  210. if(res.s2c_code == 200) then
  211. Pomelo.ConsignmentLineHandler.lastSearchConsignmentResponse = res
  212. Socket.OnRequestEnd("area.consignmentLineHandler.searchConsignmentRequest", true)
  213. cb(nil,res)
  214. else
  215. local ex = {}
  216. if(res.s2c_code) then
  217. ex.Code = res.s2c_code
  218. ex.Message = res.s2c_msg
  219. else
  220. ex.Code = 501
  221. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.searchConsignmentRequest decode error!!"
  222. end
  223. Socket.OnRequestEnd("area.consignmentLineHandler.searchConsignmentRequest", false,ex.Code,ex.Message)
  224. cb(ex,nil)
  225. end
  226. end, searchConsignmentRequestEncoder, searchConsignmentRequestDecoder)
  227. end
  228. local function publicItemRequestEncoder(msg)
  229. local input = consignmentLineHandler_pb.PublicItemRequest()
  230. protobuf.FromMessage(input,msg)
  231. return (input:SerializeToString())
  232. end
  233. local function publicItemRequestDecoder(stream)
  234. local res = consignmentLineHandler_pb.PublicItemResponse()
  235. res:ParseFromString(stream)
  236. return res
  237. end
  238. function Pomelo.ConsignmentLineHandler.publicItemRequest(id,cb,option)
  239. local msg = {}
  240. msg.id = id
  241. Socket.OnRequestStart("area.consignmentLineHandler.publicItemRequest", option)
  242. Socket.Request("area.consignmentLineHandler.publicItemRequest", msg, function(res)
  243. if(res.s2c_code == 200) then
  244. Pomelo.ConsignmentLineHandler.lastPublicItemResponse = res
  245. Socket.OnRequestEnd("area.consignmentLineHandler.publicItemRequest", true)
  246. cb(nil,res)
  247. else
  248. local ex = {}
  249. if(res.s2c_code) then
  250. ex.Code = res.s2c_code
  251. ex.Message = res.s2c_msg
  252. else
  253. ex.Code = 501
  254. ex.Message = "[LuaXmdsNetClient] area.consignmentLineHandler.publicItemRequest decode error!!"
  255. end
  256. Socket.OnRequestEnd("area.consignmentLineHandler.publicItemRequest", false,ex.Code,ex.Message)
  257. cb(ex,nil)
  258. end
  259. end, publicItemRequestEncoder, publicItemRequestDecoder)
  260. end
  261. local function consignmentRemovePushDecoder(stream)
  262. local res = consignmentLineHandler_pb.ConsignmentRemovePush()
  263. res:ParseFromString(stream)
  264. return res
  265. end
  266. function Pomelo.ConsignmentLineHandler.consignmentRemovePush(cb)
  267. Socket.On("area.consignmentLinePush.consignmentRemovePush", function(res)
  268. Pomelo.ConsignmentLineHandler.lastConsignmentRemovePush = res
  269. cb(nil,res)
  270. end, consignmentRemovePushDecoder)
  271. end
  272. --------------------------------Pomelo-------------------------------
  273. return Pomelo