mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-18 01:15:09 +00:00
534a6c9655
speedrun flag
19 lines
No EOL
541 B
C#
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();
|
|
}
|
|
|
|
} |