2023-11-21 20:37:50 +00:00
|
|
|
// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License.
|
2023-11-20 18:58:30 +00:00
|
|
|
|
2023-11-19 16:07:28 +00:00
|
|
|
using MassTransit;
|
2023-10-27 17:47:17 +00:00
|
|
|
using Wonderking.Packets;
|
|
|
|
|
2024-01-29 07:39:18 +00:00
|
|
|
namespace Continuity.AuthServer.Packets;
|
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-11-25 17:19:27 +00:00
|
|
|
public RawPacket(OperationCode operationCode, Span<byte> messageBody, uint aliveTime, byte unknownValue2,
|
2023-08-09 20:04:10 +00:00
|
|
|
byte unknownValue, Guid sessionId, AuthSession session)
|
2023-08-09 14:23:41 +00:00
|
|
|
{
|
2023-11-25 17:19:27 +00:00
|
|
|
MessageBody = messageBody.ToArray();
|
2023-11-19 16:07:28 +00:00
|
|
|
UnknownValue2 = unknownValue2;
|
|
|
|
UnknownValue = unknownValue;
|
|
|
|
SessionId = sessionId;
|
|
|
|
Session = session;
|
|
|
|
OperationCode = operationCode;
|
2023-08-10 06:51:40 +00:00
|
|
|
/*
|
|
|
|
* 20s = 5
|
|
|
|
* 15s = 4
|
|
|
|
* 10s = 3
|
|
|
|
* client alive time * 5s => uptime
|
|
|
|
*/
|
2023-11-19 16:07:28 +00:00
|
|
|
ClientAliveTime = TimeSpan.FromSeconds(5 * aliveTime);
|
2023-08-09 14:23:41 +00:00
|
|
|
}
|
2023-08-12 21:02:59 +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
|
|
|
}
|