using System.Collections.Generic; using Thousandto.Plugins.Common; using Thousandto.Code.Logic.Network; namespace MSG_Activity { public partial class Activity : 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 : type = ProtoBufUtils.ReadInt32(ref readPos); break; case 2 : actConfig = ProtoBufUtils.ReadString(ref readPos); break; case 3 : actData = ProtoBufUtils.ReadString(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,type); ProtoBufUtils.WriteString(2,actConfig); ProtoBufUtils.WriteString(3,actData); ProtoBufUtils.SetVEndIndex(subItemInfoId); return ProtoBufUtils.CheckAndSetLength(subItemInfoId); } public void Clear() { type = 0; actConfig = null; actData = null; } public int type; public string actConfig; public string actData; } public partial class ReqActivity : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 532201; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); ProtoBufUtils.WriteInt32(1,type); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { type = 0; } public int type; } public partial class ResActivityList : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResActivityList(this); } public const uint MsgID = 532101; 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(actList == null) { actList = new List(); } actList.Add(new Activity()); totalCount = ProtoBufUtils.ReadInt32(ref readPos); actList[actList.Count - 1].ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { if(actList != null) { actList.Clear(); } } public List actList = new List(); } public partial class ResActivityChange : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResActivityChange(this); } public const uint MsgID = 532102; 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(act == null) { act = new Activity(); } totalCount = ProtoBufUtils.ReadInt32(ref readPos); act.ReadMessage(ref readPos, totalCount); break; default: break; } } } } public void Clear() { if(act != null) { act.Clear(); } } public Activity act; } public partial class ReqActivityDeal : ProtoBuf.IExtensible, ProtoBuf.IReqMessage { public const uint MsgID = 532202; public void Excute(){} public void Send() { lock (ProtoBufUtils.WriteLocker) { byte[] bytes = null; ProtoBufUtils.InitWriteData(); ProtoBufUtils.WriteInt32(1,type); ProtoBufUtils.WriteString(2,data); bytes = ProtoBufUtils.GetData(); Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID); } } public void Clear() { type = 0; data = null; } public int type; public string data; } public partial class ResActivityDeal : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResActivityDeal(this); } public const uint MsgID = 532103; 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: type = ProtoBufUtils.ReadInt32(ref readPos); break; case 2: data = ProtoBufUtils.ReadString(ref readPos); break; default: break; } } } } public void Clear() { type = 0; data = null; } public int type; public string data; } public partial class ResTagInfoList : ProtoBuf.IExtensible, ProtoBuf.IResMessage { public void Excute() { HandleMsgResult.getInstance().GS2U_ResTagInfoList(this); } public const uint MsgID = 532104; 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: tag = ProtoBufUtils.ReadString(ref readPos); break; default: break; } } } } public void Clear() { tag = null; } public string tag; } }