AnimaInscriptionHandler.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "animaInscriptionHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------AnimaInscriptionHandler-------------------------------
  12. Pomelo.AnimaInscriptionHandler = {}
  13. local function animaInfoRequestEncoder(msg)
  14. local input = animaInscriptionHandler_pb.AnimaInfoRequest()
  15. protobuf.FromMessage(input,msg)
  16. return (input:SerializeToString())
  17. end
  18. local function animaInfoRequestDecoder(stream)
  19. local res = animaInscriptionHandler_pb.AnimaInfoResponse()
  20. res:ParseFromString(stream)
  21. return res
  22. end
  23. function Pomelo.AnimaInscriptionHandler.animaInfoRequest(cb,option)
  24. local input = nil
  25. Socket.OnRequestStart("area.animaInscriptionHandler.animaInfoRequest", option)
  26. Socket.Request("area.animaInscriptionHandler.animaInfoRequest", input, function(res)
  27. if(res.s2c_code == 200) then
  28. Pomelo.AnimaInscriptionHandler.lastAnimaInfoResponse = res
  29. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInfoRequest", 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.animaInscriptionHandler.animaInfoRequest decode error!!"
  39. end
  40. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInfoRequest", false,ex.Code,ex.Message)
  41. cb(ex,nil)
  42. end
  43. end, animaInfoRequestEncoder, animaInfoRequestDecoder)
  44. end
  45. local function animaUpgradeRequestEncoder(msg)
  46. local input = animaInscriptionHandler_pb.AnimaUpgradeRequest()
  47. protobuf.FromMessage(input,msg)
  48. return (input:SerializeToString())
  49. end
  50. local function animaUpgradeRequestDecoder(stream)
  51. local res = animaInscriptionHandler_pb.AnimaUpgradeResponse()
  52. res:ParseFromString(stream)
  53. return res
  54. end
  55. function Pomelo.AnimaInscriptionHandler.animaUpgradeRequest(cb,option)
  56. local input = nil
  57. Socket.OnRequestStart("area.animaInscriptionHandler.animaUpgradeRequest", option)
  58. Socket.Request("area.animaInscriptionHandler.animaUpgradeRequest", input, function(res)
  59. if(res.s2c_code == 200) then
  60. Pomelo.AnimaInscriptionHandler.lastAnimaUpgradeResponse = res
  61. Socket.OnRequestEnd("area.animaInscriptionHandler.animaUpgradeRequest", true)
  62. cb(nil,res)
  63. else
  64. local ex = {}
  65. if(res.s2c_code) then
  66. ex.Code = res.s2c_code
  67. ex.Message = res.s2c_msg
  68. else
  69. ex.Code = 501
  70. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaUpgradeRequest decode error!!"
  71. end
  72. Socket.OnRequestEnd("area.animaInscriptionHandler.animaUpgradeRequest", false,ex.Code,ex.Message)
  73. cb(ex,nil)
  74. end
  75. end, animaUpgradeRequestEncoder, animaUpgradeRequestDecoder)
  76. end
  77. local function animaLuckyRequestEncoder(msg)
  78. local input = animaInscriptionHandler_pb.AnimaLuckyRequest()
  79. protobuf.FromMessage(input,msg)
  80. return (input:SerializeToString())
  81. end
  82. local function animaLuckyRequestDecoder(stream)
  83. local res = animaInscriptionHandler_pb.AnimaLuckyResponse()
  84. res:ParseFromString(stream)
  85. return res
  86. end
  87. function Pomelo.AnimaInscriptionHandler.animaLuckyRequest(cb,option)
  88. local input = nil
  89. Socket.OnRequestStart("area.animaInscriptionHandler.animaLuckyRequest", option)
  90. Socket.Request("area.animaInscriptionHandler.animaLuckyRequest", input, function(res)
  91. if(res.s2c_code == 200) then
  92. Pomelo.AnimaInscriptionHandler.lastAnimaLuckyResponse = res
  93. Socket.OnRequestEnd("area.animaInscriptionHandler.animaLuckyRequest", true)
  94. cb(nil,res)
  95. else
  96. local ex = {}
  97. if(res.s2c_code) then
  98. ex.Code = res.s2c_code
  99. ex.Message = res.s2c_msg
  100. else
  101. ex.Code = 501
  102. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaLuckyRequest decode error!!"
  103. end
  104. Socket.OnRequestEnd("area.animaInscriptionHandler.animaLuckyRequest", false,ex.Code,ex.Message)
  105. cb(ex,nil)
  106. end
  107. end, animaLuckyRequestEncoder, animaLuckyRequestDecoder)
  108. end
  109. local function animaInscriptionInfoRequestEncoder(msg)
  110. local input = animaInscriptionHandler_pb.AnimaInscriptionInfoRequest()
  111. protobuf.FromMessage(input,msg)
  112. return (input:SerializeToString())
  113. end
  114. local function animaInscriptionInfoRequestDecoder(stream)
  115. local res = animaInscriptionHandler_pb.AnimaInscriptionInfoResponse()
  116. res:ParseFromString(stream)
  117. return res
  118. end
  119. function Pomelo.AnimaInscriptionHandler.animaInscriptionInfoRequest(cb,option)
  120. local input = nil
  121. Socket.OnRequestStart("area.animaInscriptionHandler.animaInscriptionInfoRequest", option)
  122. Socket.Request("area.animaInscriptionHandler.animaInscriptionInfoRequest", input, function(res)
  123. if(res.s2c_code == 200) then
  124. Pomelo.AnimaInscriptionHandler.lastAnimaInscriptionInfoResponse = res
  125. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionInfoRequest", true)
  126. cb(nil,res)
  127. else
  128. local ex = {}
  129. if(res.s2c_code) then
  130. ex.Code = res.s2c_code
  131. ex.Message = res.s2c_msg
  132. else
  133. ex.Code = 501
  134. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaInscriptionInfoRequest decode error!!"
  135. end
  136. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionInfoRequest", false,ex.Code,ex.Message)
  137. cb(ex,nil)
  138. end
  139. end, animaInscriptionInfoRequestEncoder, animaInscriptionInfoRequestDecoder)
  140. end
  141. local function animaInscriptionUpgradeRequestEncoder(msg)
  142. local input = animaInscriptionHandler_pb.AnimaInscriptionUpgradeRequest()
  143. protobuf.FromMessage(input,msg)
  144. return (input:SerializeToString())
  145. end
  146. local function animaInscriptionUpgradeRequestDecoder(stream)
  147. local res = animaInscriptionHandler_pb.AnimaInscriptionUpgradeResponse()
  148. res:ParseFromString(stream)
  149. return res
  150. end
  151. function Pomelo.AnimaInscriptionHandler.animaInscriptionUpgradeRequest(code,destroyedInfo,cb,option)
  152. local msg = {}
  153. msg.code = code
  154. msg.destroyedInfo = destroyedInfo
  155. Socket.OnRequestStart("area.animaInscriptionHandler.animaInscriptionUpgradeRequest", option)
  156. Socket.Request("area.animaInscriptionHandler.animaInscriptionUpgradeRequest", msg, function(res)
  157. if(res.s2c_code == 200) then
  158. Pomelo.AnimaInscriptionHandler.lastAnimaInscriptionUpgradeResponse = res
  159. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionUpgradeRequest", 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.animaInscriptionHandler.animaInscriptionUpgradeRequest decode error!!"
  169. end
  170. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionUpgradeRequest", false,ex.Code,ex.Message)
  171. cb(ex,nil)
  172. end
  173. end, animaInscriptionUpgradeRequestEncoder, animaInscriptionUpgradeRequestDecoder)
  174. end
  175. local function animaInscriptionEquipRequestEncoder(msg)
  176. local input = animaInscriptionHandler_pb.AnimaInscriptionEquipRequest()
  177. protobuf.FromMessage(input,msg)
  178. return (input:SerializeToString())
  179. end
  180. local function animaInscriptionEquipRequestDecoder(stream)
  181. local res = animaInscriptionHandler_pb.AnimaInscriptionEquipResponse()
  182. res:ParseFromString(stream)
  183. return res
  184. end
  185. function Pomelo.AnimaInscriptionHandler.animaInscriptionEquipRequest(equipIndex,girdIndex,cb,option)
  186. local msg = {}
  187. msg.equipIndex = equipIndex
  188. msg.girdIndex = girdIndex
  189. Socket.OnRequestStart("area.animaInscriptionHandler.animaInscriptionEquipRequest", option)
  190. Socket.Request("area.animaInscriptionHandler.animaInscriptionEquipRequest", msg, function(res)
  191. if(res.s2c_code == 200) then
  192. Pomelo.AnimaInscriptionHandler.lastAnimaInscriptionEquipResponse = res
  193. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionEquipRequest", true)
  194. cb(nil,res)
  195. else
  196. local ex = {}
  197. if(res.s2c_code) then
  198. ex.Code = res.s2c_code
  199. ex.Message = res.s2c_msg
  200. else
  201. ex.Code = 501
  202. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaInscriptionEquipRequest decode error!!"
  203. end
  204. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionEquipRequest", false,ex.Code,ex.Message)
  205. cb(ex,nil)
  206. end
  207. end, animaInscriptionEquipRequestEncoder, animaInscriptionEquipRequestDecoder)
  208. end
  209. local function animaInscriptionDownRequestEncoder(msg)
  210. local input = animaInscriptionHandler_pb.AnimaInscriptionDownRequest()
  211. protobuf.FromMessage(input,msg)
  212. return (input:SerializeToString())
  213. end
  214. local function animaInscriptionDownRequestDecoder(stream)
  215. local res = animaInscriptionHandler_pb.AnimaInscriptionDownResponse()
  216. res:ParseFromString(stream)
  217. return res
  218. end
  219. function Pomelo.AnimaInscriptionHandler.animaInscriptionDownRequest(equipIndex,cb,option)
  220. local msg = {}
  221. msg.equipIndex = equipIndex
  222. Socket.OnRequestStart("area.animaInscriptionHandler.animaInscriptionDownRequest", option)
  223. Socket.Request("area.animaInscriptionHandler.animaInscriptionDownRequest", msg, function(res)
  224. if(res.s2c_code == 200) then
  225. Pomelo.AnimaInscriptionHandler.lastAnimaInscriptionDownResponse = res
  226. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionDownRequest", true)
  227. cb(nil,res)
  228. else
  229. local ex = {}
  230. if(res.s2c_code) then
  231. ex.Code = res.s2c_code
  232. ex.Message = res.s2c_msg
  233. else
  234. ex.Code = 501
  235. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaInscriptionDownRequest decode error!!"
  236. end
  237. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionDownRequest", false,ex.Code,ex.Message)
  238. cb(ex,nil)
  239. end
  240. end, animaInscriptionDownRequestEncoder, animaInscriptionDownRequestDecoder)
  241. end
  242. local function animaInscriptionUpgradeOneKeyRequestEncoder(msg)
  243. local input = animaInscriptionHandler_pb.AnimaInscriptionUpgradeOneKeyRequest()
  244. protobuf.FromMessage(input,msg)
  245. return (input:SerializeToString())
  246. end
  247. local function animaInscriptionUpgradeOneKeyRequestDecoder(stream)
  248. local res = animaInscriptionHandler_pb.AnimaInscriptionUpgradeOneKeyResponse()
  249. res:ParseFromString(stream)
  250. return res
  251. end
  252. function Pomelo.AnimaInscriptionHandler.animaInscriptionUpgradeOneKeyRequest(code,cb,option)
  253. local msg = {}
  254. msg.code = code
  255. Socket.OnRequestStart("area.animaInscriptionHandler.animaInscriptionUpgradeOneKeyRequest", option)
  256. Socket.Request("area.animaInscriptionHandler.animaInscriptionUpgradeOneKeyRequest", msg, function(res)
  257. if(res.s2c_code == 200) then
  258. Pomelo.AnimaInscriptionHandler.lastAnimaInscriptionUpgradeOneKeyResponse = res
  259. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionUpgradeOneKeyRequest", 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.animaInscriptionHandler.animaInscriptionUpgradeOneKeyRequest decode error!!"
  269. end
  270. Socket.OnRequestEnd("area.animaInscriptionHandler.animaInscriptionUpgradeOneKeyRequest", false,ex.Code,ex.Message)
  271. cb(ex,nil)
  272. end
  273. end, animaInscriptionUpgradeOneKeyRequestEncoder, animaInscriptionUpgradeOneKeyRequestDecoder)
  274. end
  275. local function animaSevenStarRequestEncoder(msg)
  276. local input = animaInscriptionHandler_pb.AnimaSevenStarRequest()
  277. protobuf.FromMessage(input,msg)
  278. return (input:SerializeToString())
  279. end
  280. local function animaSevenStarRequestDecoder(stream)
  281. local res = animaInscriptionHandler_pb.AnimaSevenStarResponse()
  282. res:ParseFromString(stream)
  283. return res
  284. end
  285. function Pomelo.AnimaInscriptionHandler.animaSevenStarRequest(cb,option)
  286. local input = nil
  287. Socket.OnRequestStart("area.animaInscriptionHandler.animaSevenStarRequest", option)
  288. Socket.Request("area.animaInscriptionHandler.animaSevenStarRequest", input, function(res)
  289. if(res.s2c_code == 200) then
  290. Pomelo.AnimaInscriptionHandler.lastAnimaSevenStarResponse = res
  291. Socket.OnRequestEnd("area.animaInscriptionHandler.animaSevenStarRequest", true)
  292. cb(nil,res)
  293. else
  294. local ex = {}
  295. if(res.s2c_code) then
  296. ex.Code = res.s2c_code
  297. ex.Message = res.s2c_msg
  298. else
  299. ex.Code = 501
  300. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaSevenStarRequest decode error!!"
  301. end
  302. Socket.OnRequestEnd("area.animaInscriptionHandler.animaSevenStarRequest", false,ex.Code,ex.Message)
  303. cb(ex,nil)
  304. end
  305. end, animaSevenStarRequestEncoder, animaSevenStarRequestDecoder)
  306. end
  307. local function animaLingZhuInfoRequestEncoder(msg)
  308. local input = animaInscriptionHandler_pb.AnimaLingZhuInfoRequest()
  309. protobuf.FromMessage(input,msg)
  310. return (input:SerializeToString())
  311. end
  312. local function animaLingZhuInfoRequestDecoder(stream)
  313. local res = animaInscriptionHandler_pb.AnimaLingZhuInfoResponse()
  314. res:ParseFromString(stream)
  315. return res
  316. end
  317. function Pomelo.AnimaInscriptionHandler.animaLingZhuInfoRequest(cb,option)
  318. local input = nil
  319. Socket.OnRequestStart("area.animaInscriptionHandler.animaLingZhuInfoRequest", option)
  320. Socket.Request("area.animaInscriptionHandler.animaLingZhuInfoRequest", input, function(res)
  321. if(res.s2c_code == 200) then
  322. Pomelo.AnimaInscriptionHandler.lastAnimaLingZhuInfoResponse = res
  323. Socket.OnRequestEnd("area.animaInscriptionHandler.animaLingZhuInfoRequest", true)
  324. cb(nil,res)
  325. else
  326. local ex = {}
  327. if(res.s2c_code) then
  328. ex.Code = res.s2c_code
  329. ex.Message = res.s2c_msg
  330. else
  331. ex.Code = 501
  332. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaLingZhuInfoRequest decode error!!"
  333. end
  334. Socket.OnRequestEnd("area.animaInscriptionHandler.animaLingZhuInfoRequest", false,ex.Code,ex.Message)
  335. cb(ex,nil)
  336. end
  337. end, animaLingZhuInfoRequestEncoder, animaLingZhuInfoRequestDecoder)
  338. end
  339. local function animaLingZhuUpgradeRequestEncoder(msg)
  340. local input = animaInscriptionHandler_pb.AnimaLingZhuUpgradeRequest()
  341. protobuf.FromMessage(input,msg)
  342. return (input:SerializeToString())
  343. end
  344. local function animaLingZhuUpgradeRequestDecoder(stream)
  345. local res = animaInscriptionHandler_pb.AnimaLingZhuUpgradeResponse()
  346. res:ParseFromString(stream)
  347. return res
  348. end
  349. function Pomelo.AnimaInscriptionHandler.animaLingZhuUpgradeRequest(zhu_index,cb,option)
  350. local msg = {}
  351. msg.zhu_index = zhu_index
  352. Socket.OnRequestStart("area.animaInscriptionHandler.animaLingZhuUpgradeRequest", option)
  353. Socket.Request("area.animaInscriptionHandler.animaLingZhuUpgradeRequest", msg, function(res)
  354. if(res.s2c_code == 200) then
  355. Pomelo.AnimaInscriptionHandler.lastAnimaLingZhuUpgradeResponse = res
  356. Socket.OnRequestEnd("area.animaInscriptionHandler.animaLingZhuUpgradeRequest", true)
  357. cb(nil,res)
  358. else
  359. local ex = {}
  360. if(res.s2c_code) then
  361. ex.Code = res.s2c_code
  362. ex.Message = res.s2c_msg
  363. else
  364. ex.Code = 501
  365. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaLingZhuUpgradeRequest decode error!!"
  366. end
  367. Socket.OnRequestEnd("area.animaInscriptionHandler.animaLingZhuUpgradeRequest", false,ex.Code,ex.Message)
  368. cb(ex,nil)
  369. end
  370. end, animaLingZhuUpgradeRequestEncoder, animaLingZhuUpgradeRequestDecoder)
  371. end
  372. local function animaGongFaInfoRequestEncoder(msg)
  373. local input = animaInscriptionHandler_pb.AnimaGongFaInfoRequest()
  374. protobuf.FromMessage(input,msg)
  375. return (input:SerializeToString())
  376. end
  377. local function animaGongFaInfoRequestDecoder(stream)
  378. local res = animaInscriptionHandler_pb.AnimaGongFaInfoResponse()
  379. res:ParseFromString(stream)
  380. return res
  381. end
  382. function Pomelo.AnimaInscriptionHandler.animaGongFaInfoRequest(index,cb,option)
  383. local msg = {}
  384. msg.index = index
  385. Socket.OnRequestStart("area.animaInscriptionHandler.animaGongFaInfoRequest", option)
  386. Socket.Request("area.animaInscriptionHandler.animaGongFaInfoRequest", msg, function(res)
  387. if(res.s2c_code == 200) then
  388. Pomelo.AnimaInscriptionHandler.lastAnimaGongFaInfoResponse = res
  389. Socket.OnRequestEnd("area.animaInscriptionHandler.animaGongFaInfoRequest", true)
  390. cb(nil,res)
  391. else
  392. local ex = {}
  393. if(res.s2c_code) then
  394. ex.Code = res.s2c_code
  395. ex.Message = res.s2c_msg
  396. else
  397. ex.Code = 501
  398. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaGongFaInfoRequest decode error!!"
  399. end
  400. Socket.OnRequestEnd("area.animaInscriptionHandler.animaGongFaInfoRequest", false,ex.Code,ex.Message)
  401. cb(ex,nil)
  402. end
  403. end, animaGongFaInfoRequestEncoder, animaGongFaInfoRequestDecoder)
  404. end
  405. local function animaGongFaStudyRequestEncoder(msg)
  406. local input = animaInscriptionHandler_pb.AnimaGongFaStudyRequest()
  407. protobuf.FromMessage(input,msg)
  408. return (input:SerializeToString())
  409. end
  410. local function animaGongFaStudyRequestDecoder(stream)
  411. local res = animaInscriptionHandler_pb.AnimaGongFaStudyResponse()
  412. res:ParseFromString(stream)
  413. return res
  414. end
  415. function Pomelo.AnimaInscriptionHandler.animaGongFaStudyRequest(gong_index,bag_pos,cb,option)
  416. local msg = {}
  417. msg.gong_index = gong_index
  418. msg.bag_pos = bag_pos
  419. Socket.OnRequestStart("area.animaInscriptionHandler.animaGongFaStudyRequest", option)
  420. Socket.Request("area.animaInscriptionHandler.animaGongFaStudyRequest", msg, function(res)
  421. if(res.s2c_code == 200) then
  422. Pomelo.AnimaInscriptionHandler.lastAnimaGongFaStudyResponse = res
  423. Socket.OnRequestEnd("area.animaInscriptionHandler.animaGongFaStudyRequest", true)
  424. cb(nil,res)
  425. else
  426. local ex = {}
  427. if(res.s2c_code) then
  428. ex.Code = res.s2c_code
  429. ex.Message = res.s2c_msg
  430. else
  431. ex.Code = 501
  432. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaGongFaStudyRequest decode error!!"
  433. end
  434. Socket.OnRequestEnd("area.animaInscriptionHandler.animaGongFaStudyRequest", false,ex.Code,ex.Message)
  435. cb(ex,nil)
  436. end
  437. end, animaGongFaStudyRequestEncoder, animaGongFaStudyRequestDecoder)
  438. end
  439. local function animaGongFaUpgradeRequestEncoder(msg)
  440. local input = animaInscriptionHandler_pb.AnimaGongFaUpgradeRequest()
  441. protobuf.FromMessage(input,msg)
  442. return (input:SerializeToString())
  443. end
  444. local function animaGongFaUpgradeRequestDecoder(stream)
  445. local res = animaInscriptionHandler_pb.AnimaGongFaUpgradeResponse()
  446. res:ParseFromString(stream)
  447. return res
  448. end
  449. function Pomelo.AnimaInscriptionHandler.animaGongFaUpgradeRequest(gpid,cb,option)
  450. local msg = {}
  451. msg.gpid = gpid
  452. Socket.OnRequestStart("area.animaInscriptionHandler.animaGongFaUpgradeRequest", option)
  453. Socket.Request("area.animaInscriptionHandler.animaGongFaUpgradeRequest", msg, function(res)
  454. if(res.s2c_code == 200) then
  455. Pomelo.AnimaInscriptionHandler.lastAnimaGongFaUpgradeResponse = res
  456. Socket.OnRequestEnd("area.animaInscriptionHandler.animaGongFaUpgradeRequest", true)
  457. cb(nil,res)
  458. else
  459. local ex = {}
  460. if(res.s2c_code) then
  461. ex.Code = res.s2c_code
  462. ex.Message = res.s2c_msg
  463. else
  464. ex.Code = 501
  465. ex.Message = "[LuaXmdsNetClient] area.animaInscriptionHandler.animaGongFaUpgradeRequest decode error!!"
  466. end
  467. Socket.OnRequestEnd("area.animaInscriptionHandler.animaGongFaUpgradeRequest", false,ex.Code,ex.Message)
  468. cb(ex,nil)
  469. end
  470. end, animaGongFaUpgradeRequestEncoder, animaGongFaUpgradeRequestDecoder)
  471. end
  472. --------------------------------Pomelo-------------------------------
  473. return Pomelo