mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-21 09:11:20 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
61 lines
1.5 KiB
C#
Executable file
61 lines
1.5 KiB
C#
Executable file
using FSO.Common.Serialization;
|
|
using Mina.Core.Buffer;
|
|
using System;
|
|
|
|
namespace FSO.Server.Protocol.Voltron.Model
|
|
{
|
|
/// <summary>
|
|
/// DBRequestWrapperPDU
|
|
/// </summary>
|
|
public class RPCRequest
|
|
{
|
|
public object[] Parameters { get; set; }
|
|
|
|
|
|
public RPCRequest(IoBuffer buffer)
|
|
{
|
|
var bodyType = buffer.GetUInt32();
|
|
|
|
switch (bodyType)
|
|
{
|
|
case 0x125194E5:
|
|
ParseFormat1(buffer);
|
|
break;
|
|
default:
|
|
throw new Exception("Unknown RPC request type");
|
|
}
|
|
}
|
|
|
|
private void ParseFormat1(IoBuffer buffer)
|
|
{
|
|
var unknown = buffer.GetUInt32();
|
|
var sendingAvatarId = buffer.GetUInt32();
|
|
var flags = (byte)buffer.Get();
|
|
var messageId = buffer.GetUInt32();
|
|
|
|
if ((((flags) >> 1) & 0x01) == 0x01)
|
|
{
|
|
var unknown2 = buffer.GetUInt32();
|
|
}
|
|
|
|
if ((((flags) >> 2) & 0x01) == 0x01)
|
|
{
|
|
var parameter = new byte[4];
|
|
buffer.Get(parameter, 0, 4);
|
|
}
|
|
|
|
if ((((flags) >> 3) & 0x01) == 0x01)
|
|
{
|
|
var unknown3 = buffer.GetUInt32();
|
|
}
|
|
|
|
if ((((flags) >> 5) & 0x01) == 0x01)
|
|
{
|
|
var requestResponseID = buffer.GetUInt32();
|
|
|
|
/** Variable bytes **/
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|