2022-02-08 16:15:31 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2022-02-10 01:44:50 +00:00
|
|
|
|
namespace Shared.Packet.Packets;
|
2022-02-08 16:15:31 +00:00
|
|
|
|
|
2022-02-08 16:22:09 +00:00
|
|
|
|
[Packet(PacketType.Capture)]
|
|
|
|
|
public struct CapturePacket : IPacket {
|
2022-02-08 16:15:31 +00:00
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.CostumeNameSize)]
|
|
|
|
|
public string ModelName;
|
2022-02-10 01:44:50 +00:00
|
|
|
|
|
2022-03-13 11:14:01 +00:00
|
|
|
|
public short Size => Constants.CostumeNameSize;
|
2022-02-08 16:15:31 +00:00
|
|
|
|
public void Serialize(Span<byte> data) {
|
|
|
|
|
Encoding.UTF8.GetBytes(ModelName).CopyTo(data[..Constants.CostumeNameSize]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Deserialize(Span<byte> data) {
|
|
|
|
|
ModelName = Encoding.UTF8.GetString(data[..Constants.CostumeNameSize]).TrimNullTerm();
|
|
|
|
|
}
|
2022-03-11 05:59:02 +00:00
|
|
|
|
|
2022-02-08 16:15:31 +00:00
|
|
|
|
}
|