mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-23 09:52:23 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
36 lines
1.1 KiB
C#
Executable file
36 lines
1.1 KiB
C#
Executable file
using System;
|
|
using Mina.Core.Buffer;
|
|
using FSO.Common.Serialization;
|
|
using FSO.Server.Protocol.Gluon.Packets;
|
|
|
|
namespace FSO.Server.Protocol.Gluon
|
|
{
|
|
public abstract class AbstractGluonPacket : IGluonPacket
|
|
{
|
|
public static IoBuffer Allocate(int size)
|
|
{
|
|
IoBuffer buffer = IoBuffer.Allocate(size);
|
|
buffer.Order = ByteOrder.BigEndian;
|
|
return buffer;
|
|
}
|
|
|
|
public abstract GluonPacketType GetPacketType();
|
|
public abstract void Deserialize(IoBuffer input, ISerializationContext context);
|
|
public abstract void Serialize(IoBuffer output, ISerializationContext context);
|
|
}
|
|
|
|
public abstract class AbstractGluonCallPacket : AbstractGluonPacket, IGluonCall
|
|
{
|
|
public Guid CallId { get; set; }
|
|
|
|
public override void Serialize(IoBuffer output, ISerializationContext context)
|
|
{
|
|
output.PutPascalString(CallId.ToString());
|
|
}
|
|
|
|
public override void Deserialize(IoBuffer input, ISerializationContext context)
|
|
{
|
|
CallId = Guid.Parse(input.GetPascalString());
|
|
}
|
|
}
|
|
}
|