Interface ProtocolDetectorService
public interface ProtocolDetectorService
-
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.fastutil.objects.Object2IntMap<String>
Returns an unmodifiable map of detected protocol versions.void
Probes all registered proxied servers for their protocol version.serverProtocolVersion
(String serverName) Returns the protocol version of the proxied server, or -1 if unknown.void
setProtocolVersion
(String serverName, int protocolVersion) Sets the stored protocol version of a proxied server.int
uncacheProtocolVersion
(String serverName) Uncaches and returns the previously stored protocol version of the proxied server.
-
Method Details
-
serverProtocolVersion
Returns the protocol version of the proxied server, or -1 if unknown.- Parameters:
serverName
- name of the proxied server- Returns:
- protocol version of the proxied server, or -1 if unknown
-
probeAllServers
void probeAllServers()Probes all registered proxied servers for their protocol version. This is executed automatically in the interval set in the ViaVersion config. -
setProtocolVersion
Sets the stored protocol version of a proxied server.- Parameters:
serverName
- name of the proxied serverprotocolVersion
- protocol version of the server
-
uncacheProtocolVersion
Uncaches and returns the previously stored protocol version of the proxied server. Returns -1 if none was stored.- Parameters:
serverName
- name of the proxied server- Returns:
- previously stored protocol version of the proxied server, or -1 if none was present
-
detectedProtocolVersions
it.unimi.dsi.fastutil.objects.Object2IntMap<String> detectedProtocolVersions()Returns an unmodifiable map of detected protocol versions.- Returns:
- unmodifiable map of detected protocol versions
-