Add methods to expose parts of the proxy internal config. This is depreceated as it is subject to breaking changes without warning.

This commit is contained in:
hcherndon 2013-12-02 15:17:19 +11:00 committed by md_5
parent af751dae5a
commit aad83d787f
4 changed files with 82 additions and 1 deletions

View File

@ -0,0 +1,71 @@
package net.md_5.bungee.api;
import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.config.ServerInfo;
import java.util.Collection;
import java.util.Map;
/**
* Core configuration adaptor for the proxy api.
*
* @deprecated This class is subject to rapid change between releases
*/
@Deprecated
public interface ProxyConfig
{
/**
* Time before users are disconnected due to no network activity.
*/
int getTimeout();
/**
* UUID used for metrics.
*/
String getUuid();
/**
* Set of all listeners.
*/
Collection<ListenerInfo> getListeners();
/**
* Set of all servers.
*/
Map<String, ServerInfo> getServers();
/**
* Does the server authenticate with mojang
*/
boolean isOnlineMode();
/**
* Returns the player max.
*/
int getPlayerLimit();
/**
* A collection of disabled commands.
*/
Collection<String> getDisabledCommands();
/**
* The connection throttle delay.
*/
@Deprecated
int getThrottle();
/**
* Whether the proxy will parse IPs with spigot or not
*/
@Deprecated
boolean isIpFoward();
/**
* The path for the Favicon (I.e. server_icon.png) Should be no more or no
* less than a 64 by 64 Pixel PNG picture.
*/
@Deprecated
String getFavicon();
}

View File

@ -247,4 +247,12 @@ public abstract class ProxyServer
* @return the set of disabled commands
*/
public abstract Collection<String> getDisabledCommands();
/**
* Gets BungeeCord's core config.
*
* @return the config.
*/
public abstract ProxyConfig getConfig();
}

View File

@ -76,6 +76,7 @@ public class BungeeCord extends ProxyServer
/**
* Configuration.
*/
@Getter
public final Configuration config = new Configuration();
/**
* Localization bundle.

View File

@ -12,6 +12,7 @@ import java.util.Map;
import java.util.UUID;
import java.util.logging.Level;
import lombok.Getter;
import net.md_5.bungee.api.ProxyConfig;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ConfigurationAdapter;
import net.md_5.bungee.api.config.ListenerInfo;
@ -23,7 +24,7 @@ import net.md_5.bungee.util.CaseInsensitiveSet;
* Core configuration for the proxy.
*/
@Getter
public class Configuration
public class Configuration implements ProxyConfig
{
/**