293 lines
9.1 KiB
C#
293 lines
9.1 KiB
C#
using System.Collections.Generic;
|
|
using Thousandto.Plugins.Common;
|
|
using Thousandto.Code.Logic.Network;
|
|
|
|
namespace MSG_Buff
|
|
{
|
|
public partial class ResBuffs : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResBuffs(this);
|
|
}
|
|
|
|
public const uint MsgID = 117101;
|
|
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(buffs == null)
|
|
{
|
|
buffs = new List<MSG_Common.Buff>();
|
|
}
|
|
buffs.Add(new MSG_Common.Buff());
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
buffs[buffs.Count - 1].ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(buffs != null)
|
|
{
|
|
buffs.Clear();
|
|
}
|
|
}
|
|
public List<MSG_Common.Buff> buffs = new List<MSG_Common.Buff>();
|
|
}
|
|
public partial class ResAddBuff : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResAddBuff(this);
|
|
}
|
|
|
|
public const uint MsgID = 117102;
|
|
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:
|
|
ownId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
if(buff == null)
|
|
{
|
|
buff = new MSG_Common.Buff();
|
|
}
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
buff.ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
ownId = 0;
|
|
if(buff != null)
|
|
{
|
|
buff.Clear();
|
|
}
|
|
}
|
|
public ulong ownId;
|
|
public MSG_Common.Buff buff;
|
|
}
|
|
public partial class ResRemoveBuff : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResRemoveBuff(this);
|
|
}
|
|
|
|
public const uint MsgID = 117103;
|
|
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:
|
|
ownId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
id = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
ownId = 0;
|
|
id = 0;
|
|
}
|
|
public ulong ownId;
|
|
public int id;
|
|
}
|
|
public partial class ResUpdateBuff : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResUpdateBuff(this);
|
|
}
|
|
|
|
public const uint MsgID = 117104;
|
|
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:
|
|
ownId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
if(buff == null)
|
|
{
|
|
buff = new MSG_Common.Buff();
|
|
}
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
buff.ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
ownId = 0;
|
|
if(buff != null)
|
|
{
|
|
buff.Clear();
|
|
}
|
|
}
|
|
public ulong ownId;
|
|
public MSG_Common.Buff buff;
|
|
}
|
|
public partial class ResHpAddOrDec : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResHpAddOrDec(this);
|
|
}
|
|
|
|
public const uint MsgID = 117105;
|
|
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:
|
|
ownId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
value = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
ownId = 0;
|
|
value = 0;
|
|
}
|
|
public ulong ownId;
|
|
public int value;
|
|
}
|
|
public partial class ReqAddbuff : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 117201;
|
|
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 ReqRemovebuff : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 117202;
|
|
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;
|
|
}
|
|
}
|
|
|