317 lines
10 KiB
C#
317 lines
10 KiB
C#
using System.Collections.Generic;
|
|
using Thousandto.Plugins.Common;
|
|
using Thousandto.Code.Logic.Network;
|
|
|
|
namespace MSG_Heraldry
|
|
{
|
|
public partial class HeraldryInfo : 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 :
|
|
key = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2 :
|
|
heraldryId = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
case 3 :
|
|
heraldryModelId = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
case 4 :
|
|
loseTime = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 5 :
|
|
bind = 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.WriteUint64(1,key);
|
|
ProtoBufUtils.WriteInt32(2,heraldryId);
|
|
ProtoBufUtils.WriteInt32(3,heraldryModelId);
|
|
ProtoBufUtils.WriteUint64(4,loseTime);
|
|
ProtoBufUtils.WriteBoolean(5,bind);
|
|
ProtoBufUtils.SetVEndIndex(subItemInfoId);
|
|
return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
|
|
}
|
|
public void Clear()
|
|
{
|
|
key = 0;
|
|
heraldryId = 0;
|
|
heraldryModelId = 0;
|
|
loseTime = 0;
|
|
bind = false;
|
|
}
|
|
public ulong key;
|
|
public int heraldryId;
|
|
public int heraldryModelId;
|
|
public ulong loseTime;
|
|
public bool bind;
|
|
}
|
|
public partial class ReqHeraldryAction : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 161201;
|
|
public void Excute(){}
|
|
public void Send()
|
|
{
|
|
lock (ProtoBufUtils.WriteLocker)
|
|
{
|
|
byte[] bytes = null;
|
|
ProtoBufUtils.InitWriteData();
|
|
ProtoBufUtils.WriteUint64(1,key);
|
|
ProtoBufUtils.WriteInt32(2,actType);
|
|
bytes = ProtoBufUtils.GetData();
|
|
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
key = 0;
|
|
actType = 0;
|
|
}
|
|
public ulong key;
|
|
public int actType;
|
|
}
|
|
public partial class ResHeraldryPlay : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResHeraldryPlay(this);
|
|
}
|
|
|
|
public const uint MsgID = 161101;
|
|
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:
|
|
key = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
result = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
key = 0;
|
|
result = 0;
|
|
}
|
|
public ulong key;
|
|
public int result;
|
|
}
|
|
public partial class ResHeraldryRest : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResHeraldryRest(this);
|
|
}
|
|
|
|
public const uint MsgID = 161102;
|
|
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:
|
|
key = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
result = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
key = 0;
|
|
result = 0;
|
|
}
|
|
public ulong key;
|
|
public int result;
|
|
}
|
|
public partial class ResHeraldryRenew : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResHeraldryRenew(this);
|
|
}
|
|
|
|
public const uint MsgID = 161103;
|
|
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:
|
|
key = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
result = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
key = 0;
|
|
result = 0;
|
|
}
|
|
public ulong key;
|
|
public int result;
|
|
}
|
|
public partial class ResPlayerHeraldryChange : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResPlayerHeraldryChange(this);
|
|
}
|
|
|
|
public const uint MsgID = 161104;
|
|
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:
|
|
roleId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
heraldryId = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
roleId = 0;
|
|
heraldryId = 0;
|
|
}
|
|
public ulong roleId;
|
|
public int heraldryId;
|
|
}
|
|
public partial class ResSyncHeraldry : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResSyncHeraldry(this);
|
|
}
|
|
|
|
public const uint MsgID = 161105;
|
|
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(heraldry == null)
|
|
{
|
|
heraldry = new HeraldryInfo();
|
|
}
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
heraldry.ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(heraldry != null)
|
|
{
|
|
heraldry.Clear();
|
|
}
|
|
}
|
|
public HeraldryInfo heraldry;
|
|
}
|
|
}
|
|
|