using System.Collections.Generic; using Thousandto.Plugins.Common; using Thousandto.Code.Logic.Network; namespace MSG_Stronger { public partial class DailyRechargeReward : ProtoBuf.IMessageInfo, ProtoBuf.IExtensible { public void Send(){} public void Excute(){} public void ReadMessage(ref int readPos, int totalCount) { int endIndex = totalCount + readPos - 1; while (readPos <= endIndex) { int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos); switch (fieldNumber) { case 1 : rewardId = ProtoBufUtils.ReadInt32(ref readPos); break; case 2 : reward = ProtoBufUtils.ReadString(ref readPos); break; case 3 : state = ProtoBufUtils.ReadInt32(ref readPos); break; default: break; } } } public int WriteMessage(int fieldNumber) { ProtoBufUtils.WriteHeader(fieldNumber, ProtoBuf.WireType.String); int subItemInfoId = ProtoBufUtils.GetSubItemInfoId(); ProtoBufUtils.SetEmptyLength(subItemInfoId); ProtoBufUtils.SetVBeginIndex(subItemInfoId); ProtoBufUtils.WriteInt32(1,rewardId); ProtoBufUtils.WriteString(2,reward); ProtoBufUtils.WriteInt32(3,state); ProtoBufUtils.SetVEndIndex(subItemInfoId); return ProtoBufUtils.CheckAndSetLength(subItemInfoId); } public void Clear() { rewardId = 0; reward = null; state = 0; } public int rewardId; public string reward; public int state; } public partial class ReqDailyRechargeReward : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 143201; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); ProtoBufUtils.WriteInt32(1,rewardId); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { rewardId = 0; } public int rewardId; } public partial class ReqDailyRechargeRewardInfo : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 143202; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { } } public partial class ResDailyRechargeRewardInfo : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResDailyRechargeRewardInfo(this); } public const uint MsgID = 143101; public void Send(){} public void ReadMessage(byte[] bytes) { lock (ProtoBufUtils.ReadLocker) { Clear(); int endIndex = bytes.Length - 1; int readPos = 0; int totalCount = 0; ProtoBufUtils.InitReadData(bytes, ref readPos); while (readPos <= endIndex) { int curType = bytes[readPos] & 7; int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos); switch (fieldNumber) { case 1: rechargeGold = ProtoBufUtils.ReadInt32(ref readPos); break; case 2: if(rewardList == null) { rewardList = new List(); } rewardList.Add(new DailyRechargeReward()); totalCount = ProtoBufUtils.ReadInt32(ref readPos); rewardList[rewardList.Count - 1].ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { rechargeGold = 0; if(rewardList != null) { rewardList.Clear(); } } public int rechargeGold; public List rewardList = new List(); } public partial class ResDailyRechargeReward : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResDailyRechargeReward(this); } public const uint MsgID = 143102; public void Send(){} public void ReadMessage(byte[] bytes) { lock (ProtoBufUtils.ReadLocker) { Clear(); int endIndex = bytes.Length - 1; int readPos = 0; int totalCount = 0; ProtoBufUtils.InitReadData(bytes, ref readPos); while (readPos <= endIndex) { int curType = bytes[readPos] & 7; int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos); switch (fieldNumber) { case 1: result = ProtoBufUtils.ReadInt32(ref readPos); break; case 2: if(reward == null) { reward = new DailyRechargeReward(); } totalCount = ProtoBufUtils.ReadInt32(ref readPos); reward.ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { result = 0; if(reward != null) { reward.Clear(); } } public int result; public DailyRechargeReward reward; } }