123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947 |
- var ProtocolActiveServer = require("ProtocolActiveServer")
- var BaseDefine = require("BaseDefine")
- var Global = require("Global")
- import { RecvPacketHelper } from 'PacketHelper'
- cc.Class({
- extends: cc.Component,
- properties: {
- },
-
- statics: {
- analyzeDataEx(data) {
- var dv = new DataView(data);
- return this.analyzeData(dv.getUint16(4, true), dv.getUint16(6, true), new DataView(data.slice(8)));
- },
- analyzeData(m, s, dataview) {
- if(m ==ProtocolActiveServer.MDM_GP_ACTIVITY)
- {
- switch(s)
- {
- case ProtocolActiveServer.SUB_GP_INDIANA_GET_CONFIG_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GP_ActivityIndianaConfigList.data();
- dataview.pos =0;
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = ProtocolActiveServer.DBO_GP_ActivityIndianaConfig.data();
- data.dwID = Global.GetUint32(dataview);
- data.kBonusName =Global.Read2String(dataview);
- data.kBonusURL = Global.Read2String(dataview);
- data.dwTotalAmount = Global.GetUint32(dataview);
- data.dwUsedAmount = Global.GetUint32(dataview);
- data.kStartTime = Global.Read2Time(dataview);
- data.kEndTime = Global.Read2Time(dataview);
- data.dwLuckyNum = Global.GetUint32(dataview);
- data.dwLuckyNumB = Global.GetUint32(dataview);
- data.dwRatio = Global.GetUint32(dataview);
- data.dwStatus = Global.GetUint32(dataview);
- data.kNickName = Global.Read2String(dataview);
- data.dwLimitCount = Global.GetUint32(dataview);
- data.dwUserID = Global.GetUint32(dataview);
- data.dwJoinNum = Global.GetUint32(dataview);
- data.lCurrency = Global.Read2ll(dataview);
- data.lRewardNum = Global.Read2ll(dataview);
- data.strNickName = Global.Read2String(dataview);
- data.strHeadHttp = Global.Read2String(dataview);
- data.strGoodsDesc = Global.Read2String(dataview);
- datalist.DBO_GP_ActivityIndianaConfigListlist.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GP_INDIANA_GET_TICKET_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GP_ActivityIndianaTicketList.data();
- dataview.pos =0;
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = ProtocolActiveServer.DBO_GP_ActivityIndianaTicket.data();
- data.dwNumber = Global.GetUint32(dataview);
- data.dwCurrentID = Global.GetUint32(dataview);
- datalist.DBO_GP_ActivityIndianaTicketList.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GP_INDIANA_GET_USERS_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GP_ActivityIndianaUsersList.data();
- dataview.pos =0;
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = ProtocolActiveServer.DBO_GP_ActivityIndianaUsers.data();
- data.dwUserID = Global.GetUint32(dataview);
- data.kNickName = Global.Read2String(dataview);
- data.kMyTime = Global.Read2String(dataview);
- datalist.DBO_GP_ActivityIndianaUsersList.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GP_GET_USERMULTISCORE_BACK:
- {
- var data = ProtocolActiveServer.DBO_GP_UserMultiScore.data();
- dataview.pos =0;
- data.lRevenue = Global.Read2ll(dataview);
- data.lUserScore = Global.Read2ll(dataview);
- data.lUserInsure = Global.Read2ll(dataview);
- data.lBankScore = Global.Read2ll(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_SHOP_GET_GOODS_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GA_ActivityShopGoodsList.data();
- dataview.pos =0;
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = ProtocolActiveServer.DBO_GA_ActivityShopGoods.data();
- data.dwID = Global.GetUint32(dataview);
- data.kGoodsTitle = Global.Read2String(dataview);
- data.kGoodsDesc = Global.Read2String(dataview);
- data.kGoodsURL = Global.Read2String(dataview);
- data.dwRatio = Global.GetUint32(dataview);
- data.kStartDate = Global.Read2Time(dataview);
- data.kEndDate = Global.Read2Time(dataview);
- data.dwTotalAmount = Global.GetUint32(dataview);
- data.dwUsedAmount = Global.GetUint32(dataview);
- data.dwDayLimit = Global.GetUint32(dataview);
- data.dwShowStatus = Global.GetUint32(dataview);
- data.dwDayUsedAmount = Global.GetUint32(dataview);
- data.cbType = Global.GetUint8(dataview);
- data.cbPropType = Global.GetUint8(dataview);
- data.kBonusString = Global.Read2String(dataview);
- data.Money = Global.GetFloat64(dataview);
- data.GoodsShopIndex = Global.GetUint32(dataview);
- datalist.DBO_GA_ActivityShopGoodsList.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GA_SHOP_GET_RECORD_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GA_ActivityShopRecordList.data();
- dataview.pos =0;
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = ProtocolActiveServer.DBO_GA_ActivityShopRecord.data();
- data.dwUserID = Global.GetUint32(dataview);
- data.dwGoodsID = Global.GetUint32(dataview);
- data.kCreateDate = Global.Read2Time(dataview);
- data.dwDeleteStatus = Global.GetUint32(dataview);
- data.kGoodsTitle = Global.Read2String(dataview);
- data.kCause = Global.Read2String(dataview);
- data.nRecordID = Global.GetUint32(dataview);
- data.knickName = Global.Read2String(dataview);
- data.kMobilePhone = Global.Read2String(dataview);
- data.kUserNote = Global.Read2String(dataview);
- data.cbPropType = Global.GetUint8(dataview);
- datalist.DBO_GA_ActivityShopRecordList.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GA_TURNTABLE_GET_INFO_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GA_ActivityTurntableInfo.data();
- dataview.pos =0;
- datalist.dwTurntableTimes = Global.GetUint32(dataview);
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = ProtocolActiveServer.DBO_GA_ActivityTurntableBonus.data();
- data.dwPos = Global.GetUint32(dataview);
- data.kBonusURL = Global.Read2String(dataview);
- data.kBonusString = Global.Read2String(dataview);
- data.kBonusTitle = Global.Read2String(dataview);
- datalist.DBO_GA_ActivityTurntableBonusLIst.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GA_TURNTABLE_ADD_TIMES_BACK:
- {
- var data = ProtocolActiveServer.DBO_GA_ActivityTurntableAddTimes.data();
- dataview.pos =0;
- data.dwTurntableTimes = Global.GetUint32(dataview);
- return data;
- }
-
- case ProtocolActiveServer.SUB_GA_TURNTABLE_USE_BACK:
- {
- var data = ProtocolActiveServer.DBO_GA_ActivityTurntableUse.data();
- dataview.pos =0;
- data.dwPos = Global.GetUint32(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RANK_INFO_BACK:
- {
- var data = ProtocolActiveServer.DBO_GA_BackBankInfo.data();
- dataview.pos =0;
- var data = {};
- data.kList = [];
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var stUserRankInfo = {};
- stUserRankInfo.dwUserID = Global.GetUint32(dataview);
- stUserRankInfo.dwGameID = Global.GetUint32(dataview);
- stUserRankInfo.dwRank = Global.GetUint32(dataview);
- stUserRankInfo.llUserScore = Global.unify(Global.Read2ll(dataview));
- stUserRankInfo.dwExp = Global.GetUint32(dataview);
- stUserRankInfo.dwVipExp = Global.GetUint32(dataview);
- stUserRankInfo.strNickName = Global.Read2String(dataview);
-
- stUserRankInfo.strHeadHttp = Global.Read2String(dataview);
- stUserRankInfo.strAutograph = Global.Read2String(dataview);
- stUserRankInfo.cbMemberOrder = Global.GetUint8(dataview);
- stUserRankInfo.tMemberOverDate = Global.Read2Time(dataview);
- data.kList.push(stUserRankInfo);
- }
- // data.kUserID = Global.GetVectorInt32(dataview);
- // data.kRank = Global.GetVectorInt32(dataview);
- // data.kNickName = Global.GetVectorString(dataview);
- // data.kUserPoint = Global.GetVectorLL(dataview);
- // data.kHeadHttp = Global.GetVectorString(dataview);
- // data.kAutograph = Global.GetVectorString(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_DAY_GIFTS:
- {
- var data = ProtocolActiveServer.DBO_GA_GetDayGiftsStateBack.data();
- dataview.pos =0;
-
- data.bGetSate = Global.GetInt8(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GP_GET_FREECA_INFO_BACK:
- {
- var data = ProtocolActiveServer.DBO_GA_BackSalePayInfo.data();
- dataview.pos =0;
- data.dwDayLeft = Global.GetUint32(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GP_GET_GIFTS_INFO_BACK:
- {
- var data = ProtocolActiveServer.DBO_GA_BackFirstPayInfo.data();
- dataview.pos =0;
- data.bGetSate = Global.GetInt8(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_MSG_BACK:
- {
- var data = ProtocolActiveServer.CMD_GA_GET_ActivityMsg.data();
- dataview.pos =0;
-
- var data = {};
- data.ActivityMsgList = [];
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var strMsg = Global.Read2String(dataview);
- data.ActivityMsgList.push(strMsg);
- }
-
- return data;
- }
- case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_SHOP_MSG_BACK:
- {
- var data = ProtocolActiveServer.CMD_GA_GET_ActivityShopMsg.data();
- dataview.pos =0;
-
- var data = {};
- data.ShopMsgList = [];
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var strMsg = Global.Read2String(dataview);
- data.ShopMsgList.push(strMsg);
- }
-
- return data;
- }
- case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_REEARD_BACK:
- {
- var data = ProtocolActiveServer.CMD_GP_GetActivityRewardBack.data();
- dataview.pos =0;
-
- var data = {};
- data.strHttpUrl = Global.Read2String(dataview);
- data.nID = Global.GetUint32(dataview);
- data.strTitle = Global.Read2String(dataview);
- data.nCount = Global.GetUint32(dataview);
- data.nAllCount = Global.GetUint32(dataview);
- data.strNumber = Global.Read2String(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GP_RECEIVE_ACTIVITY_REWARD_BACK:
- {
- var data = ProtocolActiveServer.CMD_GP_ReceiveActivityRewardBack.data();
- dataview.pos =0;
-
- data = {};
- data.bSuccess = Global.GetInt8(dataview);
- data.kErrMsg = Global.Read2String(dataview);
- data.tRewardTime = Global.Read2Time(dataview);
- data.kGoodsTitle = Global.Read2String(dataview);
- data.kCause = Global.Read2String(dataview);
- data.nRecordID = Global.GetUint32(dataview);
- data.knickName = Global.Read2String(dataview);
- data.kMobilePhone = Global.Read2String(dataview);
- data.kUserNote = Global.Read2String(dataview);
- data.cbPropType = Global.GetUint8(dataview);
- data.lScore = Global.Read2ll(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GP_GET_ACTIVITY_REEARD_LOG_BACK:
- {
- var datalist = ProtocolActiveServer.CMD_GP_GetActivityRewardLogBack.data();
- dataview.pos =0;
-
- var count = Global.GetUint32(dataview);
- for (var num = 0; num < count; ++num) {
- var data = {};
-
- data.bSuccess = Global.GetInt8(dataview);
- data.kErrMsg = Global.Read2String(dataview);
- // data.nID = Global.GetUint32(dataview);
- data.tRewardTime = Global.Read2Time(dataview);
- // data.strName = Global.Read2String(dataview);
- data.kGoodsTitle = Global.Read2String(dataview);
- data.kCause = Global.Read2String(dataview);
- data.nRecordID = Global.GetUint32(dataview);
- data.knickName = Global.Read2String(dataview);
- data.kMobilePhone = Global.Read2String(dataview);
- data.kUserNote = Global.Read2String(dataview);
- data.cbPropType = Global.GetUint8(dataview);
- data.lScore = Global.Read2ll(dataview);
- datalist.ActivityRewardLogList.push(data);
- }
- return datalist;
- }
- case ProtocolActiveServer.SUB_GA_GET_INVITE_BASE_INFO:
- {
- var data = ProtocolActiveServer.CMD_GP_GetInviteBack.data();
- dataview.pos =0;
-
- // invite_config:[], //InviteConfigItem 配置
- // invite_users:[], //InviteUserItem 配置
- // invite_count:0, //int 当前邀请成功数目
- var cnt1 = Global.GetUint32(dataview);
- for (let index = 0; index < cnt1; index++) {
- // invite_num:0, //int
- // prop_id:0, //int 0 待邀请 1 邀请中
- // state:0, //int -1 未达成 0 达成未领取 已领取
- // s_bonus:"", //string
- var InviteConfigItem = ProtocolActiveServer.InviteConfigItem.data();
- InviteConfigItem.invite_num = Global.GetInt32(dataview);
- InviteConfigItem.prop_id = Global.GetInt32(dataview);
- InviteConfigItem.state = Global.GetInt32(dataview);
- InviteConfigItem.s_bonus = Global.Read2String(dataview);
- data.invite_config.push(InviteConfigItem);
- }
- var cnt2 = Global.GetUint32(dataview);
- for (let index = 0; index < cnt2; index++) {
- // user_id:0, //int
- // state:0, //int 0 待邀请 1 邀请中
- var InviteUserItem = ProtocolActiveServer.InviteUserItem.data();
- InviteUserItem.user_id = Global.GetInt32(dataview);
- InviteUserItem.state = Global.GetInt32(dataview);
- InviteUserItem.headHttp = Global.Read2String(dataview);
- data.invite_users.push(InviteUserItem);
- }
- data.invite_count = Global.GetInt32(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_SEND_INVITE:
- {
- var data = ProtocolActiveServer.CMD_GP_InviteSendBack.data();
- dataview.pos =0;
-
- // ret:0, //int 0 OK 1 分享在有效期内 2 已经邀请成功
- // gold:0, //int 首次分享该玩家 有奖励 金币
- data.ret = Global.GetInt32(dataview);
- data.gold = Global.GetInt32(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_INVITE_LIST:
- {
- var data = ProtocolActiveServer.CMD_GP_InviteUserListBack.data();
- dataview.pos =0;
-
- // invite_users:[], //InviteUserItem 用户ID
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- // user_id:0, //int
- // state:0, //int 0 待邀请 1 邀请中
- var InviteUserItem = ProtocolActiveServer.InviteUserItem.data();
- InviteUserItem.user_id = Global.GetInt32(dataview);
- InviteUserItem.state = Global.GetInt32(dataview);
- InviteUserItem.headHttp = Global.Read2String(dataview);
- data.invite_users.push(InviteUserItem);
- }
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_INVITE_REWARD:
- {
- var data = ProtocolActiveServer.CMD_GP_InviteRewardBack.data();
- dataview.pos =0;
-
- // invite_users:[], //InviteUserItem 用户ID
- data.ret = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var InviteConfigItem = ProtocolActiveServer.InviteConfigItem.data();
- InviteConfigItem.invite_num = Global.GetInt32(dataview);
- InviteConfigItem.prop_id = Global.GetInt32(dataview);
- InviteConfigItem.state = Global.GetInt32(dataview);
- InviteConfigItem.s_bonus = Global.Read2String(dataview);
- data.invite_config.push(InviteConfigItem);
- }
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RETURN_STATE:
- {
- var data = ProtocolActiveServer.CMD_GP_GetReturnStateBack.data();
- dataview.pos =0;
-
- data.state = Global.GetInt32(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RETURN_BASE_INFO:
- {
- var data = ProtocolActiveServer.CMD_GP_GetReturnBack.data();
- dataview.pos =0;
-
- // return_login_config:[], //ReturnLoginConfigItem
- // first_reward_state:0, //int 0 未领取 1领取了
- // left_time:0, //int 活动剩余秒
- // gift1:0, //int 特惠礼包1 0未购买 1购买
- // gift2:0, //int 特惠礼包2 同上
- // gift3:0, //int 特惠礼包3 同上
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- // login_num:0, //int
- // prop_id:0, //int
- // state:0, //-1 未达成 0 达成未领取 已领取
- // s_bonus:"", //string
- var backLoginConfigtItem = ProtocolActiveServer.ReturnLoginConfigItem.data();
- backLoginConfigtItem.login_num = Global.GetInt32(dataview);
- backLoginConfigtItem.prop_id = Global.GetInt32(dataview);
- backLoginConfigtItem.state = Global.GetInt32(dataview);
- backLoginConfigtItem.s_bonus = Global.Read2String(dataview);
- data.return_login_config.push(backLoginConfigtItem);
- }
- data.first_reward_state = Global.GetInt32(dataview);
- data.left_time = Global.GetInt32(dataview);
- data.gift1 = Global.GetInt32(dataview);
- data.gift2 = Global.GetInt32(dataview);
- data.gift3 = Global.GetInt32(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RETURN_REWARD:
- {
- var data = ProtocolActiveServer.CMD_GP_GetReturnRewardBack.data();
- dataview.pos = 0;
-
- data.ret = Global.GetInt32(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RETURN_LOGIN_REWARD:
- {
- var data = ProtocolActiveServer.CMD_GP_GetReturnLoginRewardBack.data();
- dataview.pos =0;
-
- // ret:0, //int 0领取成功 1失败
- // return_login_config:[], //ReturnLoginConfigItem 配置
- data.ret = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- // login_num:0, //int
- // prop_id:0, //int
- // state:0, //-1 未达成 0 达成未领取 已领取
- // s_bonus:"", //string
- var backLoginConfigtItem = ProtocolActiveServer.ReturnLoginConfigItem.data();
- backLoginConfigtItem.login_num = Global.GetInt32(dataview);
- backLoginConfigtItem.prop_id = Global.GetInt32(dataview);
- backLoginConfigtItem.state = Global.GetInt32(dataview);
- backLoginConfigtItem.s_bonus = Global.Read2String(dataview);
- data.return_login_config.push(backLoginConfigtItem);
- }
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RETURN_GIFT_STATE:
- {
- var data = ProtocolActiveServer.CMD_GP_GetReturnGiftStateBack.data();
- dataview.pos =0;
-
- data.gift1 = Global.GetInt32(dataview);
- data.gift2 = Global.GetInt32(dataview);
- data.gift3 = Global.GetInt32(dataview);
-
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_LUCKYDRAW_INFO:
- {
- var data = ProtocolActiveServer.CMD_GP_GetPropListInfoBack.data();
- dataview.pos =0;
- //kList:[], //propList
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- //wType:0, //WORD 类型 0:无效 1:普通 2:进阶 3:精英 4:富豪 5:贵族 6:王者
- //nFreeType:0, //WORD 费用类型 0:免费 1:金豆 2:鲜花饼, 3:礼券
- //nFree:0, //WORD 费用
- //kList:[], //prop
- var propList = ProtocolActiveServer.CMD_GP_GetPropListBack.data();
- propList.wType = Global.GetUint16(dataview);
- //propList.nFreeType = Global.GetUint16(dataview);
- //propList.nFree = Global.GetInt32(dataview);
- propList.strFree = Global.Read2String(dataview);
- propList.strMinFree = Global.Read2String(dataview);
- var porpCnt = Global.GetUint32(dataview);
- for (let i = 0; i < porpCnt; i++) {
- //wKey:0, //WORD 物品标示
- //dwPropID:0, //DWORD
- //dwPropNum:0, //DWORD
- //strName:"", //string 物品名称
- //dwIconID:0, //DWORD 图片id
- //wRate:0, //WORD 概率
- var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.dwPropNum = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.wRate = Global.GetUint16(dataview);
- prop.strBonus = Global.Read2String(dataview);
- propList.kList.push(prop);
- }
- data.kList.push(propList);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_LUCKYDRAW_PLAY_BACK:
- {
- var data = ProtocolActiveServer.CMD_GP_GetDrawPropBack.data();
- dataview.pos =0;
- //retCode:0, //int 0 OK 1 分享在有效期内 2 已经邀请成功
- //kList:[], //LuckyDraw
- data.retCode = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- //wKey:0, //WORD 物品标示
- //dwPropID:0, //DWORD
- //dwPropNum:0, //DWORD
- //strName:"", //string 物品名称
- //dwIconID:0, //DWORD 图片id
- //wRate:0, //WORD 概率
- var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.dwPropNum = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.wRate = Global.GetUint16(dataview);
- prop.strBonus = Global.Read2String(dataview);
- data.kList.push(prop);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_LUCKYDRAW_CALL:
- {
- var data = ProtocolActiveServer.CMD_GP_GetNoticeBack.data();
- dataview.pos =0;
- //kList:[], //LuckyDrawCall
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- //wKey:0, //WORD 物品标示
- //dwPropID:0, //DWORD
- //strName:"", //string 用户名称
- //nFree:0, //DWORD
- //nFreeType:0, //DWORD 物品名称
- //strReward:0, //string 奖品ID:NUM
- //wTime:0, //SYSTEMTIME
- var prop = ProtocolActiveServer.CMD_GP_GetPropNoticeBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- //prop.nFree = Global.GetInt32(dataview);
- //prop.nFreeType = Global.GetInt32(dataview);
- prop.strFree = Global.Read2String(dataview);
- prop.strReward = Global.Read2String(dataview);
- prop.strRewardDes = Global.Read2String(dataview);
- prop.wTime = Global.Read2Time(dataview);
- data.kList.push(prop);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_GUIDE_CONFIG_BACK: {
- var data = {};
- data.vList = [];
- dataview.pos =0;
- var cnt = Global.GetInt32(dataview);
- for (let index = 0; index < cnt; index++) {
- var info = ProtocolActiveServer.CMD_GA_GuideConfig.data();
-
- info.nID = Global.GetInt32(dataview);
- info.strGuideDesc = Global.gbk2Utf8(Global.Read2String(dataview));
- info.cbGuideType = Global.GetUint8(dataview);
- info.nLossCount = Global.GetInt32(dataview);
- info.nProbability = Global.GetInt32(dataview);
- info.strGuideGame = Global.gbk2Utf8(Global.Read2String(dataview));
- info.cbState = Global.GetUint8(dataview);
-
- data.vList.push(info);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_UPDATE_GUIDE_CONFIG_BACK: {
- var data = ProtocolActiveServer.CMD_GA_UpdateGuideConfigBack.data();
- dataview.pos =0;
-
- data.dwUserID = Global.GetUint32(dataview);
- data.nID = Global.GetInt32(dataview);
- data.bSuccess = Global.GetUint8(dataview) == 1;
- data.cbState = Global.GetUint8(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE_INFO:{
- var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Fire_Info.data();
- dataview.pos =0;
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.dwPropNum = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.wRate = Global.GetUint16(dataview);
- prop.strBonus = Global.Read2String(dataview);
- data.kList.push(prop);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE:{
- var data = ProtocolActiveServer.CMD_GP_NewYearFireBack.data();
- dataview.pos =0;
- data.retCode = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.dwPropNum = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.wRate = Global.GetUint16(dataview);
- prop.strBonus = Global.Read2String(dataview);
- data.kList.push(prop);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE_CALL:{
- var data = ProtocolActiveServer.CMD_GP_NewYear_Call.data();
- dataview.pos =0;
- data.dwUserID = Global.GetUint32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var prop = ProtocolActiveServer.CMD_GP_GetPropNoticeBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.strFree = Global.Read2String(dataview);
- prop.strReward = Global.Read2String(dataview);
- prop.strRewardDes = Global.Read2String(dataview);
- prop.wTime = Global.Read2Time(dataview);
- data.kList.push(prop);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_FIRE_USER:{
- var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Fire_User.data();
- dataview.pos = 0;
- data.dwUserID = Global.GetInt32(dataview);
- data.nFireCnt = Global.GetInt32(dataview);
- data.nUseFireCnt = Global.GetInt32(dataview);
- data.nMaxUseCnt = Global.GetInt32(dataview);
- data.nUserFireCnt = Global.GetInt32(dataview);
- data.nLoginDay = Global.GetInt32(dataview);
- data.nAddByGameTime = Global.GetInt32(dataview);
- data.nInviteNewUser = Global.GetInt32(dataview);
- data.nInviteOldUser = Global.GetInt32(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_LOGIN_INFO:{
- var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Login_Info.data();
- dataview.pos =0;
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.dwPropNum = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.wState = Global.GetUint16(dataview);
- prop.strBonus = Global.Read2String(dataview);
- data.kList.push(prop);
- }
- data.kEndTime = Global.Read2Time(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_BAG:{
- var data = ProtocolActiveServer.CMD_GP_NewYear_LoginBagBack.data();
- dataview.pos =0;
- data.retCode = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var prop = ProtocolActiveServer.CMD_GP_GetPropBack.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.dwPropID = Global.GetInt32(dataview);
- prop.dwPropNum = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.wState = Global.GetUint16(dataview);
- prop.strBonus = Global.Read2String(dataview);
- data.kList.push(prop);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_BAG_INFO:{
- var data = ProtocolActiveServer.CMD_GP_Get_NewYear_Bag_Info.data();
- dataview.pos =0;
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var prop = ProtocolActiveServer.NewYearBagInfo.data();
- prop.wKey = Global.GetUint16(dataview);
- prop.nPrice = Global.GetInt32(dataview);
- prop.nSale = Global.GetInt32(dataview);
- prop.strName = Global.Read2String(dataview);
- prop.dwIconID = Global.GetInt32(dataview);
- prop.strBonus = Global.Read2String(dataview);
- prop.wState = Global.GetUint16(dataview);
- data.kList.push(prop);
- }
- data.kEndTime = Global.Read2Time(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_NEWYEAR_INVITE_USER_LIST:
- {
- var data = ProtocolActiveServer.CMD_GP_GetNewYear_InviteBack.data();
- dataview.pos =0;
- data.nIndex = Global.GetUint32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var friend = ProtocolActiveServer.NewYear_InviteUserItem.data();
- friend.user_id = Global.GetInt32(dataview);
- friend.nState = Global.GetInt32(dataview);
- friend.strNickName = Global.gbk2Utf8(Global.Read2String(dataview));
- friend.strHeadHttp = Global.Read2String(dataview);
- data.kList.push(friend);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_SNATCH_RED_ENVELOPE_INFO:{
- var data = ProtocolActiveServer.CMD_GA_RedEnvelopeRsp.data();
- dataview.pos =0;
- data.dUserRedEnve = Global.GetFloat64(dataview);
- data.nPlayerTime = Global.GetUint32(dataview);
- data.sQiangRule = Global.gbk2Utf8(Global.Read2String(dataview));
- data.sTiRule = Global.gbk2Utf8(Global.Read2String(dataview));
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var configItem = ProtocolActiveServer.RedEnvelopeConfigItem.data();
- configItem.nType = Global.GetInt32(dataview);
- configItem.nState = Global.GetInt32(dataview);
- configItem.nPlayerState = Global.GetInt32(dataview);
- configItem.stStartTime = Global.Read2Time(dataview);
- configItem.sDesc = Global.gbk2Utf8(Global.Read2String(dataview));
- configItem.dTotle = Global.GetFloat64(dataview);
- data.RedEnvelopeInfos.push(configItem);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RED_ENVELOPE_DETAIL: {
- var data = ProtocolActiveServer.CMD_GA_RedEnvelopeDetailRsp.data();
- dataview.pos = 0;
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var detailItem = ProtocolActiveServer.RedEnvelopeDetailItem.data();
- detailItem.sDesc = Global.gbk2Utf8(Global.Read2String(dataview));
- detailItem.dValueChange = Global.GetFloat64(dataview);
- detailItem.dTotle = Global.GetFloat64(dataview);
- detailItem.stTime = Global.Read2Time(dataview);
- data.RedEnvelopeDetailItems.push(detailItem);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_OPEN_RED_ENVELOPE: {
- var data = ProtocolActiveServer.CMD_GA_OpenRedEnvelopeRsp.data();
- dataview.pos = 0;
- data.nRet = Global.GetUint32(dataview);
- data.nState = Global.GetInt32(dataview);
- data.nPlayerState = Global.GetInt32(dataview);
- data.nOpenAmount = Global.GetFloat64(dataview);
- data.dUserRedEnve = Global.GetFloat64(dataview);
- data.nTotalNum = Global.GetUint32(dataview);
- data.nLeftNum = Global.GetUint32(dataview);
- data.nCostTime = Global.GetUint32(dataview);
- data.nType = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var item = ProtocolActiveServer.RedEnvelopeItem.data();
- item.nIndex= Global.GetUint32(dataview);
- item.sHeadIcon =Global.Read2String(dataview);
- item.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
- item.dAmount = Global.GetFloat64(dataview);
- item.stTime = Global.Read2Time(dataview);
- data.RedEnvelopeItems.push(item);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_RED_ENVELOPE_RANK: {
- var data = ProtocolActiveServer.CMD_GA_RedEnvelopeRankRsp.data();
- dataview.pos = 0;
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var rankItem = ProtocolActiveServer.RedEnvelopeRankItem.data();
- rankItem.nIndex= Global.GetUint32(dataview);
- rankItem.sHeadIcon =Global.Read2String(dataview);
- rankItem.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
- rankItem.TotleAmount = Global.GetFloat64(dataview);
- data.RedEnvelopeRankItems.push(rankItem);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_RED_ENVELOPE_EXCHANGE: {
- var data = ProtocolActiveServer.CMD_GA_RedEnvelopeExchangeRsp.data();
- dataview.pos = 0;
- data.nRet= Global.GetUint32(dataview);
- data.dUserRedEnve = Global.GetFloat64(dataview);
- data.nExchangeNum = Global.GetUint32(dataview);
- data.dwUserId = Global.GetUint32(dataview); //玩家id
- data.nRecordId = Global.GetUint32(dataview); //提现红包记录ID
- data.sOpenId = Global.Read2String(dataview); //openid
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RED_ENVELOPE_INFO:{
- var data = ProtocolActiveServer.CMD_GA_GetRedEnvelopeInfoRsp.data();
- dataview.pos = 0;
- data.nState = Global.GetInt32(dataview);
- data.nPlayerState = Global.GetInt32(dataview);
- data.nOpenAmount = Global.GetFloat64(dataview);
- data.nTotalNum = Global.GetUint32(dataview);
- data.nLeftNum = Global.GetUint32(dataview);
- data.nCostTime = Global.GetUint32(dataview);
- data.nType = Global.GetInt32(dataview);
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var item = ProtocolActiveServer.RedEnvelopeItem.data();
- item.nIndex= Global.GetUint32(dataview);
- item.sHeadIcon =Global.Read2String(dataview);
- item.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
- item.dAmount = Global.GetFloat64(dataview);
- item.stTime = Global.Read2Time(dataview);
- data.RedEnvelopeItems.push(item);
- }
- return data;
- }
- case ProtocolActiveServer.SUB_GA_GET_RED_ENVELOPE_OPEN_INFO:{
- var data = ProtocolActiveServer.CMD_GA_GetRedEnvelopeOpenInfoRsp.data();
- dataview.pos =0;
- data.nType = Global.GetInt32(dataview);
- data.nState = Global.GetInt32(dataview);
- data.nPlayerState = Global.GetInt32(dataview);
- data.stStartTime = Global.Read2Time(dataview);
- data.sDesc = Global.gbk2Utf8(Global.Read2String(dataview));
- data.dTotle = Global.GetFloat64(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_SNATCH_RED_ENVELOPE_STATE:{
- var data = ProtocolActiveServer.CMD_GA_RedEnvelopeStateRsp.data();
- dataview.pos =0;
- data.state = Global.GetUint8(dataview);
- return data;
- }
- case ProtocolActiveServer.SUB_GA_RED_ENVELOPE_DETAIL_BY_INDEX:{
- var data = ProtocolActiveServer.CMD_GA_RedEnvelopeDetailByIndexRsp.data();
- dataview.pos =0;
- var cnt = Global.GetUint32(dataview);
- for (let index = 0; index < cnt; index++) {
- var item = ProtocolActiveServer.RedEnvelopeItem.data();
- item.nIndex= Global.GetUint32(dataview);
- item.sHeadIcon =Global.Read2String(dataview);
- item.sNickName = Global.gbk2Utf8(Global.Read2String(dataview));
- item.dAmount = Global.GetFloat64(dataview);
- item.stTime = Global.Read2Time(dataview);
- data.RedEnvelopeItems.push(item);
- }
- return data;
- }
- default:
- {
- break;
- }
- }
- }
- },
- start() {
- },
- }//static
- });
|