0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-21 18:55:17 +00:00
SmoOnlineServer/Shared/Packet/Packets/CapturePacket.cs
2022-04-03 22:29:34 -06:00

19 lines
No EOL
541 B
C#

using System.Runtime.InteropServices;
using System.Text;
namespace Shared.Packet.Packets;
[Packet(PacketType.Capture)]
public struct CapturePacket : IPacket {
public string ModelName;
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();
}
}