34 lines
889 B
C#
34 lines
889 B
C#
#nullable enable
|
|
|
|
using System;
|
|
|
|
namespace ShrinkNetwork
|
|
{
|
|
public static class ShrinkNetworkProtocol
|
|
{
|
|
public const int CurrentProtocolVersion = 1;
|
|
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 byte[] Payload = Array.Empty<byte>();
|
|
}
|
|
}
|