mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-13 23:25:06 +00:00
15 lines
No EOL
432 B
C#
15 lines
No EOL
432 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace Shared.Packet.Packets;
|
|
|
|
[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);
|
|
}
|
|
} |