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:
CraftBukkit/Spigot
2014-04-12 21:23:58 +10:00
parent 496995ccaa
commit 3d4c222263
11 changed files with 206 additions and 56 deletions

View File

@@ -10,6 +10,15 @@
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraft.util.StringUtil;
@@ -62,7 +65,7 @@
return new String[i];
});
- if (server.usesAuthentication()) {
+ if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
server.getProfileRepository().findProfilesByNames(astring, callback);
} else {
String[] astring1 = astring;
@@ -85,7 +88,7 @@
try {
gameprofilebanlist.load();

View File

@@ -431,7 +431,7 @@
+ ServerPlayer entity = new ServerPlayer(this.server, this.server.getLevel(Level.OVERWORLD), gameprofile, ClientInformation.createDefault());
+ entity.transferCookieConnection = loginlistener;
+ Player player = entity.getBukkitEntity();
+ PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress());
+ PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress());
+
+ if (this.bans.isBanned(gameprofile)) {
+ UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile);