mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-12 01:02:26 -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
53
server/FSO.Server.Protocol/Voltron/Packets/DataServiceWrapperPDU.cs
Executable file
53
server/FSO.Server.Protocol/Voltron/Packets/DataServiceWrapperPDU.cs
Executable file
|
@ -0,0 +1,53 @@
|
|||
using Mina.Core.Buffer;
|
||||
using System.ComponentModel;
|
||||
using FSO.Common.Serialization;
|
||||
|
||||
namespace FSO.Server.Protocol.Voltron.Packets
|
||||
{
|
||||
public class DataServiceWrapperPDU : AbstractVoltronPacket
|
||||
{
|
||||
public uint SendingAvatarID { get; set; }
|
||||
public uint RequestTypeID { get; set; }
|
||||
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public object Body { get; set; }
|
||||
|
||||
public override VoltronPacketType GetPacketType()
|
||||
{
|
||||
return VoltronPacketType.DataServiceWrapperPDU;
|
||||
}
|
||||
|
||||
public override void Serialize(IoBuffer output, ISerializationContext context)
|
||||
{
|
||||
output.PutUInt32(SendingAvatarID);
|
||||
output.PutUInt32(RequestTypeID);
|
||||
|
||||
if(Body != null){
|
||||
var bodyBytes = context.ModelSerializer.SerializeBuffer(Body, context, true);
|
||||
output.PutUInt32((uint)bodyBytes.Remaining);
|
||||
output.Put(bodyBytes);
|
||||
}
|
||||
|
||||
//output.PutUInt32(RequestTypeID);
|
||||
//output.PutUInt32(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(IoBuffer input, ISerializationContext context)
|
||||
{
|
||||
this.SendingAvatarID = input.GetUInt32();
|
||||
this.RequestTypeID = input.GetUInt32();
|
||||
|
||||
var bodySize = input.GetUInt32();
|
||||
var bodyBytes = new byte[bodySize];
|
||||
input.Get(bodyBytes, 0, (int)bodySize);
|
||||
this.Body = bodyBytes;
|
||||
var bodyBuffer = IoBuffer.Wrap(bodyBytes);
|
||||
var bodyType = bodyBuffer.GetUInt32();
|
||||
|
||||
this.Body = context.ModelSerializer.Deserialize(bodyType, bodyBuffer, context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue