mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-05 14:10:32 -04:00
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:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
63
server/FSO.Server.Protocol/Electron/Packets/InstantMessage.cs
Executable file
63
server/FSO.Server.Protocol/Electron/Packets/InstantMessage.cs
Executable 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue