Interface ILinkService
Namespace: Void.Proxy.Api.Links
Assembly: Void.Proxy.Api.dll
Manages the lifecycle of
public interface ILinkServiceProperties
All
Gets all currently active links — links that have completed authentication and are actively forwarding traffic between a player and a backend server.
IReadOnlyList<ILink> All { get; }Property Value
Methods
ConnectAsync(IPlayer, IServer, CancellationToken)
Connects the specified player to the given backend server. If the target server is unreachable, the player is redirected back to their previous server. If the previous server is also unreachable, the player is kicked with an explanatory message.
ValueTask<ConnectionResult> ConnectAsync(IPlayer player, IServer server, CancellationToken cancellationToken = default)Parameters
player IPlayer
The player to connect.
server IServer
The target backend server.
cancellationToken CancellationToken
A token to cancel the operation.
Returns
ConnectPlayerAnywhereAsync(IPlayer, CancellationToken)
Connects the specified player to the first available backend server by firing a
ValueTask<ConnectionResult> ConnectPlayerAnywhereAsync(IPlayer player, CancellationToken cancellationToken = default)Parameters
player IPlayer
The player to connect.
cancellationToken CancellationToken
A token to cancel the operation.
Returns
ConnectPlayerAnywhereAsync(IPlayer, IEnumerable<IServer>, CancellationToken)
Connects the specified player to the first available backend server that is not in ignoredServers by firing a
ValueTask<ConnectionResult> ConnectPlayerAnywhereAsync(IPlayer player, IEnumerable<IServer> ignoredServers, CancellationToken cancellationToken = default)Parameters
player IPlayer
The player to connect.
ignoredServers IEnumerable<IServer>
Servers that must not be considered during this connection attempt.
cancellationToken CancellationToken
A token to cancel the operation.
Returns
HasLink(IPlayer)
Determines whether the specified player has an active link to a backend server.
bool HasLink(IPlayer player)Parameters
player IPlayer
The player to check.
Returns
true if the player has an active link; otherwise, false.
TryGetLink(IPlayer, out ILink?)
Attempts to retrieve the active link for the specified player. A link is considered active once authentication has completed and traffic forwarding has started.
bool TryGetLink(IPlayer player, out ILink? link)Parameters
player IPlayer
The player whose active link to look up.
link ILink?
When this method returns true, contains the player’s active link; otherwise, null.
Returns
true if an active link was found; otherwise, false.
TryGetWeakLink(IPlayer, out ILink?)
Attempts to retrieve a link for the specified player that is currently in the authentication phase and has not yet been promoted to an active link. A weak link is created at the start of the connection attempt and exists until authentication either succeeds — at which point it also becomes an active link — or fails.
bool TryGetWeakLink(IPlayer player, out ILink? link)Parameters
player IPlayer
The player whose pending link to look up.
link ILink?
When this method returns true, contains the player’s pending link; otherwise, null.