continuity/Server/Packets/RawPacket.cs

37 lines
1 KiB
C#
Raw Normal View History

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