0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-18 17:25:14 +00:00
SmoOnlineServer/Shared/Packet/Packets/CapturePacket.cs

19 lines
541 B
C#
Raw Normal View History

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