Files
Main/Assets/Code/Logic/_NetMessage/Messages/RecycleEx.cs

137 lines
4.0 KiB
C#
Raw Normal View History

2025-01-25 04:38:09 +08:00
using System.Collections.Generic;
using Thousandto.Plugins.Common;
using Thousandto.Code.Logic.Network;
namespace MSG_Recycle
{
public partial class ReqRecycle : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
{
public const uint MsgID = 519201;
public void Excute(){}
public void Send()
{
lock (ProtoBufUtils.WriteLocker)
{
byte[] bytes = null;
ProtoBufUtils.InitWriteData();
for (int i = 0; i < itemId.Count; i++)
{
ProtoBufUtils.WriteUint64(1,itemId[i]);
}
bytes = ProtoBufUtils.GetData();
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
}
}
public void Clear()
{
if(itemId != null)
{
itemId.Clear();
}
}
public List<ulong> itemId = new List<ulong>();
}
public partial class ReqSetAuto : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
{
public const uint MsgID = 519202;
public void Excute(){}
public void Send()
{
lock (ProtoBufUtils.WriteLocker)
{
byte[] bytes = null;
ProtoBufUtils.InitWriteData();
ProtoBufUtils.WriteBoolean(1,isOpen);
bytes = ProtoBufUtils.GetData();
Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
}
}
public void Clear()
{
isOpen = false;
}
public bool isOpen;
}
public partial class ResRecycle : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResRecycle(this);
}
public const uint MsgID = 519101;
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:
num = ProtoBufUtils.ReadInt32(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
num = 0;
}
public int num;
}
public partial class ResSetAuto : ProtoBuf.IExtensible, ProtoBuf.IResMessage
{
public void Excute()
{
HandleMsgResult.getInstance().GS2U_ResSetAuto(this);
}
public const uint MsgID = 519102;
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:
isOpen = ProtoBufUtils.ReadBoolean(ref readPos);
break;
default:
break;
}
}
}
}
public void Clear()
{
isOpen = false;
}
public bool isOpen;
}
}