355 lines
11 KiB
C#
355 lines
11 KiB
C#
|
using System.Collections.Generic;
|
||
|
using Thousandto.Plugins.Common;
|
||
|
using Thousandto.Code.Logic.Network;
|
||
|
|
||
|
namespace MSG_Title
|
||
|
{
|
||
|
public partial class title : 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 :
|
||
|
remainTime = 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,remainTime);
|
||
|
ProtoBufUtils.SetVEndIndex(subItemInfoId);
|
||
|
return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
|
||
|
}
|
||
|
public void Clear()
|
||
|
{
|
||
|
id = 0;
|
||
|
remainTime = 0;
|
||
|
}
|
||
|
public int id;
|
||
|
public int remainTime;
|
||
|
}
|
||
|
public partial class ResTitleInfo : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
||
|
{
|
||
|
public void Excute()
|
||
|
{
|
||
|
HandleMsgResult.getInstance().GS2U_ResTitleInfo(this);
|
||
|
}
|
||
|
|
||
|
public const uint MsgID = 136101;
|
||
|
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(wear == null)
|
||
|
{
|
||
|
wear = new title();
|
||
|
}
|
||
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
||
|
wear.ReadMessage(ref readPos, totalCount);
|
||
|
break;
|
||
|
case 2:
|
||
|
if(list == null)
|
||
|
{
|
||
|
list = new List<title>();
|
||
|
}
|
||
|
list.Add(new title());
|
||
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
||
|
list[list.Count - 1].ReadMessage(ref readPos, totalCount);
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
public void Clear()
|
||
|
{
|
||
|
if(wear != null)
|
||
|
{
|
||
|
wear.Clear();
|
||
|
}
|
||
|
if(list != null)
|
||
|
{
|
||
|
list.Clear();
|
||
|
}
|
||
|
}
|
||
|
public title wear;
|
||
|
public List<title> list = new List<title>();
|
||
|
}
|
||
|
public partial class ReqActiveTitle : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
||
|
{
|
||
|
|
||
|
public const uint MsgID = 136201;
|
||
|
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 ResActiveTitleResult : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
||
|
{
|
||
|
public void Excute()
|
||
|
{
|
||
|
HandleMsgResult.getInstance().GS2U_ResActiveTitleResult(this);
|
||
|
}
|
||
|
|
||
|
public const uint MsgID = 136102;
|
||
|
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(info == null)
|
||
|
{
|
||
|
info = new title();
|
||
|
}
|
||
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
||
|
info.ReadMessage(ref readPos, totalCount);
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
public void Clear()
|
||
|
{
|
||
|
if(info != null)
|
||
|
{
|
||
|
info.Clear();
|
||
|
}
|
||
|
}
|
||
|
public title info;
|
||
|
}
|
||
|
public partial class ReqWearTitle : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
||
|
{
|
||
|
|
||
|
public const uint MsgID = 136202;
|
||
|
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 ResWearTitle : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
||
|
{
|
||
|
public void Excute()
|
||
|
{
|
||
|
HandleMsgResult.getInstance().GS2U_ResWearTitle(this);
|
||
|
}
|
||
|
|
||
|
public const uint MsgID = 136103;
|
||
|
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(info == null)
|
||
|
{
|
||
|
info = new title();
|
||
|
}
|
||
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
||
|
info.ReadMessage(ref readPos, totalCount);
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
public void Clear()
|
||
|
{
|
||
|
if(info != null)
|
||
|
{
|
||
|
info.Clear();
|
||
|
}
|
||
|
}
|
||
|
public title info;
|
||
|
}
|
||
|
public partial class ReqDownTitle : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
||
|
{
|
||
|
|
||
|
public const uint MsgID = 136203;
|
||
|
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 ResDownTitle : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
||
|
{
|
||
|
public void Excute()
|
||
|
{
|
||
|
HandleMsgResult.getInstance().GS2U_ResDownTitle(this);
|
||
|
}
|
||
|
|
||
|
public const uint MsgID = 136104;
|
||
|
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 ResBroadWearTitle : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
||
|
{
|
||
|
public void Excute()
|
||
|
{
|
||
|
HandleMsgResult.getInstance().GS2U_ResBroadWearTitle(this);
|
||
|
}
|
||
|
|
||
|
public const uint MsgID = 136105;
|
||
|
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:
|
||
|
id = ProtoBufUtils.ReadInt32(ref readPos);
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
public void Clear()
|
||
|
{
|
||
|
roleId = 0;
|
||
|
id = 0;
|
||
|
}
|
||
|
public ulong roleId;
|
||
|
public int id;
|
||
|
}
|
||
|
}
|
||
|
|