Interface ProxyConfig
public interface ProxyConfig
Exposes certain proxy configuration information that plugins may use.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the proxy should tell client that proxy prevents chat reports, useful in NoChatReports mod. (1.19+).Get the order of servers that players will be connected to.Get a Map of all servers registered invelocity.toml.intGet the rate limit for how fast a player can execute commands.intGet the level of compression that packets will be compressed to.intGet the minimum compression threshold for packets.intGet how long this proxy will wait for a connection to be established before timing it out.Get the proxy favicon shown in the tablist.Get forced servers mapped to a given virtual host.intGet the kick limit for commands that are rate limited.intGet the kick limit for tab completes that are rate limited.intGet the limit for how long a player must wait to log back in.getMotd()Get the MOTD component shown in the tab list.Get the MOTD hover legacy component shown in the tab list.Get the map name reported to GameSpy 4 query services.intGet the port GameSpy 4 queries are accepted on.intGet how long this proxy will wait until performing a read timeout.Deprecated, for removal: This API element is subject to removal in a future version.intGet the maximum players shown in the tab list.intGet the rate limit for how fast a player can tab complete.booleanGet whether this proxy displays that it supports Forge/FML.booleanWhether to use the forced hosts list as the fallback servers, instead of servers-to-try (getAttemptConnectionOrder), if a forced host is configured for the virtual host a player is connected to.booleanGet whether we should forward commands to the backend if the player is rate limited.default booleanGet whether the proxy should kick players who are command rate-limited.default booleanGet whether the proxy should kick players who are tab complete rate limited.booleanGet whether the proxy is online mode.booleanWhether the proxy accepts GameSpy 4 queries.booleanIf client's ISP/AS sent from this proxy is different from the one from Mojang's authentication server, the player is kicked.booleanWhether GameSpy 4 queries should show plugins installed on Velocity by default.
-
Method Details
-
isQueryEnabled
boolean isQueryEnabled()Whether the proxy accepts GameSpy 4 queries.- Returns:
- queries enabled
-
getQueryPort
int getQueryPort()Get the port GameSpy 4 queries are accepted on.- Returns:
- the query port
-
getQueryMap
String getQueryMap()Get the map name reported to GameSpy 4 query services.- Returns:
- the map name
-
shouldQueryShowPlugins
boolean shouldQueryShowPlugins()Whether GameSpy 4 queries should show plugins installed on Velocity by default.- Returns:
- show plugins in query
-
getMotd
Component getMotd()Get the MOTD component shown in the tab list.- Returns:
- the motd component
-
getMotdHover
Get the MOTD hover legacy component shown in the tab list.- Returns:
- the motd legacy component
-
getShowMaxPlayers
int getShowMaxPlayers()Get the maximum players shown in the tab list.- Returns:
- max players
-
isOnlineMode
boolean isOnlineMode()Get whether the proxy is online mode. This determines if players are authenticated with Mojang's Authentication Servers.- Returns:
- online mode enabled
-
doesPreventChatReports
boolean doesPreventChatReports()Whether the proxy should tell client that proxy prevents chat reports, useful in NoChatReports mod. (1.19+).- Returns:
- does prevents chat reports
-
shouldPreventClientProxyConnections
boolean shouldPreventClientProxyConnections()If client's ISP/AS sent from this proxy is different from the one from Mojang's authentication server, the player is kicked. This disallows some VPN and proxy connections but is a weak form of protection.- Returns:
- whether to prevent client proxy connections by checking the IP with Mojang servers
-
getServers
Deprecated, for removal: This API element is subject to removal in a future version.usegetBackendServers()instead.Get a Map of all servers registered invelocity.toml. This method does not return all the servers currently in memory, although in most cases it does. For a view of all registered servers, seeProxyServer.getAllServers().- Returns:
- registered servers map
-
getBackendServers
Map<String,BackendServerConfig> getBackendServers()Get a Map of all servers registered invelocity.toml. This method does not return all the servers currently in memory, although in most cases it does. For a view of all registered servers, seeProxyServer.getAllServers().- Returns:
- registered servers map with, instead of the only address, the Backend Server Object for each of them which contains the address of the server and its info forwarding mode.
- Since:
- 3.4.0
- See Also:
-
getAttemptConnectionOrder
Get the order of servers that players will be connected to.- Returns:
- connection order list
-
getForcedHosts
Get forced servers mapped to a given virtual host.- Returns:
- mapped list of server names
-
isForcedHostAsFallback
boolean isForcedHostAsFallback()Whether to use the forced hosts list as the fallback servers, instead of servers-to-try (getAttemptConnectionOrder), if a forced host is configured for the virtual host a player is connected to.- Returns:
- true if
getForcedHosts().get(virtualHost)should be used instead ofgetAttemptConnectionOrder.
-
getCompressionThreshold
int getCompressionThreshold()Get the minimum compression threshold for packets.- Returns:
- the compression threshold
-
getCompressionLevel
int getCompressionLevel()Get the level of compression that packets will be compressed to.- Returns:
- the compression level
-
getLoginRatelimit
int getLoginRatelimit()Get the limit for how long a player must wait to log back in.- Returns:
- the login rate limit (in milliseconds)
-
getFavicon
Get the proxy favicon shown in the tablist.- Returns:
- optional favicon
-
isAnnounceForge
boolean isAnnounceForge()Get whether this proxy displays that it supports Forge/FML.- Returns:
- forge announce enabled
-
getConnectTimeout
int getConnectTimeout()Get how long this proxy will wait for a connection to be established before timing it out.- Returns:
- connection timeout (in milliseconds)
-
getReadTimeout
int getReadTimeout()Get how long this proxy will wait until performing a read timeout.- Returns:
- read timeout (in milliseconds)
-
getCommandRatelimit
int getCommandRatelimit()Get the rate limit for how fast a player can execute commands.- Returns:
- the command rate limit (in milliseconds)
-
isForwardCommandsIfRateLimited
boolean isForwardCommandsIfRateLimited()Get whether we should forward commands to the backend if the player is rate limited.- Returns:
- whether to forward commands if rate-limited
-
getKickAfterRateLimitedCommands
int getKickAfterRateLimitedCommands()Get the kick limit for commands that are rate limited. If this limit is 0 or less, the player will not be kicked.- Returns:
- the rate-limited command rate limit
-
isKickOnCommandRateLimit
default boolean isKickOnCommandRateLimit()Get whether the proxy should kick players who are command rate-limited.- Returns:
- whether to kick players who are rate limited
-
getTabCompleteRatelimit
int getTabCompleteRatelimit()Get the rate limit for how fast a player can tab complete.- Returns:
- the tab complete rate limit (in milliseconds)
-
getKickAfterRateLimitedTabCompletes
int getKickAfterRateLimitedTabCompletes()Get the kick limit for tab completes that are rate limited. If this limit is 0 or less, the player will not be kicked.- Returns:
- the rate-limited command rate limit
-
isKickOnTabCompleteRateLimit
default boolean isKickOnTabCompleteRateLimit()Get whether the proxy should kick players who are tab complete rate limited.- Returns:
- whether to kick players who are rate limited
-
getBackendServers()instead.