continuity/Server/Packets/RawPacket.cs

35 lines
1,001 B
C#
Raw Normal View History

2023-08-09 16:23:41 +02:00
using MassTransit;
2023-08-10 10:47:35 +02:00
namespace Server.Packets;
2023-08-09 16:23:41 +02:00
[MessageUrn("packets")]
2023-08-09 20:14:14 +02:00
public class RawPacket
2023-08-09 16:23:41 +02:00
{
public readonly OperationCode OperationCode;
public byte[] MessageBody;
2023-08-09 16:23:41 +02:00
public readonly TimeSpan ClientAliveTime;
public readonly byte UnknownValue;
public readonly byte UnknownValue2;
public readonly Guid SessionId;
public readonly AuthSession Session;
2023-08-09 20:14:14 +02:00
public RawPacket(OperationCode operationCode, byte[] messageBody, uint aliveTime, byte unknownValue2,
byte unknownValue, Guid sessionId, AuthSession session)
2023-08-09 16:23:41 +02:00
{
2023-08-11 11:31:30 +02:00
this.MessageBody = messageBody;
this.UnknownValue2 = unknownValue2;
this.UnknownValue = unknownValue;
this.SessionId = sessionId;
this.Session = session;
this.OperationCode = operationCode;
2023-08-10 08:51:40 +02:00
/*
* 20s = 5
* 15s = 4
* 10s = 3
* client alive time * 5s => uptime
*/
2023-08-11 11:31:30 +02:00
this.ClientAliveTime = TimeSpan.FromSeconds(5 * aliveTime);
2023-08-09 16:23:41 +02:00
}
2023-08-11 11:31:30 +02:00
}