patched bungee issues

This commit is contained in:
LAX1DUDE 2022-05-15 00:20:56 -07:00
parent e7e763f9f8
commit 75c43e8a29
8 changed files with 17 additions and 2 deletions

View file

@ -38,6 +38,7 @@ public interface QueryConnection {
toSend.put("brand", EaglercraftBungee.brand);
toSend.put("vers", EaglercraftBungee.version);
toSend.put("cracked", EaglercraftBungee.cracked);
toSend.put("secure", false);
toSend.put("time", System.currentTimeMillis());
toSend.put("uuid", BungeeCord.getInstance().config.getUuid());
toSend.put("data", msg);
@ -51,6 +52,7 @@ public interface QueryConnection {
toSend.put("brand", EaglercraftBungee.brand);
toSend.put("vers", EaglercraftBungee.version);
toSend.put("cracked", EaglercraftBungee.cracked);
toSend.put("secure", false);
toSend.put("time", System.currentTimeMillis());
toSend.put("uuid", BungeeCord.getInstance().config.getUuid());
toSend.put("data", msg);

View file

@ -26,6 +26,7 @@ public class Configuration {
private boolean onlineMode;
private int playerLimit;
private String name;
private boolean showBanType;
public Configuration() {
this.timeout = 30000;
@ -51,6 +52,7 @@ public class Configuration {
this.onlineMode = false;
this.playerLimit = adapter.getInt("player_limit", this.playerLimit);
this.name = adapter.getString("server_name", EaglercraftBungee.name + " Server");
this.showBanType = adapter.getBoolean("display_ban_type_on_kick", false);
Preconditions.checkArgument(this.listeners != null && !this.listeners.isEmpty(), (Object) "No listeners defined.");
final Map<String, ServerInfo> newServers = adapter.getServers();
Preconditions.checkArgument(newServers != null && !newServers.isEmpty(), (Object) "No servers defined");
@ -102,4 +104,9 @@ public class Configuration {
public String getServerName() {
return name;
}
public boolean shouldShowBanType() {
return this.showBanType;
}
}

View file

@ -41,6 +41,7 @@ import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.eaglercraft.BanList;
import net.md_5.bungee.eaglercraft.WebSocketProxy;
import net.md_5.bungee.eaglercraft.BanList.BanCheck;
import net.md_5.bungee.eaglercraft.BanList.BanState;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.protocol.packet.PacketFEPing;
import net.md_5.bungee.Util;
@ -164,7 +165,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection {
default:
System.err.println("Player '" + un + "' is banned: " + bc.string);
}
if(bc.reason == BanState.USER_BANNED || ((BungeeCord)bungee).config.shouldShowBanType()) {
this.disconnect("" + ChatColor.RED + "You are banned.\n" + ChatColor.DARK_GRAY + "Reason: " + bc.string);
}else {
this.disconnect("" + ChatColor.RED + "You are banned.");
}
return;
}
final int limit = BungeeCord.getInstance().config.getPlayerLimit();
@ -266,7 +271,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection {
@Override
public InetSocketAddress getVirtualHost() {
return (this.handshake == null) ? null : new InetSocketAddress(this.handshake.getHost(), this.handshake.getPort());
return (this.handshake == null) ? null : new InetSocketAddress(this.handshake.getHost(), this.handshake.getPort() & 0xFFFF);
}
@Override

View file

@ -56,6 +56,7 @@ servers:
address: localhost:25569
restricted: false
server_name: EaglercraftBungee Server
display_ban_type_on_kick: false
permissions:
default:
- bungeecord.command.server