528 lines
18 KiB
C#
528 lines
18 KiB
C#
using System.Collections.Generic;
|
|
using Thousandto.Plugins.Common;
|
|
using Thousandto.Code.Logic.Network;
|
|
|
|
namespace MSG_Mail
|
|
{
|
|
public partial class paramStruct : 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 :
|
|
mark = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
case 2 :
|
|
paramsValue = 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,mark);
|
|
ProtoBufUtils.WriteString(2,paramsValue);
|
|
ProtoBufUtils.SetVEndIndex(subItemInfoId);
|
|
return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
|
|
}
|
|
public void Clear()
|
|
{
|
|
mark = 0;
|
|
paramsValue = null;
|
|
}
|
|
public int mark;
|
|
public string paramsValue;
|
|
}
|
|
public partial class MailSummaryInfo : 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 :
|
|
mailId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2 :
|
|
receiveTime = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 3 :
|
|
mailTitle = ProtoBufUtils.ReadString(ref readPos);
|
|
break;
|
|
case 4 :
|
|
isRead = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
case 5 :
|
|
hasAttachment = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
case 6 :
|
|
isAttachReceived = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
case 7 :
|
|
readTable = 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,mailId);
|
|
ProtoBufUtils.WriteUint64(2,receiveTime);
|
|
ProtoBufUtils.WriteString(3,mailTitle);
|
|
ProtoBufUtils.WriteBoolean(4,isRead);
|
|
ProtoBufUtils.WriteBoolean(5,hasAttachment);
|
|
ProtoBufUtils.WriteBoolean(6,isAttachReceived);
|
|
ProtoBufUtils.WriteBoolean(7,readTable);
|
|
ProtoBufUtils.SetVEndIndex(subItemInfoId);
|
|
return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
|
|
}
|
|
public void Clear()
|
|
{
|
|
mailId = 0;
|
|
receiveTime = 0;
|
|
mailTitle = null;
|
|
isRead = false;
|
|
hasAttachment = false;
|
|
isAttachReceived = false;
|
|
readTable = false;
|
|
}
|
|
public ulong mailId;
|
|
public ulong receiveTime;
|
|
public string mailTitle;
|
|
public bool isRead;
|
|
public bool hasAttachment;
|
|
public bool isAttachReceived;
|
|
public bool readTable;
|
|
}
|
|
public partial class MailDetailInfo : 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 :
|
|
mailId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2 :
|
|
sender = ProtoBufUtils.ReadString(ref readPos);
|
|
break;
|
|
case 3 :
|
|
mailTitle = ProtoBufUtils.ReadString(ref readPos);
|
|
break;
|
|
case 4 :
|
|
mailContent = ProtoBufUtils.ReadString(ref readPos);
|
|
break;
|
|
case 5 :
|
|
hasAttachment = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
case 6 :
|
|
if(itemList == null)
|
|
{
|
|
itemList = new List<MSG_backpack.ItemInfo>();
|
|
}
|
|
itemList.Add(new MSG_backpack.ItemInfo());
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
itemList[itemList.Count - 1].ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
case 7 :
|
|
isAttachReceived = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
case 8 :
|
|
readTable = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
case 9 :
|
|
if(paramlists == null)
|
|
{
|
|
paramlists = new List<paramStruct>();
|
|
}
|
|
paramlists.Add(new paramStruct());
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
paramlists[paramlists.Count - 1].ReadMessage(ref readPos, totalCount);
|
|
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,mailId);
|
|
ProtoBufUtils.WriteString(2,sender);
|
|
ProtoBufUtils.WriteString(3,mailTitle);
|
|
ProtoBufUtils.WriteString(4,mailContent);
|
|
ProtoBufUtils.WriteBoolean(5,hasAttachment);
|
|
for (int i = 0; i < itemList.Count; i++)
|
|
{
|
|
if(itemList != null)
|
|
{
|
|
itemList[i].WriteMessage(6);
|
|
}
|
|
}
|
|
ProtoBufUtils.WriteBoolean(7,isAttachReceived);
|
|
ProtoBufUtils.WriteBoolean(8,readTable);
|
|
for (int i = 0; i < paramlists.Count; i++)
|
|
{
|
|
if(paramlists != null)
|
|
{
|
|
paramlists[i].WriteMessage(9);
|
|
}
|
|
}
|
|
ProtoBufUtils.SetVEndIndex(subItemInfoId);
|
|
return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
|
|
}
|
|
public void Clear()
|
|
{
|
|
mailId = 0;
|
|
sender = null;
|
|
mailTitle = null;
|
|
mailContent = null;
|
|
hasAttachment = false;
|
|
if(itemList != null)
|
|
{
|
|
itemList.Clear();
|
|
}
|
|
isAttachReceived = false;
|
|
readTable = false;
|
|
if(paramlists != null)
|
|
{
|
|
paramlists.Clear();
|
|
}
|
|
}
|
|
public ulong mailId;
|
|
public string sender;
|
|
public string mailTitle;
|
|
public string mailContent;
|
|
public bool hasAttachment;
|
|
public List<MSG_backpack.ItemInfo> itemList = new List<MSG_backpack.ItemInfo>();
|
|
public bool isAttachReceived;
|
|
public bool readTable;
|
|
public List<paramStruct> paramlists = new List<paramStruct>();
|
|
}
|
|
public partial class ReqReadMail : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 119201;
|
|
public void Excute(){}
|
|
public void Send()
|
|
{
|
|
lock (ProtoBufUtils.WriteLocker)
|
|
{
|
|
byte[] bytes = null;
|
|
ProtoBufUtils.InitWriteData();
|
|
ProtoBufUtils.WriteUint64(1,mailId);
|
|
bytes = ProtoBufUtils.GetData();
|
|
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
mailId = 0;
|
|
}
|
|
public ulong mailId;
|
|
}
|
|
public partial class ReqReceiveSingleMailAttach : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 119202;
|
|
public void Excute(){}
|
|
public void Send()
|
|
{
|
|
lock (ProtoBufUtils.WriteLocker)
|
|
{
|
|
byte[] bytes = null;
|
|
ProtoBufUtils.InitWriteData();
|
|
ProtoBufUtils.WriteUint64(1,mailId);
|
|
bytes = ProtoBufUtils.GetData();
|
|
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
mailId = 0;
|
|
}
|
|
public ulong mailId;
|
|
}
|
|
public partial class ReqOneClickReceiveMailAttach : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 119203;
|
|
public void Excute(){}
|
|
public void Send()
|
|
{
|
|
lock (ProtoBufUtils.WriteLocker)
|
|
{
|
|
byte[] bytes = null;
|
|
ProtoBufUtils.InitWriteData();
|
|
for (int i = 0; i < mailIdList.Count; i++)
|
|
{
|
|
ProtoBufUtils.WriteUint64(1,mailIdList[i]);
|
|
}
|
|
bytes = ProtoBufUtils.GetData();
|
|
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(mailIdList != null)
|
|
{
|
|
mailIdList.Clear();
|
|
}
|
|
}
|
|
public List<ulong> mailIdList = new List<ulong>();
|
|
}
|
|
public partial class ReqOneClickDeleteMail : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
|
|
{
|
|
|
|
public const uint MsgID = 119204;
|
|
public void Excute(){}
|
|
public void Send()
|
|
{
|
|
lock (ProtoBufUtils.WriteLocker)
|
|
{
|
|
byte[] bytes = null;
|
|
ProtoBufUtils.InitWriteData();
|
|
for (int i = 0; i < mailIdList.Count; i++)
|
|
{
|
|
ProtoBufUtils.WriteUint64(1,mailIdList[i]);
|
|
}
|
|
bytes = ProtoBufUtils.GetData();
|
|
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(mailIdList != null)
|
|
{
|
|
mailIdList.Clear();
|
|
}
|
|
}
|
|
public List<ulong> mailIdList = new List<ulong>();
|
|
}
|
|
public partial class ResReadMail : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResReadMail(this);
|
|
}
|
|
|
|
public const uint MsgID = 119101;
|
|
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(mailDetailInfo == null)
|
|
{
|
|
mailDetailInfo = new MailDetailInfo();
|
|
}
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
mailDetailInfo.ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(mailDetailInfo != null)
|
|
{
|
|
mailDetailInfo.Clear();
|
|
}
|
|
}
|
|
public MailDetailInfo mailDetailInfo;
|
|
}
|
|
public partial class ResReceiveSingleMailAttach : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResReceiveSingleMailAttach(this);
|
|
}
|
|
|
|
public const uint MsgID = 119102;
|
|
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:
|
|
mailId = ProtoBufUtils.ReadUint64(ref readPos);
|
|
break;
|
|
case 2:
|
|
isAttachReceived = ProtoBufUtils.ReadBoolean(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
mailId = 0;
|
|
isAttachReceived = false;
|
|
}
|
|
public ulong mailId;
|
|
public bool isAttachReceived;
|
|
}
|
|
public partial class ResMailInfoList : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResMailInfoList(this);
|
|
}
|
|
|
|
public const uint MsgID = 119103;
|
|
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(mailList == null)
|
|
{
|
|
mailList = new List<MailSummaryInfo>();
|
|
}
|
|
mailList.Add(new MailSummaryInfo());
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
mailList[mailList.Count - 1].ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
case 2:
|
|
remainMailNum = ProtoBufUtils.ReadInt32(ref readPos);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(mailList != null)
|
|
{
|
|
mailList.Clear();
|
|
}
|
|
remainMailNum = 0;
|
|
}
|
|
public List<MailSummaryInfo> mailList = new List<MailSummaryInfo>();
|
|
public int remainMailNum;
|
|
}
|
|
public partial class ResNewMail : ProtoBuf.IExtensible, ProtoBuf.IResMessage
|
|
{
|
|
public void Excute()
|
|
{
|
|
HandleMsgResult.getInstance().GS2U_ResNewMail(this);
|
|
}
|
|
|
|
public const uint MsgID = 119104;
|
|
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(newMail == null)
|
|
{
|
|
newMail = new MailSummaryInfo();
|
|
}
|
|
totalCount = ProtoBufUtils.ReadInt32(ref readPos);
|
|
newMail.ReadMessage(ref readPos, totalCount);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
if(newMail != null)
|
|
{
|
|
newMail.Clear();
|
|
}
|
|
}
|
|
public MailSummaryInfo newMail;
|
|
}
|
|
}
|
|
|