using System.Collections.Generic; using Thousandto.Plugins.Common; using Thousandto.Code.Logic.Network; namespace MSG_GodBook { public partial class amuletInfo : 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 : status = ProtoBufUtils.ReadBoolean(ref readPos); break; case 3 : if(list == null) { list = new List(); } list.Add(new conditionInfo()); totalCount = ProtoBufUtils.ReadInt32(ref readPos); list[list.Count - 1].ReadMessage(ref readPos, totalCount); 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.WriteBoolean(2,status); for (int i = 0; i < list.Count; i++) { if(list != null) { list[i].WriteMessage(3); } } ProtoBufUtils.SetVEndIndex(subItemInfoId); return ProtoBufUtils.CheckAndSetLength(subItemInfoId); } public void Clear() { id = 0; status = false; if(list != null) { list.Clear(); } } public int id; public bool status; public List list = new List(); } public partial class conditionInfo : 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 : progress = ProtoBufUtils.ReadInt32(ref readPos); break; case 3 : status = 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,progress); ProtoBufUtils.WriteInt32(3,status); ProtoBufUtils.SetVEndIndex(subItemInfoId); return ProtoBufUtils.CheckAndSetLength(subItemInfoId); } public void Clear() { id = 0; progress = 0; status = 0; } public int id; public int progress; public int status; } public partial class ReqActiveAmulet : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 500201; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); ProtoBufUtils.WriteInt32(1,amuletId); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { amuletId = 0; } public int amuletId; } public partial class ReqGetReward : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 500202; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); ProtoBufUtils.WriteInt32(1,conditonId); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { conditonId = 0; } public int conditonId; } public partial class ReqGodBookInfo : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 500203; 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 ResBookInfo : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResBookInfo(this); } public const uint MsgID = 500101; 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(amulets == null) { amulets = new List(); } amulets.Add(new amuletInfo()); totalCount = ProtoBufUtils.ReadInt32(ref readPos); amulets[amulets.Count - 1].ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { if(amulets != null) { amulets.Clear(); } } public List amulets = new List(); } public partial class ResGetReward : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResGetReward(this); } public const uint MsgID = 500102; 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; } public partial class ResUpdateCondition : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResUpdateCondition(this); } public const uint MsgID = 500103; 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; } }