34 lines
910 B
C#
34 lines
910 B
C#
#nullable enable
|
|
|
|
using System;
|
|
|
|
namespace ShrinkNetwork
|
|
{
|
|
public static class ShrinkNetworkProtocol
|
|
{
|
|
public const int CurrentProtocolVersion = 2;
|
|
public const int CurrentSchemaVersion = 1;
|
|
}
|
|
|
|
public enum ShrinkNetworkPacketKind
|
|
{
|
|
Message = 0,
|
|
Request = 1,
|
|
Response = 2
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class ShrinkNetworkPacket
|
|
{
|
|
public int ProtocolVersion = ShrinkNetworkProtocol.CurrentProtocolVersion;
|
|
public int SchemaVersion = ShrinkNetworkProtocol.CurrentSchemaVersion;
|
|
public int Opcode;
|
|
public ShrinkRequestToken RequestToken;
|
|
public string SessionToken = string.Empty;
|
|
public long SessionTokenExpiresAtUnixTimeSeconds;
|
|
public string? Route;
|
|
public ShrinkNetworkPacketKind Kind;
|
|
public ReadOnlyMemory<byte> Payload = ReadOnlyMemory<byte>.Empty;
|
|
}
|
|
}
|