ProxyBackendResolver - SocketSVC Docs
SocketSVC Docs

ProxyBackendResolver

Chooses which backend voice listener a connecting player is relayed to, overriding the servers: map in the relay's own config.yml.

這一頁還沒有翻譯,以下顯示英文原文。

Generated from source

Interface com.socketsvc.proxy.api.ProxyBackendResolver — generated from ProxyBackendResolver.java. Edit the Javadoc in the Java source, then run pnpm gen:api.

package com.socketsvc.proxy.api;

public interface ProxyBackendResolver { ... }

Chooses which backend voice listener a connecting player is relayed to, overriding the servers: map in the relay's own config.yml.

Registered resolvers are consulted in registration order, before the configured map. The first one to return a present value wins; returning Optional#empty() passes the decision on, and if every resolver passes, the relay falls back to its configured map exactly as it does with no addon installed. A resolver that throws is logged and treated as empty, so a broken addon degrades to default routing rather than breaking voice for the network.

Called on the relay's own per-connection thread, once per incoming connection, before any bytes are forwarded. Keep it fast and non-blocking: a slow resolver delays that player's voice connection. It must be safe to call from multiple threads at once.

Methods

resolve

Optional<InetSocketAddress> resolve(UUID playerId, Optional<String> serverName)
ParameterDescription
playerIdthe connecting player as the client claims; unverified until the backend checks its token, so do not route on it to anything that trusts it
serverNamethe backend the proxy believes the player is on, or empty when the proxy itself could not resolve one (a race right after a server switch, or a player who is not currently connected). Returning a present value here is the only way to relay such a connection instead of rejecting it.

Returns: the backend voice address to use, or empty to defer to the next resolver / the configured servers: map

本頁內容

以 Markdown 檢視

詢問 AI 這一頁的內容