using System.Collections.Generic; using Thousandto.Plugins.Common; using Thousandto.Code.Logic.Network; namespace MSG_Achievement { public partial class achivementInfo : 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 : id = ProtoBufUtils.ReadInt32(ref readPos); break; case 2 : pro = ProtoBufUtils.ReadInt32(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,id); ProtoBufUtils.WriteInt32(2,pro); ProtoBufUtils.WriteInt32(3,state); ProtoBufUtils.SetVEndIndex(subItemInfoId); return ProtoBufUtils.CheckAndSetLength(subItemInfoId); } public void Clear() { id = 0; pro = 0; state = 0; } public int id; public int pro; public int state; } public partial class ResAchievementInfo : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResAchievementInfo(this); } public const uint MsgID = 122101; 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: if(hasGetIds == null) { hasGetIds = new List(); } hasGetIds.Add(ProtoBufUtils.ReadInt32(ref readPos)); break; case 2: if(canGetIds == null) { canGetIds = new List(); } canGetIds.Add(ProtoBufUtils.ReadInt32(ref readPos)); break; case 3: if(infos == null) { infos = new List(); } infos.Add(new achivementInfo()); totalCount = ProtoBufUtils.ReadInt32(ref readPos); infos[infos.Count - 1].ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { if(hasGetIds != null) { hasGetIds.Clear(); } if(canGetIds != null) { canGetIds.Clear(); } if(infos != null) { infos.Clear(); } } public List hasGetIds = new List(); public List canGetIds = new List(); public List infos = new List(); } public partial class ResUpdateAchivement : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResUpdateAchivement(this); } public const uint MsgID = 122102; 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: if(infos == null) { infos = new List(); } infos.Add(new achivementInfo()); totalCount = ProtoBufUtils.ReadInt32(ref readPos); infos[infos.Count - 1].ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { if(infos != null) { infos.Clear(); } } public List infos = new List(); } public partial class ReqGetAchievement : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 122201; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); ProtoBufUtils.WriteInt32(1,id); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { id = 0; } public int id; } public partial class ResGetAchievement : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResGetAchievement(this); } public const uint MsgID = 122103; 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: id = ProtoBufUtils.ReadInt32(ref readPos); break; default: break; } } } } public void Clear() { id = 0; } public int id; } }