Removed NioTSO client and server

- NioTSO client isn't needed because we're using RayLib
- Added FreeSO's API server to handle most backend operations
This commit is contained in:
Tony Bark 2024-05-01 02:55:43 -04:00
parent f12ba1502b
commit 22191ce648
591 changed files with 53264 additions and 3362 deletions

View file

@ -0,0 +1,63 @@
using FSO.Common.Serialization;
using Mina.Core.Buffer;
using FSO.Common.Enum;
namespace FSO.Server.Protocol.Electron.Packets
{
public class InstantMessage : AbstractElectronPacket
{
public UserReferenceType FromType;
public uint From;
public uint To;
public InstantMessageType Type;
public string Message;
public string AckID;
public InstantMessageFailureReason Reason = InstantMessageFailureReason.NONE;
public uint Color;
public override void Deserialize(IoBuffer input, ISerializationContext context)
{
FromType = input.GetEnum<UserReferenceType>();
From = input.GetUInt32();
To = input.GetUInt32();
Type = input.GetEnum<InstantMessageType>();
Message = input.GetPascalVLCString();
AckID = input.GetPascalVLCString();
Reason = input.GetEnum<InstantMessageFailureReason>();
Color = input.GetUInt32();
}
public override ElectronPacketType GetPacketType()
{
return ElectronPacketType.InstantMessage;
}
public override void Serialize(IoBuffer output, ISerializationContext context)
{
output.PutEnum(FromType);
output.PutUInt32(From);
output.PutUInt32(To);
output.PutEnum(Type);
output.PutPascalVLCString(Message);
output.PutPascalVLCString(AckID);
output.PutEnum(Reason);
output.PutUInt32(Color);
}
}
public enum InstantMessageType
{
MESSAGE,
SUCCESS_ACK,
FAILURE_ACK
}
public enum InstantMessageFailureReason
{
NONE,
THEY_ARE_OFFLINE,
THEY_ARE_IGNORING_YOU,
YOU_ARE_IGNORING_THEM,
MESSAGE_QUEUE_FULL
}
}