Added ProxyConfig interface and implemented in VelocityConfiguration
This commit is contained in:
@@ -4,6 +4,7 @@ import com.velocitypowered.api.command.CommandManager;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.event.EventManager;
|
||||
import com.velocitypowered.api.plugin.PluginManager;
|
||||
import com.velocitypowered.api.proxy.config.ProxyConfig;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelRegistrar;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import com.velocitypowered.api.proxy.server.ServerInfo;
|
||||
@@ -124,4 +125,10 @@ public interface ProxyServer {
|
||||
* @return the address the proxy is bound to
|
||||
*/
|
||||
InetSocketAddress getBoundAddress();
|
||||
|
||||
/**
|
||||
* Gets the {@link ProxyConfig} instance.
|
||||
* @return the proxy config
|
||||
* */
|
||||
ProxyConfig getConfiguration();
|
||||
}
|
||||
|
@@ -0,0 +1,103 @@
|
||||
package com.velocitypowered.api.proxy.config;
|
||||
|
||||
import com.velocitypowered.api.util.Favicon;
|
||||
import net.kyori.text.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Provides an interface to a proxy configuration
|
||||
*/
|
||||
public interface ProxyConfig {
|
||||
/**
|
||||
* Whether GameSpy 4 queries are accepted by the proxy
|
||||
* @return queries enabled
|
||||
*/
|
||||
boolean isQueryEnabled();
|
||||
|
||||
/**
|
||||
* Get the port GameSpy 4 queries are accepted on
|
||||
* @return the query port
|
||||
*/
|
||||
int getQueryPort();
|
||||
|
||||
/**
|
||||
* Get the map name reported to GameSpy 4 query services
|
||||
* @return the map name
|
||||
*/
|
||||
String getQueryMap();
|
||||
|
||||
/**
|
||||
* Get the MOTD component shown in the tab list
|
||||
* @return the motd component
|
||||
*/
|
||||
Component getMotdComponent();
|
||||
|
||||
/**
|
||||
* Get the maximum players shown in the tab list
|
||||
* @return max players
|
||||
*/
|
||||
int getShowMaxPlayers();
|
||||
|
||||
/**
|
||||
* Get whether the proxy is online mode. This determines if players are authenticated with Mojang servers.
|
||||
* @return online mode enabled
|
||||
*/
|
||||
boolean isOnlineMode();
|
||||
|
||||
/**
|
||||
* Get a Map of all servers registered on this proxy
|
||||
* @return registered servers map
|
||||
*/
|
||||
Map<String, String> getServers();
|
||||
|
||||
/**
|
||||
* Get the order of servers that players will be connected to
|
||||
* @return connection order list
|
||||
*/
|
||||
List<String> getAttemptConnectionOrder();
|
||||
|
||||
/**
|
||||
* Get the minimum compression threshold for packets
|
||||
* @return the compression threshold
|
||||
*/
|
||||
int getCompressionThreshold();
|
||||
|
||||
/**
|
||||
* Get the level of compression that packets will be compressed to
|
||||
* @return the compression level
|
||||
*/
|
||||
int getCompressionLevel();
|
||||
|
||||
/**
|
||||
* Get the limit for how long a player must wait to log back in
|
||||
* @return the login rate limit (in milliseconds)
|
||||
*/
|
||||
int getLoginRatelimit();
|
||||
|
||||
/**
|
||||
* Get the proxy favicon shown in the tablist
|
||||
* @return optional favicon
|
||||
*/
|
||||
Optional<Favicon> getFavicon();
|
||||
|
||||
/**
|
||||
* Get whether this proxy displays that it supports Forge/FML
|
||||
* @return forge announce enabled
|
||||
*/
|
||||
boolean isAnnounceForge();
|
||||
|
||||
/**
|
||||
* Get how long this proxy will wait until performing a read timeout
|
||||
* @return connection timeout (in milliseconds)
|
||||
*/
|
||||
int getConnectTimeout();
|
||||
|
||||
/**
|
||||
* Get how long this proxy will wait until performing a read timeout
|
||||
* @return read timeout (in milliseconds)
|
||||
*/
|
||||
int getReadTimeout();
|
||||
}
|
Reference in New Issue
Block a user