93 lines
2.2 KiB
C#
93 lines
2.2 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace FinalFactory.Rendezvous.Contracts;
|
|
|
|
public sealed class CreateJoinAttemptRequest
|
|
{
|
|
[JsonRequired]
|
|
public int ContractVersion { get; set; } = ContractLimits.ContractVersion;
|
|
|
|
[JsonRequired]
|
|
public string IdempotencyKey { get; set; } = string.Empty;
|
|
|
|
[JsonRequired]
|
|
public GameId GameId { get; set; }
|
|
|
|
[JsonRequired]
|
|
public EnvironmentId EnvironmentId { get; set; }
|
|
|
|
[JsonRequired]
|
|
public SessionListingId ListingId { get; set; }
|
|
|
|
[JsonRequired]
|
|
public uint ProtocolVersion { get; set; }
|
|
}
|
|
|
|
public sealed class CreateJoinAttemptResponse
|
|
{
|
|
[JsonRequired]
|
|
public int ContractVersion { get; set; } = ContractLimits.ContractVersion;
|
|
|
|
[JsonRequired]
|
|
public JoinAttemptId AttemptId { get; set; }
|
|
|
|
[JsonRequired]
|
|
public MediationHandle MediationHandle { get; set; }
|
|
|
|
[JsonRequired]
|
|
public string ClientPunchCapability { get; set; } = string.Empty;
|
|
|
|
[JsonRequired]
|
|
public DateTimeOffset ExpiresAt { get; set; }
|
|
public NetworkEndpoint? DedicatedFallback { get; set; }
|
|
}
|
|
|
|
public sealed class HostJoinAttempt
|
|
{
|
|
[JsonRequired]
|
|
public JoinAttemptId AttemptId { get; set; }
|
|
|
|
[JsonRequired]
|
|
public MediationHandle MediationHandle { get; set; }
|
|
|
|
[JsonRequired]
|
|
public string HostPunchCapability { get; set; } = string.Empty;
|
|
|
|
[JsonRequired]
|
|
public DateTimeOffset ExpiresAt { get; set; }
|
|
}
|
|
|
|
public sealed class BrowseHostJoinAttemptsResponse
|
|
{
|
|
[JsonRequired]
|
|
public int ContractVersion { get; set; } = ContractLimits.ContractVersion;
|
|
|
|
[JsonRequired]
|
|
public List<HostJoinAttempt> Items { get; set; } = [];
|
|
|
|
public string? NextCursor { get; set; }
|
|
}
|
|
|
|
public sealed class ReportConnectionOutcomeRequest
|
|
{
|
|
[JsonRequired]
|
|
public int ContractVersion { get; set; } = ContractLimits.ContractVersion;
|
|
|
|
[JsonRequired]
|
|
public ConnectionOutcomeKind Outcome { get; set; }
|
|
|
|
[JsonRequired]
|
|
public int ElapsedMilliseconds { get; set; }
|
|
|
|
public string? DiagnosticCode { get; set; }
|
|
}
|
|
|
|
public sealed class ReportConnectionOutcomeResponse
|
|
{
|
|
[JsonRequired]
|
|
public int ContractVersion { get; set; } = ContractLimits.ContractVersion;
|
|
|
|
[JsonRequired]
|
|
public bool Accepted { get; set; }
|
|
}
|