BungeeCord Support
* Provides support for IP forwarding via BungeeCord. * Treats Bungee as Online Mode. By: md_5 <git@md-5.net>
This commit is contained in:
@@ -803,7 +803,13 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public long getConnectionThrottle() {
|
||||
return this.configuration.getInt("settings.connection-throttle");
|
||||
// Spigot Start - Automatically set connection throttle for bungee configurations
|
||||
if (org.spigotmc.SpigotConfig.bungee) {
|
||||
return -1;
|
||||
} else {
|
||||
return this.configuration.getInt("settings.connection-throttle");
|
||||
}
|
||||
// Spigot End
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1814,7 +1820,7 @@ public final class CraftServer implements Server {
|
||||
if (result == null) {
|
||||
GameProfile profile = null;
|
||||
// Only fetch an online UUID in online mode
|
||||
if (this.getOnlineMode()) {
|
||||
if (this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
||||
// This is potentially blocking :(
|
||||
profile = this.console.getProfileCache().get(name).orElse(null);
|
||||
}
|
||||
|
||||
@@ -2344,6 +2344,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private final Player.Spigot spigot = new Player.Spigot()
|
||||
{
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRawAddress()
|
||||
{
|
||||
return (InetSocketAddress) CraftPlayer.this.getHandle().connection.getRawAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void respawn()
|
||||
{
|
||||
|
||||
@@ -214,4 +214,14 @@ public class SpigotConfig
|
||||
SpigotConfig.commands.put( "restart", new RestartCommand( "restart" ) );
|
||||
WatchdogThread.doStart( SpigotConfig.timeoutTime, SpigotConfig.restartOnCrash );
|
||||
}
|
||||
|
||||
public static boolean bungee;
|
||||
private static void bungee() {
|
||||
if ( SpigotConfig.version < 4 )
|
||||
{
|
||||
SpigotConfig.set( "settings.bungeecord", false );
|
||||
System.out.println( "Outdated config, disabling BungeeCord support!" );
|
||||
}
|
||||
SpigotConfig.bungee = SpigotConfig.getBoolean( "settings.bungeecord", false );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user