mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-23 01:42:24 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
47 lines
1.4 KiB
C#
Executable file
47 lines
1.4 KiB
C#
Executable file
using Mina.Core.Buffer;
|
|
using FSO.Common.Serialization;
|
|
|
|
namespace FSO.Server.Protocol.Electron.Packets
|
|
{
|
|
public class CreateASimResponse : AbstractElectronPacket
|
|
{
|
|
public CreateASimStatus Status { get; set; }
|
|
public CreateASimFailureReason Reason { get; set; } = CreateASimFailureReason.NONE;
|
|
public uint NewAvatarId { get; set; }
|
|
|
|
public override ElectronPacketType GetPacketType()
|
|
{
|
|
return ElectronPacketType.CreateASimResponse;
|
|
}
|
|
|
|
public override void Deserialize(IoBuffer input, ISerializationContext context)
|
|
{
|
|
Status = input.GetEnum<CreateASimStatus>();
|
|
Reason = input.GetEnum<CreateASimFailureReason>();
|
|
NewAvatarId = input.GetUInt32();
|
|
}
|
|
|
|
public override void Serialize(IoBuffer output, ISerializationContext context)
|
|
{
|
|
output.PutEnum<CreateASimStatus>(Status);
|
|
output.PutEnum<CreateASimFailureReason>(Reason);
|
|
output.PutUInt32(NewAvatarId);
|
|
}
|
|
}
|
|
|
|
public enum CreateASimStatus
|
|
{
|
|
SUCCESS = 0x01,
|
|
FAILED = 0x02
|
|
}
|
|
|
|
public enum CreateASimFailureReason
|
|
{
|
|
NONE = 0x00,
|
|
NAME_TAKEN = 0x01,
|
|
NAME_VALIDATION_ERROR = 0x02,
|
|
DESC_VALIDATION_ERROR = 0x03,
|
|
BODY_VALIDATION_ERROR = 0x04,
|
|
HEAD_VALIDATION_ERROR = 0x05
|
|
}
|
|
}
|