2025-01-25 04:38:09 +08:00

419 lines
13 KiB
C#

using System.Collections.Generic;
using Thousandto.Plugins.Common;
using Thousandto.Code.Logic.Network;
namespace MSG_Spirit
{
public partial class spiritInfo : 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 :
if(equipList == null)
{
equipList = new List<int>();
}
equipList.Add(ProtoBufUtils.ReadInt32(ref readPos));
break;
case 3 :
isActive = ProtoBufUtils.ReadBoolean(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);
for (int i = 0; i < equipList.Count; i++)
{
ProtoBufUtils.WriteInt32(2,equipList[i]);
}
ProtoBufUtils.WriteBoolean(3,isActive);
ProtoBufUtils.SetVEndIndex(subItemInfoId);
return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
}
public void Clear()
{
id = 0;
if(equipList != null)
{
equipList.Clear();
}
isActive = false;
}
public int id;
public List<int> equipList = new List<int>();
public bool isActive;
}
public partial class ResSpiritInfo : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResSpiritInfo(this);
}
public const uint MsgID = 521101;
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(list == null)
{
list = new List<spiritInfo>();
}
list.Add(new spiritInfo());
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
list[list.Count - 1].ReadMessage(ref readPos, totalCount);
break;
case 2:
cfgId = ProtoBufUtils.ReadInt32(ref readPos);
break;
case 3:
starNum = ProtoBufUtils.ReadInt32(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
if(list != null)
{
list.Clear();
}
cfgId = 0;
starNum = 0;
}
public List<spiritInfo> list = new List<spiritInfo>();
public int cfgId;
public int starNum;
}
public partial class ReqCollectEquip : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
{
public const uint MsgID = 521201;
public void Excute(){}
public void Send()
{
lock (ProtoBufUtils.WriteLocker)
{
byte[] bytes = null;
ProtoBufUtils.InitWriteData();
ProtoBufUtils.WriteInt32(1,id);
ProtoBufUtils.WriteInt32(2,equipId);
ProtoBufUtils.WriteBoolean(3,Inherit);
bytes = ProtoBufUtils.GetData();
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
}
}
public void Clear()
{
id = 0;
equipId = 0;
Inherit = false;
}
public int id;
public int equipId;
public bool Inherit;
}
public partial class ResCollectEquip : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResCollectEquip(this);
}
public const uint MsgID = 521102;
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;
case 2:
equipId = ProtoBufUtils.ReadInt32(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
id = 0;
equipId = 0;
}
public int id;
public int equipId;
}
public partial class ReqActiveSpirit : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
{
public const uint MsgID = 521202;
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 ResActiveSpirit : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResActiveSpirit(this);
}
public const uint MsgID = 521103;
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 ReqUpLevel : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
{
public const uint MsgID = 521203;
public void Excute(){}
public void Send()
{
lock (ProtoBufUtils.WriteLocker)
{
byte[] bytes = null;
ProtoBufUtils.InitWriteData();
ProtoBufUtils.WriteInt32(1,cfgId);
bytes = ProtoBufUtils.GetData();
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
}
}
public void Clear()
{
cfgId = 0;
}
public int cfgId;
}
public partial class ResUpLevel : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResUpLevel(this);
}
public const uint MsgID = 521104;
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:
cfgId = ProtoBufUtils.ReadInt32(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
cfgId = 0;
}
public int cfgId;
}
public partial class ReqUpStar : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
{
public const uint MsgID = 521204;
public void Excute(){}
public void Send()
{
lock (ProtoBufUtils.WriteLocker)
{
byte[] bytes = null;
ProtoBufUtils.InitWriteData();
ProtoBufUtils.WriteInt32(1,starNum);
bytes = ProtoBufUtils.GetData();
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
}
}
public void Clear()
{
starNum = 0;
}
public int starNum;
}
public partial class ResUpStar : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResUpStar(this);
}
public const uint MsgID = 521105;
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:
starNum = ProtoBufUtils.ReadInt32(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
starNum = 0;
}
public int starNum;
}
public partial class ResSyncFightPower : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResSyncFightPower(this);
}
public const uint MsgID = 521107;
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:
fightPower = ProtoBufUtils.ReadInt32(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
fightPower = 0;
}
public int fightPower;
}
}