0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-15 08:05:06 +00:00
SmoOnlineServer/Shared/Packet/Packets/ConnectPacket.cs

15 lines
418 B
C#
Raw Normal View History

using System.Runtime.InteropServices;
namespace Shared.Packet.Packets;
2021-11-29 04:04:34 +00:00
[Packet(PacketType.Connect)]
public struct ConnectPacket : IPacket {
public ConnectionTypes ConnectionType;
public void Serialize(Span<byte> data) {
MemoryMarshal.Write(data, ref ConnectionType);
}
public void Deserialize(Span<byte> data) {
ConnectionType = MemoryMarshal.Read<ConnectionTypes>(data);
}
2021-11-29 04:04:34 +00:00
}