| Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA31_tagMCActGrowupBuyInfo.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA31_tagMCActGrowupBuyInfo.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Welfare/CZBMCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Welfare/CZBMModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Welfare/CZBMWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Welfare/OperationCZBM.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA31_tagMCActGrowupBuyInfo.cs
@@ -1,20 +1,13 @@ using UnityEngine; using System.Collections; using Snxxz.UI; // AA 31 �ɳ�������Ϣ #tagMCActGrowupBuyInfo // AA 31 成长必买活动信息 #tagMCActGrowupBuyInfo public class DTCAA31_tagMCActGrowupBuyInfo : DtcBasic { public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); HAA31_tagMCActGrowupBuyInfo vNetData = vNetPack as HAA31_tagMCActGrowupBuyInfo; OperationTimeHepler.Instance.UpdateCZBMRecharge(vNetData); } } Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA31_tagMCActGrowupBuyInfo.cs
@@ -1,35 +1,59 @@ using UnityEngine; using System.Collections; // AA 31 成长必买活动信息 #tagMCActGrowupBuyInfo public class HAA31_tagMCActGrowupBuyInfo : GameNetPackBasic { public string StartDate; // 开始日期 y-m-d public string EndtDate; // 结束日期 y-m-d public byte GroupCount; // 循环购买礼包组数 public tagMCActGrowupBuyGroup[] GroupList; //循环购买礼包组列表 public HAA31_tagMCActGrowupBuyInfo () { _cmd = (ushort)0xAA31; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out StartDate, vBytes, NetDataType.Chars, 10); TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10); TransBytes (out GroupCount, vBytes, NetDataType.BYTE); GroupList = new tagMCActGrowupBuyGroup[GroupCount]; for (int i = 0; i < GroupCount; i ++) { GroupList[i] = new tagMCActGrowupBuyGroup(); TransBytes (out GroupList[i].BuyCount, vBytes, NetDataType.BYTE); TransBytes (out GroupList[i].BuyCTGIDList, vBytes, NetDataType.DWORD, GroupList[i].BuyCount); TransBytes (out GroupList[i].PlayerBuyIndex, vBytes, NetDataType.BYTE); } } public struct tagMCActGrowupBuyGroup { public byte BuyCount; // 循环购买礼包数 public uint[] BuyCTGIDList; // 循环购买礼包充值ID列表 public byte PlayerBuyIndex; // 玩家当前可购买的礼包充值ID在列表中索引 } } using UnityEngine; using System.Collections; // AA 31 成长必买活动信息 #tagMCActGrowupBuyInfo public class HAA31_tagMCActGrowupBuyInfo : GameNetPackBasic { public string StartDate; // 开始日期 y-m-d public string EndtDate; // 结束日期 y-m-d public byte GroupCount; // 循环购买礼包组数 public tagMCActGrowupBuyGroup[] GroupList; //循环购买礼包组列表 public HAA31_tagMCActGrowupBuyInfo () { _cmd = (ushort)0xAA31; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out StartDate, vBytes, NetDataType.Chars, 10); TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10); TransBytes (out GroupCount, vBytes, NetDataType.BYTE); GroupList = new tagMCActGrowupBuyGroup[GroupCount]; for (int i = 0; i < GroupCount; i ++) { GroupList[i] = new tagMCActGrowupBuyGroup(); TransBytes (out GroupList[i].BuyCount, vBytes, NetDataType.BYTE); GroupList[i].BuyCTGIDList = new tagMCActGrowupBuyCTGInfo[GroupList[i].BuyCount]; for (int j = 0; j < GroupList[i].BuyCount; j ++) { GroupList[i].BuyCTGIDList[j] = new tagMCActGrowupBuyCTGInfo(); TransBytes (out GroupList[i].BuyCTGIDList[j].CTGID, vBytes, NetDataType.BYTE); TransBytes (out GroupList[i].BuyCTGIDList[j].GainItemCount, vBytes, NetDataType.BYTE); GroupList[i].BuyCTGIDList[j].GainItemList = new tagMCActGrowupBuyCTGItem[GroupList[i].BuyCTGIDList[j].GainItemCount]; for (int k = 0; k < GroupList[i].BuyCTGIDList[j].GainItemCount; k ++) { GroupList[i].BuyCTGIDList[j].GainItemList[k] = new tagMCActGrowupBuyCTGItem(); TransBytes (out GroupList[i].BuyCTGIDList[j].GainItemList[k].ItemID, vBytes, NetDataType.DWORD); TransBytes (out GroupList[i].BuyCTGIDList[j].GainItemList[k].ItemCount, vBytes, NetDataType.WORD); TransBytes (out GroupList[i].BuyCTGIDList[j].GainItemList[k].IsBind, vBytes, NetDataType.BYTE); } } TransBytes (out GroupList[i].PlayerBuyIndex, vBytes, NetDataType.BYTE); } } public struct tagMCActGrowupBuyCTGItem { public uint ItemID; public ushort ItemCount; public byte IsBind; } public struct tagMCActGrowupBuyGroup { public byte BuyCount; // 循环购买礼包数 public tagMCActGrowupBuyCTGInfo[] BuyCTGIDList; // 循环购买礼包充值ID信息列表 public byte PlayerBuyIndex; // 玩家当前可购买的礼包充值ID在列表中索引 } public struct tagMCActGrowupBuyCTGInfo { public byte CTGID; // 充值表ID public byte GainItemCount; // 获得物品数 public tagMCActGrowupBuyCTGItem[] GainItemList; // 获得物品列表,替换充值表中的 GainItemList 字段信息 } } System/Welfare/CZBMCell.cs
@@ -25,7 +25,7 @@ { OperationCZBM operation = operationBase as OperationCZBM; int ctgID = (int)operation.CZBMGiftInfo[model.selectIndex].ctgList[index]; int ctgID = (int)operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList[index].CTGID; var ctgInfo = CTGConfig.Get(ctgID); OrderInfoConfig orderInfoConfig; if (vipModel.TryGetOrderInfo(ctgID, out orderInfoConfig)) @@ -34,7 +34,7 @@ m_GetBtn.SetListener(()=>{ if (index != operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex) { int ctgID2 = (int)operation.CZBMGiftInfo[model.selectIndex].ctgList[operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex]; int ctgID2 = (int)operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList[operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex].CTGID; var ctgInfo2 = CTGConfig.Get(ctgID2); SysNotifyMgr.Instance.ShowTip("CZBMLimit", ctgInfo2.Title); return; @@ -44,20 +44,20 @@ } //显示物品 var _list = vipModel.m_RechargeGainItemDict[ctgID]; var _list = model.GetGiftsByCTGID(ctgID); for (int i = 0; i < m_Items.Length; i++) { if (i >= _list.Count) if (i >= _list.Length) { m_Items[i].gameObject.SetActive(false); continue; } m_Items[i].gameObject.SetActive(true); var itemID = _list[i].id; var itemID = (int)_list[i].ItemID; var ItemCell = m_Items[i]; var Item = ItemConfig.Get(itemID); ItemCellModel cellModel = new ItemCellModel(itemID, true, (ulong)_list[i].count); ItemCellModel cellModel = new ItemCellModel(itemID, true, (ulong)_list[i].ItemCount); ItemCell.Init(cellModel); ItemCell.button.RemoveAllListeners(); ItemCell.button.AddListener(() => @@ -75,7 +75,7 @@ } else { int ctgID1 = (int)operation.CZBMGiftInfo[model.selectIndex].ctgList[index - 1]; int ctgID1 = (int)operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList[index - 1].CTGID; var ctgInfo1 = CTGConfig.Get(ctgID1); m_GiftLimitTxt.text = Language.Get("CZBMLimit", ctgInfo1.Title); } System/Welfare/CZBMModel.cs
@@ -37,8 +37,27 @@ { } public HAA31_tagMCActGrowupBuyInfo.tagMCActGrowupBuyCTGItem[] GetGiftsByCTGID(int ctgID) { OperationCZBM operation; if (OperationTimeHepler.Instance.TryGetOperation(Operation.CZBMGift, out operation)) { for (int i = 0; i < operation.CZBMGiftInfo.Count; i++) { for (int j = 0; j < operation.CZBMGiftInfo[i].BuyCTGIDList.Length; j++) { if (operation.CZBMGiftInfo[i].BuyCTGIDList[j].CTGID == ctgID) { return operation.CZBMGiftInfo[i].BuyCTGIDList[j].GainItemList; } } } } return null; } } System/Welfare/CZBMWin.cs
@@ -75,10 +75,10 @@ OperationCZBM operation = operationBase as OperationCZBM; foreach(var buyInfo in operation.CZBMGiftInfo) { if (buyInfo.PlayerBuyIndex == buyInfo.ctgList.Count - 1) if (buyInfo.PlayerBuyIndex == buyInfo.BuyCTGIDList.Length - 1) { //最后一档是否已购买 int ctgID = (int)buyInfo.ctgList[buyInfo.PlayerBuyIndex]; int ctgID = (int)buyInfo.BuyCTGIDList[buyInfo.PlayerBuyIndex].CTGID; VipModel.RechargeCount _rechargeCount; if (vipModel.TryGetRechargeCount(ctgID, out _rechargeCount)) @@ -137,7 +137,7 @@ return; } m_BuyInfoCtrl.Refresh(); for(var i = 0; i < operation.CZBMGiftInfo[model.selectIndex].ctgList.Count; i++) for(var i = 0; i < operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList.Length; i++) { m_BuyInfoCtrl.AddCell(ScrollerDataType.Header, i); } @@ -152,15 +152,15 @@ private void ShowTip(OperationCZBM operation) { if (operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex >= operation.CZBMGiftInfo[model.selectIndex].ctgList.Count) if (operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex >= operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList.Length) { m_ShowTip.text = string.Empty; return; } int ctgID = (int)operation.CZBMGiftInfo[model.selectIndex].ctgList[operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex]; int ctgID = (int)operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList[operation.CZBMGiftInfo[model.selectIndex].PlayerBuyIndex].CTGID; var ctgInfo = CTGConfig.Get(ctgID); int ctgID1 = (int)operation.CZBMGiftInfo[model.selectIndex].ctgList[0]; int ctgID1 = (int)operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList[0].CTGID; var ctgInfo1 = CTGConfig.Get(ctgID1); m_ShowTip.text = Language.Get("CZBMBuyTip", ctgInfo.Title, ctgInfo1.Title, ctgInfo.Title); @@ -211,7 +211,7 @@ m_GroupCtrl.m_Scorller.RefreshActiveCellViews(); m_BuyInfoCtrl.Refresh(); for(var i = 0; i < operation.CZBMGiftInfo[model.selectIndex].ctgList.Count; i++) for(var i = 0; i < operation.CZBMGiftInfo[model.selectIndex].BuyCTGIDList.Length; i++) { m_BuyInfoCtrl.AddCell(ScrollerDataType.Header, i); } System/Welfare/OperationCZBM.cs
@@ -7,7 +7,7 @@ public class OperationCZBM : OperationBase { public List<CZBMBuyInfo> CZBMGiftInfo = new List<CZBMBuyInfo>(); public List<HAA31_tagMCActGrowupBuyInfo.tagMCActGrowupBuyGroup> CZBMGiftInfo = new List<HAA31_tagMCActGrowupBuyInfo.tagMCActGrowupBuyGroup>(); public override bool SatisfyOpenCondition() { return true; @@ -18,25 +18,10 @@ CZBMGiftInfo.Clear(); for(int i = 0; i < package.GroupCount; i++) { CZBMBuyInfo buyInfo = new CZBMBuyInfo(); buyInfo.PlayerBuyIndex = package.GroupList[i].PlayerBuyIndex; foreach(var ctgID in package.GroupList[i].BuyCTGIDList) { buyInfo.ctgList.Add(ctgID); } CZBMGiftInfo.Add(buyInfo); CZBMGiftInfo.Add(package.GroupList[i]); } } public class CZBMBuyInfo { public byte PlayerBuyIndex; public List<uint> ctgList = new List<uint>(); } } }