ActiceServiceresp.js 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. var ProtocolActiveServer = require("ProtocolActiveServer")
  2. var BaseDefine = require("BaseDefine")
  3. var Global = require("Global")
  4. import { RecvPacketHelper } from 'PacketHelper'
  5. cc.Class({
  6. extends: cc.Component,
  7. properties: {
  8. },
  9. statics: {
  10. analyzeDataEx(data) {
  11. var dv = new DataView(data);
  12. return this.analyzeData(dv.getUint16(4, true), dv.getUint16(6, true), new DataView(data.slice(8)));
  13. },
  14. analyzeData(m, s, dataview) {
  15. if(m ==ProtocolActiveServer.MDM_GP_ACTIVITY)
  16. {
  17. switch(s)
  18. {
  19. case ProtocolActiveServer.SUB_GP_INDIANA_GET_CONFIG_BACK:
  20. {
  21. var datalist = ProtocolActiveServer.CMD_GP_ActivityIndianaConfigList.data();
  22. dataview.pos =0;
  23. var count = Global.GetUint32(dataview);
  24. for (var num = 0; num < count; ++num) {
  25. var data = ProtocolActiveServer.DBO_GP_ActivityIndianaConfig.data();
  26. data.dwID = Global.GetUint32(dataview);
  27. data.kBonusName =Global.Read2String(dataview);
  28. data.kBonusURL = Global.Read2String(dataview);
  29. data.dwTotalAmount = Global.GetUint32(dataview);
  30. data.dwUsedAmount = Global.GetUint32(dataview);
  31. data.kStartTime = Global.Read2Time(dataview);
  32. data.kEndTime = Global.Read2Time(dataview);
  33. data.dwLuckyNum = Global.GetUint32(dataview);
  34. data.dwLuckyNumB = Global.GetUint32(dataview);
  35. data.dwRatio = Global.GetUint32(dataview);
  36. data.dwStatus = Global.GetUint32(dataview);
  37. data.kNickName = Global.Read2String(dataview);
  38. data.dwLimitCount = Global.GetUint32(dataview);
  39. data.dwUserID = Global.GetUint32(dataview);
  40. data.dwJoinNum = Global.GetUint32(dataview);
  41. data.lCurrency = Global.Read2ll(dataview);
  42. data.lRewardNum = Global.Read2ll(dataview);
  43. data.strNickName = Global.Read2String(dataview);
  44. data.strHeadHttp = Global.Read2String(dataview);
  45. data.strGoodsDesc = Global.Read2String(dataview);
  46. datalist.DBO_GP_ActivityIndianaConfigListlist.push(data);
  47. }
  48. return datalist;
  49. }
  50. case ProtocolActiveServer.SUB_GP_INDIANA_GET_TICKET_BACK:
  51. {
  52. var datalist = ProtocolActiveServer.CMD_GP_ActivityIndianaTicketList.data();
  53. dataview.pos =0;
  54. var count = Global.GetUint32(dataview);
  55. for (var num = 0; num < count; ++num) {
  56. var data = ProtocolActiveServer.DBO_GP_ActivityIndianaTicket.data();
  57. data.dwNumber = Global.GetUint32(dataview);
  58. data.dwCurrentID = Global.GetUint32(dataview);
  59. datalist.DBO_GP_ActivityIndianaTicketList.push(data);
  60. }
  61. return datalist;
  62. }
  63. case ProtocolActiveServer.SUB_GP_INDIANA_GET_USERS_BACK:
  64. {
  65. var datalist = ProtocolActiveServer.CMD_GP_ActivityIndianaUsersList.data();
  66. dataview.pos =0;
  67. var count = Global.GetUint32(dataview);
  68. for (var num = 0; num < count; ++num) {
  69. var data = ProtocolActiveServer.DBO_GP_ActivityIndianaUsers.data();
  70. data.dwUserID = Global.GetUint32(dataview);
  71. data.kNickName = Global.Read2String(dataview);
  72. data.kMyTime = Global.Read2String(dataview);
  73. datalist.DBO_GP_ActivityIndianaUsersList.push(data);
  74. }
  75. return datalist;
  76. }
  77. case ProtocolActiveServer.SUB_GP_GET_USERMULTISCORE_BACK:
  78. {
  79. var data = ProtocolActiveServer.DBO_GP_UserMultiScore.data();
  80. dataview.pos =0;
  81. data.lRevenue = Global.Read2ll(dataview);
  82. data.lUserScore = Global.Read2ll(dataview);
  83. data.lUserInsure = Global.Read2ll(dataview);
  84. data.lBankScore = Global.Read2ll(dataview);
  85. return data;
  86. }
  87. case ProtocolActiveServer.SUB_GA_SHOP_GET_GOODS_BACK:
  88. {
  89. var datalist = ProtocolActiveServer.CMD_GA_ActivityShopGoodsList.data();
  90. dataview.pos =0;
  91. var count = Global.GetUint32(dataview);
  92. for (var num = 0; num < count; ++num) {
  93. var data = ProtocolActiveServer.DBO_GA_ActivityShopGoods.data();
  94. data.dwID = Global.GetUint32(dataview);
  95. data.kGoodsTitle = Global.Read2String(dataview);
  96. data.kGoodsDesc = Global.Read2String(dataview);
  97. data.kGoodsURL = Global.Read2String(dataview);
  98. data.dwRatio = Global.GetUint32(dataview);
  99. data.kStartDate = Global.Read2Time(dataview);
  100. data.kEndDate = Global.Read2Time(dataview);
  101. data.dwTotalAmount = Global.GetUint32(dataview);
  102. data.dwUsedAmount = Global.GetUint32(dataview);
  103. data.dwDayLimit = Global.GetUint32(dataview);
  104. data.dwShowStatus = Global.GetUint32(dataview);
  105. data.dwDayUsedAmount = Global.GetUint32(dataview);
  106. data.cbType = Global.GetUint8(dataview);
  107. data.cbPropType = Global.GetUint8(dataview);
  108. data.kBonusString = Global.Read2String(dataview);
  109. data.Money = Global.GetFloat64(dataview);
  110. data.GoodsShopIndex = Global.GetUint32(dataview);
  111. datalist.DBO_GA_ActivityShopGoodsList.push(data);
  112. }
  113. return datalist;
  114. }
  115. case ProtocolActiveServer.SUB_GA_SHOP_GET_RECORD_BACK:
  116. {
  117. var datalist = ProtocolActiveServer.CMD_GA_ActivityShopRecordList.data();
  118. dataview.pos =0;
  119. var count = Global.GetUint32(dataview);
  120. for (var num = 0; num < count; ++num) {
  121. var data = ProtocolActiveServer.DBO_GA_ActivityShopRecord.data();
  122. data.dwUserID = Global.GetUint32(dataview);
  123. data.dwGoodsID = Global.GetUint32(dataview);
  124. data.kCreateDate = Global.Read2Time(dataview);
  125. data.dwDeleteStatus = Global.GetUint32(dataview);
  126. data.kGoodsTitle = Global.Read2String(dataview);
  127. data.kCause = Global.Read2String(dataview);
  128. data.nRecordID = Global.GetUint32(dataview);
  129. data.knickName = Global.Read2String(dataview);
  130. data.kMobilePhone = Global.Read2String(dataview);
  131. data.kUserNote = Global.Read2String(dataview);
  132. data.cbPropType = Global.GetUint8(dataview);
  133. datalist.DBO_GA_ActivityShopRecordList.push(data);
  134. }
  135. return datalist;
  136. }
  137. case ProtocolActiveServer.SUB_GA_TURNTABLE_GET_INFO_BACK:
  138. {
  139. var datalist = ProtocolActiveServer.CMD_GA_ActivityTurntableInfo.data();
  140. dataview.pos =0;
  141. datalist.dwTurntableTimes = Global.GetUint32(dataview);
  142. var count = Global.GetUint32(dataview);
  143. for (var num = 0; num < count; ++num) {
  144. var data = ProtocolActiveServer.DBO_GA_ActivityTurntableBonus.data();
  145. data.dwPos = Global.GetUint32(dataview);
  146. data.kBonusURL = Global.Read2String(dataview);
  147. data.kBonusString = Global.Read2String(dataview);
  148. data.kBonusTitle = Global.Read2String(dataview);
  149. datalist.DBO_GA_ActivityTurntableBonusLIst.push(data);
  150. }
  151. return datalist;
  152. }
  153. case ProtocolActiveServer.SUB_GA_TURNTABLE_ADD_TIMES_BACK:
  154. {
  155. var data = ProtocolActiveServer.DBO_GA_ActivityTurntableAddTimes.data();
  156. dataview.pos =0;
  157. data.dwTurntableTimes = Global.GetUint32(dataview);
  158. return data;
  159. }
  160. case ProtocolActiveServer.SUB_GA_TURNTABLE_USE_BACK:
  161. {
  162. var data = ProtocolActiveServer.DBO_GA_ActivityTurntableUse.data();
  163. dataview.pos =0;
  164. data.dwPos = Global.GetUint32(dataview);
  165. return data;
  166. }
  167. case ProtocolActiveServer.SUB_GA_GET_RANK_INFO_BACK:
  168. {
  169. var data = ProtocolActiveServer.DBO_GA_BackBankInfo.data();
  170. dataview.pos =0;
  171. var data = {};
  172. data.kList = [];
  173. var cnt = Global.GetUint32(dataview);
  174. for (let index = 0; index < cnt; index++) {
  175. var stUserRankInfo = {};
  176. stUserRankInfo.dwUserID = Global.GetUint32(dataview);
  177. stUserRankInfo.dwGameID = Global.GetUint32(dataview);
  178. stUserRankInfo.dwRank = Global.GetUint32(dataview);
  179. stUserRankInfo.llUserScore = Global.unify(Global.Read2ll(dataview));
  180. stUserRankInfo.dwExp = Global.GetUint32(dataview);
  181. stUserRankInfo.dwVipExp = Global.GetUint32(dataview);
  182. stUserRankInfo.strNickName = Global.Read2String(dataview);
  183. stUserRankInfo.strHeadHttp = Global.Read2String(dataview);
  184. stUserRankInfo.strAutograph = Global.Read2String(dataview);
  185. stUserRankInfo.cbMemberOrder = Global.GetUint8(dataview);
  186. stUserRankInfo.tMemberOverDate = Global.Read2Time(dataview);
  187. data.kList.push(stUserRankInfo);
  188. }
  189. // data.kUserID = Global.GetVectorInt32(dataview);
  190. // data.kRank = Global.GetVectorInt32(dataview);
  191. // data.kNickName = Global.GetVectorString(dataview);
  192. // data.kUserPoint = Global.GetVectorLL(dataview);
  193. // data.kHeadHttp = Global.GetVectorString(dataview);
  194. // data.kAutograph = Global.GetVectorString(dataview);
  195. return data;
  196. }
  197. case ProtocolActiveServer.SUB_GA_GET_DAY_GIFTS:
  198. {
  199. var data = ProtocolActiveServer.DBO_GA_GetDayGiftsStateBack.data();
  200. dataview.pos =0;
  201. data.bGetSate = Global.GetInt8(dataview);
  202. return data;
  203. }
  204. case ProtocolActiveServer.SUB_GP_GET_FREECA_INFO_BACK:
  205. {
  206. var data = ProtocolActiveServer.DBO_GA_BackSalePayInfo.data();
  207. dataview.pos =0;
  208. data.dwDayLeft = Global.GetUint32(dataview);
  209. return data;
  210. }
  211. case ProtocolActiveServer.SUB_GP_GET_GIFTS_INFO_BACK:
  212. {
  213. var data = ProtocolActiveServer.DBO_GA_BackFirstPayInfo.data();
  214. dataview.pos =0;
  215. data.bGetSate = Global.GetInt8(dataview);
  216. return data;
  217. }
  218. case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_MSG_BACK:
  219. {
  220. var data = ProtocolActiveServer.CMD_GA_GET_ActivityMsg.data();
  221. dataview.pos =0;
  222. var data = {};
  223. data.ActivityMsgList = [];
  224. var cnt = Global.GetUint32(dataview);
  225. for (let index = 0; index < cnt; index++) {
  226. var strMsg = Global.Read2String(dataview);
  227. data.ActivityMsgList.push(strMsg);
  228. }
  229. return data;
  230. }
  231. case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_SHOP_MSG_BACK:
  232. {
  233. var data = ProtocolActiveServer.CMD_GA_GET_ActivityShopMsg.data();
  234. dataview.pos =0;
  235. var data = {};
  236. data.ShopMsgList = [];
  237. var cnt = Global.GetUint32(dataview);
  238. for (let index = 0; index < cnt; index++) {
  239. var strMsg = Global.Read2String(dataview);
  240. data.ShopMsgList.push(strMsg);
  241. }
  242. return data;
  243. }
  244. case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_REEARD_BACK:
  245. {
  246. var data = ProtocolActiveServer.CMD_GP_GetActivityRewardBack.data();
  247. dataview.pos =0;
  248. var data = {};
  249. data.strHttpUrl = Global.Read2String(dataview);
  250. data.nID = Global.GetUint32(dataview);
  251. data.strTitle = Global.Read2String(dataview);
  252. data.nCount = Global.GetUint32(dataview);
  253. data.nAllCount = Global.GetUint32(dataview);
  254. data.strNumber = Global.Read2String(dataview);
  255. return data;
  256. }
  257. case ProtocolActiveServer.SUB_GP_RECEIVE_ACTIVITY_REWARD_BACK:
  258. {
  259. var data = ProtocolActiveServer.CMD_GP_ReceiveActivityRewardBack.data();
  260. dataview.pos =0;
  261. data = {};
  262. data.bSuccess = Global.GetInt8(dataview);
  263. data.kErrMsg = Global.Read2String(dataview);
  264. data.tRewardTime = Global.Read2Time(dataview);
  265. data.kGoodsTitle = Global.Read2String(dataview);
  266. data.kCause = Global.Read2String(dataview);
  267. data.nRecordID = Global.GetUint32(dataview);
  268. data.knickName = Global.Read2String(dataview);
  269. data.kMobilePhone = Global.Read2String(dataview);
  270. data.kUserNote = Global.Read2String(dataview);
  271. data.cbPropType = Global.GetUint8(dataview);
  272. data.lScore = Global.Read2ll(dataview);
  273. return data;
  274. }
  275. case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_REEARD_LOG_BACK:
  276. {
  277. var datalist = ProtocolActiveServer.CMD_GP_GetActivityRewardLogBack.data();
  278. dataview.pos =0;
  279. var count = Global.GetUint32(dataview);
  280. for (var num = 0; num < count; ++num) {
  281. var data = {};
  282. data.bSuccess = Global.GetInt8(dataview);
  283. data.kErrMsg = Global.Read2String(dataview);
  284. // data.nID = Global.GetUint32(dataview);
  285. data.tRewardTime = Global.Read2Time(dataview);
  286. // data.strName = Global.Read2String(dataview);
  287. data.kGoodsTitle = Global.Read2String(dataview);
  288. data.kCause = Global.Read2String(dataview);
  289. data.nRecordID = Global.GetUint32(dataview);
  290. data.knickName = Global.Read2String(dataview);
  291. data.kMobilePhone = Global.Read2String(dataview);
  292. data.kUserNote = Global.Read2String(dataview);
  293. data.cbPropType = Global.GetUint8(dataview);
  294. data.lScore = Global.Read2ll(dataview);
  295. datalist.ActivityRewardLogList.push(data);
  296. }
  297. return datalist;
  298. }
  299. case ProtocolActiveServer.SUB_GA_GET_INVITE_BASE_INFO:
  300. {
  301. var data = ProtocolActiveServer.CMD_GP_GetInviteBack.data();
  302. dataview.pos =0;
  303. // invite_config:[], //InviteConfigItem 配置
  304. // invite_users:[], //InviteUserItem 配置
  305. // invite_count:0, //int 当前邀请成功数目
  306. var cnt1 = Global.GetUint32(dataview);
  307. for (let index = 0; index < cnt1; index++) {
  308. // invite_num:0, //int
  309. // prop_id:0, //int 0 待邀请 1 邀请中
  310. // state:0, //int -1 未达成 0 达成未领取 已领取
  311. // s_bonus:"", //string
  312. var InviteConfigItem = ProtocolActiveServer.InviteConfigItem.data();
  313. InviteConfigItem.invite_num = Global.GetInt32(dataview);
  314. InviteConfigItem.prop_id = Global.GetInt32(dataview);
  315. InviteConfigItem.state = Global.GetInt32(dataview);
  316. InviteConfigItem.s_bonus = Global.Read2String(dataview);
  317. data.invite_config.push(InviteConfigItem);
  318. }
  319. var cnt2 = Global.GetUint32(dataview);
  320. for (let index = 0; index < cnt2; index++) {
  321. // user_id:0, //int
  322. // state:0, //int 0 待邀请 1 邀请中
  323. var InviteUserItem = ProtocolActiveServer.InviteUserItem.data();
  324. InviteUserItem.user_id = Global.GetInt32(dataview);
  325. InviteUserItem.state = Global.GetInt32(dataview);
  326. InviteUserItem.headHttp = Global.Read2String(dataview);
  327. data.invite_users.push(InviteUserItem);
  328. }
  329. data.invite_count = Global.GetInt32(dataview);
  330. return data;
  331. }
  332. case ProtocolActiveServer.SUB_GA_SEND_INVITE:
  333. {
  334. var data = ProtocolActiveServer.CMD_GP_InviteSendBack.data();
  335. dataview.pos =0;
  336. // ret:0, //int 0 OK 1 分享在有效期内 2 已经邀请成功
  337. // gold:0, //int 首次分享该玩家 有奖励 金币
  338. data.ret = Global.GetInt32(dataview);
  339. data.gold = Global.GetInt32(dataview);
  340. return data;
  341. }
  342. case ProtocolActiveServer.SUB_GA_GET_INVITE_LIST:
  343. {
  344. var data = ProtocolActiveServer.CMD_GP_InviteUserListBack.data();
  345. dataview.pos =0;
  346. // invite_users:[], //InviteUserItem 用户ID
  347. var cnt = Global.GetUint32(dataview);
  348. for (let index = 0; index < cnt; index++) {
  349. // user_id:0, //int
  350. // state:0, //int 0 待邀请 1 邀请中
  351. var InviteUserItem = ProtocolActiveServer.InviteUserItem.data();
  352. InviteUserItem.user_id = Global.GetInt32(dataview);
  353. InviteUserItem.state = Global.GetInt32(dataview);
  354. InviteUserItem.headHttp = Global.Read2String(dataview);
  355. data.invite_users.push(InviteUserItem);
  356. }
  357. return data;
  358. }
  359. case ProtocolActiveServer.SUB_GA_GET_INVITE_REWARD:
  360. {
  361. var data = ProtocolActiveServer.CMD_GP_InviteRewardBack.data();
  362. dataview.pos =0;
  363. // invite_users:[], //InviteUserItem 用户ID
  364. data.ret = Global.GetInt32(dataview);
  365. var cnt = Global.GetUint32(dataview);
  366. for (let index = 0; index < cnt; index++) {
  367. var InviteConfigItem = ProtocolActiveServer.InviteConfigItem.data();
  368. InviteConfigItem.invite_num = Global.GetInt32(dataview);
  369. InviteConfigItem.prop_id = Global.GetInt32(dataview);
  370. InviteConfigItem.state = Global.GetInt32(dataview);
  371. InviteConfigItem.s_bonus = Global.Read2String(dataview);
  372. data.invite_config.push(InviteConfigItem);
  373. }
  374. return data;
  375. }
  376. case ProtocolActiveServer.SUB_GA_GET_RETURN_STATE:
  377. {
  378. var data = ProtocolActiveServer.CMD_GP_GetReturnStateBack.data();
  379. dataview.pos =0;
  380. data.state = Global.GetInt32(dataview);
  381. return data;
  382. }
  383. case ProtocolActiveServer.SUB_GA_GET_RETURN_BASE_INFO:
  384. {
  385. var data = ProtocolActiveServer.CMD_GP_GetReturnBack.data();
  386. dataview.pos =0;
  387. // return_login_config:[], //ReturnLoginConfigItem
  388. // first_reward_state:0, //int 0 未领取 1领取了
  389. // left_time:0, //int 活动剩余秒
  390. // gift1:0, //int 特惠礼包1 0未购买 1购买
  391. // gift2:0, //int 特惠礼包2 同上
  392. // gift3:0, //int 特惠礼包3 同上
  393. var cnt = Global.GetUint32(dataview);
  394. for (let index = 0; index < cnt; index++) {
  395. // login_num:0, //int
  396. // prop_id:0, //int
  397. // state:0, //-1 未达成 0 达成未领取 已领取
  398. // s_bonus:"", //string
  399. var backLoginConfigtItem = ProtocolActiveServer.ReturnLoginConfigItem.data();
  400. backLoginConfigtItem.login_num = Global.GetInt32(dataview);
  401. backLoginConfigtItem.prop_id = Global.GetInt32(dataview);
  402. backLoginConfigtItem.state = Global.GetInt32(dataview);
  403. backLoginConfigtItem.s_bonus = Global.Read2String(dataview);
  404. data.return_login_config.push(backLoginConfigtItem);
  405. }
  406. data.first_reward_state = Global.GetInt32(dataview);
  407. data.left_time = Global.GetInt32(dataview);
  408. data.gift1 = Global.GetInt32(dataview);
  409. data.gift2 = Global.GetInt32(dataview);
  410. data.gift3 = Global.GetInt32(dataview);
  411. return data;
  412. }
  413. case ProtocolActiveServer.SUB_GA_GET_RETURN_REWARD:
  414. {
  415. var data = ProtocolActiveServer.CMD_GP_GetReturnRewardBack.data();
  416. dataview.pos = 0;
  417. data.ret = Global.GetInt32(dataview);
  418. return data;
  419. }
  420. case ProtocolActiveServer.SUB_GA_GET_RETURN_LOGIN_REWARD:
  421. {
  422. var data = ProtocolActiveServer.CMD_GP_GetReturnLoginRewardBack.data();
  423. dataview.pos =0;
  424. // ret:0, //int 0领取成功 1失败
  425. // return_login_config:[], //ReturnLoginConfigItem 配置
  426. data.ret = Global.GetInt32(dataview);
  427. var cnt = Global.GetUint32(dataview);
  428. for (let index = 0; index < cnt; index++) {
  429. // login_num:0, //int
  430. // prop_id:0, //int
  431. // state:0, //-1 未达成 0 达成未领取 已领取
  432. // s_bonus:"", //string
  433. var backLoginConfigtItem = ProtocolActiveServer.ReturnLoginConfigItem.data();
  434. backLoginConfigtItem.login_num = Global.GetInt32(dataview);
  435. backLoginConfigtItem.prop_id = Global.GetInt32(dataview);
  436. backLoginConfigtItem.state = Global.GetInt32(dataview);
  437. backLoginConfigtItem.s_bonus = Global.Read2String(dataview);
  438. data.return_login_config.push(backLoginConfigtItem);
  439. }
  440. return data;
  441. }
  442. case ProtocolActiveServer.SUB_GA_GET_RETURN_GIFT_STATE:
  443. {
  444. var data = ProtocolActiveServer.CMD_GP_GetReturnGiftStateBack.data();
  445. dataview.pos =0;
  446. data.gift1 = Global.GetInt32(dataview);
  447. data.gift2 = Global.GetInt32(dataview);
  448. data.gift3 = Global.GetInt32(dataview);
  449. return data;
  450. }
  451. case ProtocolActiveServer.SUB_GA_GET_LUCKYDRAW_INFO:
  452. {
  453. var data = ProtocolActiveServer.CMD_GP_GetPropListInfoBack.data();
  454. dataview.pos =0;
  455. //kList:[], //propList
  456. var cnt = Global.GetUint32(dataview);
  457. for (let index = 0; index < cnt; index++) {
  458. //wType:0, //WORD 类型 0:无效 1:普通 2:进阶 3:精英 4:富豪 5:贵族 6:王者
  459. //nFreeType:0, //WORD 费用类型 0:免费 1:金豆 2:鲜花饼, 3:礼券
  460. //nFree:0, //WORD 费用
  461. //kList:[], //prop
  462. var propList = ProtocolActiveServer.CMD_GP_GetPropListBack.data();
  463. propList.wType = Global.GetUint16(dataview);
  464. //propList.nFreeType = Global.GetUint16(dataview);
  465. //propList.nFree = Global.GetInt32(dataview);
  466. propList.strFree = Global.Read2String(dataview);
  467. propList.strMinFree = Global.Read2String(dataview);
  468. var porpCnt = Global.GetUint32(dataview);
  469. for (let i = 0; i < porpCnt; i++) {
  470. //wKey:0, //WORD 物品标示
  471. //dwPropID:0, //DWORD
  472. //dwPropNum:0, //DWORD
  473. //strName:"", //string 物品名称
  474. //dwIconID:0, //DWORD 图片id
  475. //wRate:0, //WORD 概率
  476. var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
  477. prop.wKey = Global.GetUint16(dataview);
  478. prop.dwPropID = Global.GetInt32(dataview);
  479. prop.dwPropNum = Global.GetInt32(dataview);
  480. prop.strName = Global.Read2String(dataview);
  481. prop.dwIconID = Global.GetInt32(dataview);
  482. prop.wRate = Global.GetUint16(dataview);
  483. prop.strBonus = Global.Read2String(dataview);
  484. propList.kList.push(prop);
  485. }
  486. data.kList.push(propList);
  487. }
  488. return data;
  489. }
  490. case ProtocolActiveServer.SUB_GA_GET_LUCKYDRAW_PLAY_BACK:
  491. {
  492. var data = ProtocolActiveServer.CMD_GP_GetDrawPropBack.data();
  493. dataview.pos =0;
  494. //retCode:0, //int 0 OK 1 分享在有效期内 2 已经邀请成功
  495. //kList:[], //LuckyDraw
  496. data.retCode = Global.GetInt32(dataview);
  497. var cnt = Global.GetUint32(dataview);
  498. for (let index = 0; index < cnt; index++) {
  499. //wKey:0, //WORD 物品标示
  500. //dwPropID:0, //DWORD
  501. //dwPropNum:0, //DWORD
  502. //strName:"", //string 物品名称
  503. //dwIconID:0, //DWORD 图片id
  504. //wRate:0, //WORD 概率
  505. var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
  506. prop.wKey = Global.GetUint16(dataview);
  507. prop.dwPropID = Global.GetInt32(dataview);
  508. prop.dwPropNum = Global.GetInt32(dataview);
  509. prop.strName = Global.Read2String(dataview);
  510. prop.dwIconID = Global.GetInt32(dataview);
  511. prop.wRate = Global.GetUint16(dataview);
  512. prop.strBonus = Global.Read2String(dataview);
  513. data.kList.push(prop);
  514. }
  515. return data;
  516. }
  517. case ProtocolActiveServer.SUB_GA_GET_LUCKYDRAW_CALL:
  518. {
  519. var data = ProtocolActiveServer.CMD_GP_GetNoticeBack.data();
  520. dataview.pos =0;
  521. //kList:[], //LuckyDrawCall
  522. var cnt = Global.GetUint32(dataview);
  523. for (let index = 0; index < cnt; index++) {
  524. //wKey:0, //WORD 物品标示
  525. //dwPropID:0, //DWORD
  526. //strName:"", //string 用户名称
  527. //nFree:0, //DWORD
  528. //nFreeType:0, //DWORD 物品名称
  529. //strReward:0, //string 奖品ID:NUM
  530. //wTime:0, //SYSTEMTIME
  531. var prop = ProtocolActiveServer.CMD_GP_GetPropNoticeBack.data();
  532. prop.wKey = Global.GetUint16(dataview);
  533. prop.dwPropID = Global.GetInt32(dataview);
  534. prop.strName = Global.Read2String(dataview);
  535. //prop.nFree = Global.GetInt32(dataview);
  536. //prop.nFreeType = Global.GetInt32(dataview);
  537. prop.strFree = Global.Read2String(dataview);
  538. prop.strReward = Global.Read2String(dataview);
  539. prop.strRewardDes = Global.Read2String(dataview);
  540. prop.wTime = Global.Read2Time(dataview);
  541. data.kList.push(prop);
  542. }
  543. return data;
  544. }
  545. case ProtocolActiveServer.SUB_GA_GET_GUIDE_CONFIG_BACK: {
  546. var data = {};
  547. data.vList = [];
  548. dataview.pos =0;
  549. var cnt = Global.GetInt32(dataview);
  550. for (let index = 0; index < cnt; index++) {
  551. var info = ProtocolActiveServer.CMD_GA_GuideConfig.data();
  552. info.nID = Global.GetInt32(dataview);
  553. info.strGuideDesc = Global.gbk2Utf8(Global.Read2String(dataview));
  554. info.cbGuideType = Global.GetUint8(dataview);
  555. info.nLossCount = Global.GetInt32(dataview);
  556. info.nProbability = Global.GetInt32(dataview);
  557. info.strGuideGame = Global.gbk2Utf8(Global.Read2String(dataview));
  558. info.cbState = Global.GetUint8(dataview);
  559. data.vList.push(info);
  560. }
  561. return data;
  562. }
  563. case ProtocolActiveServer.SUB_GA_UPDATE_GUIDE_CONFIG_BACK: {
  564. var data = ProtocolActiveServer.CMD_GA_UpdateGuideConfigBack.data();
  565. dataview.pos =0;
  566. data.dwUserID = Global.GetUint32(dataview);
  567. data.nID = Global.GetInt32(dataview);
  568. data.bSuccess = Global.GetUint8(dataview) == 1;
  569. data.cbState = Global.GetUint8(dataview);
  570. return data;
  571. }
  572. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE_INFO:{
  573. var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Fire_Info.data();
  574. dataview.pos =0;
  575. var cnt = Global.GetUint32(dataview);
  576. for (let index = 0; index < cnt; index++) {
  577. var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
  578. prop.wKey = Global.GetUint16(dataview);
  579. prop.dwPropID = Global.GetInt32(dataview);
  580. prop.dwPropNum = Global.GetInt32(dataview);
  581. prop.strName = Global.Read2String(dataview);
  582. prop.dwIconID = Global.GetInt32(dataview);
  583. prop.wRate = Global.GetUint16(dataview);
  584. prop.strBonus = Global.Read2String(dataview);
  585. data.kList.push(prop);
  586. }
  587. return data;
  588. }
  589. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE:{
  590. var data = ProtocolActiveServer.CMD_GP_NewYearFireBack.data();
  591. dataview.pos =0;
  592. data.retCode = Global.GetInt32(dataview);
  593. var cnt = Global.GetUint32(dataview);
  594. for (let index = 0; index < cnt; index++) {
  595. var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
  596. prop.wKey = Global.GetUint16(dataview);
  597. prop.dwPropID = Global.GetInt32(dataview);
  598. prop.dwPropNum = Global.GetInt32(dataview);
  599. prop.strName = Global.Read2String(dataview);
  600. prop.dwIconID = Global.GetInt32(dataview);
  601. prop.wRate = Global.GetUint16(dataview);
  602. prop.strBonus = Global.Read2String(dataview);
  603. data.kList.push(prop);
  604. }
  605. return data;
  606. }
  607. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE_CALL:{
  608. var data = ProtocolActiveServer.CMD_GP_NewYear_Call.data();
  609. dataview.pos =0;
  610. data.dwUserID = Global.GetUint32(dataview);
  611. var cnt = Global.GetUint32(dataview);
  612. for (let index = 0; index < cnt; index++) {
  613. var prop = ProtocolActiveServer.CMD_GP_GetPropNoticeBack.data();
  614. prop.wKey = Global.GetUint16(dataview);
  615. prop.dwPropID = Global.GetInt32(dataview);
  616. prop.strName = Global.Read2String(dataview);
  617. prop.strFree = Global.Read2String(dataview);
  618. prop.strReward = Global.Read2String(dataview);
  619. prop.strRewardDes = Global.Read2String(dataview);
  620. prop.wTime = Global.Read2Time(dataview);
  621. data.kList.push(prop);
  622. }
  623. return data;
  624. }
  625. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE_USER:{
  626. var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Fire_User.data();
  627. dataview.pos = 0;
  628. data.dwUserID = Global.GetInt32(dataview);
  629. data.nFireCnt = Global.GetInt32(dataview);
  630. data.nUseFireCnt = Global.GetInt32(dataview);
  631. data.nMaxUseCnt = Global.GetInt32(dataview);
  632. data.nUserFireCnt = Global.GetInt32(dataview);
  633. data.nLoginDay = Global.GetInt32(dataview);
  634. data.nAddByGameTime = Global.GetInt32(dataview);
  635. data.nInviteNewUser = Global.GetInt32(dataview);
  636. data.nInviteOldUser = Global.GetInt32(dataview);
  637. return data;
  638. }
  639. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_LOGIN_INFO:{
  640. var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Login_Info.data();
  641. dataview.pos =0;
  642. var cnt = Global.GetUint32(dataview);
  643. for (let index = 0; index < cnt; index++) {
  644. var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
  645. prop.wKey = Global.GetUint16(dataview);
  646. prop.dwPropID = Global.GetInt32(dataview);
  647. prop.dwPropNum = Global.GetInt32(dataview);
  648. prop.strName = Global.Read2String(dataview);
  649. prop.dwIconID = Global.GetInt32(dataview);
  650. prop.wState = Global.GetUint16(dataview);
  651. prop.strBonus = Global.Read2String(dataview);
  652. data.kList.push(prop);
  653. }
  654. data.kEndTime = Global.Read2Time(dataview);
  655. return data;
  656. }
  657. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_BAG:{
  658. var data = ProtocolActiveServer.CMD_GP_NewYear_LoginBagBack.data();
  659. dataview.pos =0;
  660. data.retCode = Global.GetInt32(dataview);
  661. var cnt = Global.GetUint32(dataview);
  662. for (let index = 0; index < cnt; index++) {
  663. var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
  664. prop.wKey = Global.GetUint16(dataview);
  665. prop.dwPropID = Global.GetInt32(dataview);
  666. prop.dwPropNum = Global.GetInt32(dataview);
  667. prop.strName = Global.Read2String(dataview);
  668. prop.dwIconID = Global.GetInt32(dataview);
  669. prop.wState = Global.GetUint16(dataview);
  670. prop.strBonus = Global.Read2String(dataview);
  671. data.kList.push(prop);
  672. }
  673. return data;
  674. }
  675. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_BAG_INFO:{
  676. var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Bag_Info.data();
  677. dataview.pos =0;
  678. var cnt = Global.GetUint32(dataview);
  679. for (let index = 0; index < cnt; index++) {
  680. var prop = ProtocolActiveServer.NewYearBagInfo.data();
  681. prop.wKey = Global.GetUint16(dataview);
  682. prop.nPrice = Global.GetInt32(dataview);
  683. prop.nSale = Global.GetInt32(dataview);
  684. prop.strName = Global.Read2String(dataview);
  685. prop.dwIconID = Global.GetInt32(dataview);
  686. prop.strBonus = Global.Read2String(dataview);
  687. prop.wState = Global.GetUint16(dataview);
  688. data.kList.push(prop);
  689. }
  690. data.kEndTime = Global.Read2Time(dataview);
  691. return data;
  692. }
  693. case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_INVITE_USER_LIST:
  694. {
  695. var data = ProtocolActiveServer.CMD_GP_GetNewYear_InviteBack.data();
  696. dataview.pos =0;
  697. data.nIndex = Global.GetUint32(dataview);
  698. var cnt = Global.GetUint32(dataview);
  699. for (let index = 0; index < cnt; index++) {
  700. var friend = ProtocolActiveServer.NewYear_InviteUserItem.data();
  701. friend.user_id = Global.GetInt32(dataview);
  702. friend.nState = Global.GetInt32(dataview);
  703. friend.strNickName = Global.gbk2Utf8(Global.Read2String(dataview));
  704. friend.strHeadHttp = Global.Read2String(dataview);
  705. data.kList.push(friend);
  706. }
  707. return data;
  708. }
  709. case ProtocolActiveServer.SUB_GA_SNATCH_RED_ENVELOPE_INFO:{
  710. var data = ProtocolActiveServer.CMD_GA_RedEnvelopeRsp.data();
  711. dataview.pos =0;
  712. data.dUserRedEnve = Global.GetFloat64(dataview);
  713. data.nPlayerTime = Global.GetUint32(dataview);
  714. data.sQiangRule = Global.gbk2Utf8(Global.Read2String(dataview));
  715. data.sTiRule = Global.gbk2Utf8(Global.Read2String(dataview));
  716. var cnt = Global.GetUint32(dataview);
  717. for (let index = 0; index < cnt; index++) {
  718. var configItem = ProtocolActiveServer.RedEnvelopeConfigItem.data();
  719. configItem.nType = Global.GetInt32(dataview);
  720. configItem.nState = Global.GetInt32(dataview);
  721. configItem.nPlayerState = Global.GetInt32(dataview);
  722. configItem.stStartTime = Global.Read2Time(dataview);
  723. configItem.sDesc = Global.gbk2Utf8(Global.Read2String(dataview));
  724. configItem.dTotle = Global.GetFloat64(dataview);
  725. data.RedEnvelopeInfos.push(configItem);
  726. }
  727. return data;
  728. }
  729. case ProtocolActiveServer.SUB_GA_GET_RED_ENVELOPE_DETAIL: {
  730. var data = ProtocolActiveServer.CMD_GA_RedEnvelopeDetailRsp.data();
  731. dataview.pos = 0;
  732. var cnt = Global.GetUint32(dataview);
  733. for (let index = 0; index < cnt; index++) {
  734. var detailItem = ProtocolActiveServer.RedEnvelopeDetailItem.data();
  735. detailItem.sDesc = Global.gbk2Utf8(Global.Read2String(dataview));
  736. detailItem.dValueChange = Global.GetFloat64(dataview);
  737. detailItem.dTotle = Global.GetFloat64(dataview);
  738. detailItem.stTime = Global.Read2Time(dataview);
  739. data.RedEnvelopeDetailItems.push(detailItem);
  740. }
  741. return data;
  742. }
  743. case ProtocolActiveServer.SUB_GA_OPEN_RED_ENVELOPE: {
  744. var data = ProtocolActiveServer.CMD_GA_OpenRedEnvelopeRsp.data();
  745. dataview.pos = 0;
  746. data.nRet = Global.GetUint32(dataview);
  747. data.nState = Global.GetInt32(dataview);
  748. data.nPlayerState = Global.GetInt32(dataview);
  749. data.nOpenAmount = Global.GetFloat64(dataview);
  750. data.dUserRedEnve = Global.GetFloat64(dataview);
  751. data.nTotalNum = Global.GetUint32(dataview);
  752. data.nLeftNum = Global.GetUint32(dataview);
  753. data.nCostTime = Global.GetUint32(dataview);
  754. data.nType = Global.GetInt32(dataview);
  755. var cnt = Global.GetUint32(dataview);
  756. for (let index = 0; index < cnt; index++) {
  757. var item = ProtocolActiveServer.RedEnvelopeItem.data();
  758. item.nIndex= Global.GetUint32(dataview);
  759. item.sHeadIcon =Global.Read2String(dataview);
  760. item.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
  761. item.dAmount = Global.GetFloat64(dataview);
  762. item.stTime = Global.Read2Time(dataview);
  763. data.RedEnvelopeItems.push(item);
  764. }
  765. return data;
  766. }
  767. case ProtocolActiveServer.SUB_GA_RED_ENVELOPE_RANK: {
  768. var data = ProtocolActiveServer.CMD_GA_RedEnvelopeRankRsp.data();
  769. dataview.pos = 0;
  770. var cnt = Global.GetUint32(dataview);
  771. for (let index = 0; index < cnt; index++) {
  772. var rankItem = ProtocolActiveServer.RedEnvelopeRankItem.data();
  773. rankItem.nIndex= Global.GetUint32(dataview);
  774. rankItem.sHeadIcon =Global.Read2String(dataview);
  775. rankItem.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
  776. rankItem.TotleAmount = Global.GetFloat64(dataview);
  777. data.RedEnvelopeRankItems.push(rankItem);
  778. }
  779. return data;
  780. }
  781. case ProtocolActiveServer.SUB_GA_RED_ENVELOPE_EXCHANGE: {
  782. var data = ProtocolActiveServer.CMD_GA_RedEnvelopeExchangeRsp.data();
  783. dataview.pos = 0;
  784. data.nRet= Global.GetUint32(dataview);
  785. data.dUserRedEnve = Global.GetFloat64(dataview);
  786. data.nExchangeNum = Global.GetUint32(dataview);
  787. data.dwUserId = Global.GetUint32(dataview); //玩家id
  788. data.nRecordId = Global.GetUint32(dataview); //提现红包记录ID
  789. data.sOpenId = Global.Read2String(dataview); //openid
  790. return data;
  791. }
  792. case ProtocolActiveServer.SUB_GA_GET_RED_ENVELOPE_INFO:{
  793. var data = ProtocolActiveServer.CMD_GA_GetRedEnvelopeInfoRsp.data();
  794. dataview.pos = 0;
  795. data.nState = Global.GetInt32(dataview);
  796. data.nPlayerState = Global.GetInt32(dataview);
  797. data.nOpenAmount = Global.GetFloat64(dataview);
  798. data.nTotalNum = Global.GetUint32(dataview);
  799. data.nLeftNum = Global.GetUint32(dataview);
  800. data.nCostTime = Global.GetUint32(dataview);
  801. data.nType = Global.GetInt32(dataview);
  802. var cnt = Global.GetUint32(dataview);
  803. for (let index = 0; index < cnt; index++) {
  804. var item = ProtocolActiveServer.RedEnvelopeItem.data();
  805. item.nIndex= Global.GetUint32(dataview);
  806. item.sHeadIcon =Global.Read2String(dataview);
  807. item.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
  808. item.dAmount = Global.GetFloat64(dataview);
  809. item.stTime = Global.Read2Time(dataview);
  810. data.RedEnvelopeItems.push(item);
  811. }
  812. return data;
  813. }
  814. case ProtocolActiveServer.SUB_GA_GET_RED_ENVELOPE_OPEN_INFO:{
  815. var data = ProtocolActiveServer.CMD_GA_GetRedEnvelopeOpenInfoRsp.data();
  816. dataview.pos =0;
  817. data.nType = Global.GetInt32(dataview);
  818. data.nState = Global.GetInt32(dataview);
  819. data.nPlayerState = Global.GetInt32(dataview);
  820. data.stStartTime = Global.Read2Time(dataview);
  821. data.sDesc = Global.gbk2Utf8(Global.Read2String(dataview));
  822. data.dTotle = Global.GetFloat64(dataview);
  823. return data;
  824. }
  825. case ProtocolActiveServer.SUB_GA_SNATCH_RED_ENVELOPE_STATE:{
  826. var data = ProtocolActiveServer.CMD_GA_RedEnvelopeStateRsp.data();
  827. dataview.pos =0;
  828. data.state = Global.GetUint8(dataview);
  829. return data;
  830. }
  831. case ProtocolActiveServer.SUB_GA_RED_ENVELOPE_DETAIL_BY_INDEX:{
  832. var data = ProtocolActiveServer.CMD_GA_RedEnvelopeDetailByIndexRsp.data();
  833. dataview.pos =0;
  834. var cnt = Global.GetUint32(dataview);
  835. for (let index = 0; index < cnt; index++) {
  836. var item = ProtocolActiveServer.RedEnvelopeItem.data();
  837. item.nIndex= Global.GetUint32(dataview);
  838. item.sHeadIcon =Global.Read2String(dataview);
  839. item.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
  840. item.dAmount = Global.GetFloat64(dataview);
  841. item.stTime = Global.Read2Time(dataview);
  842. data.RedEnvelopeItems.push(item);
  843. }
  844. return data;
  845. }
  846. default:
  847. {
  848. break;
  849. }
  850. }
  851. }
  852. },
  853. start() {
  854. },
  855. }//static
  856. });