Archiviert
1
0

Convert everything from waterfall to plain bungee

Dieser Commit ist enthalten in:
yoyosource 2022-06-08 13:28:56 +02:00
Ursprung 27750d4e71
Commit bad4efd520
5 geänderte Dateien mit 21 neuen und 6 gelöschten Zeilen

@ -1 +1 @@
Subproject commit 919c4d525ea39756b24bd961bb72d8d58bdd5bd4
Subproject commit 492894ca8d41ee0bde4dcb9d520db5f7478c50c7

Datei anzeigen

@ -92,7 +92,7 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly files("${projectDir}/lib/BungeeCord.jar")
compileOnly files("${projectDir}/lib/BungeeCord-Neu.jar")
compileOnly files("${projectDir}/lib/PersistentBungeeCore.jar")
compileOnly files("${projectDir}/lib/BungeeTabListPlus.jar")
implementation("net.dv8tion:JDA:4.3.0_299") {

Datei anzeigen

@ -31,6 +31,7 @@ import net.md_5.bungee.UserConnection;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.ServerConnectRequest;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
@ -595,11 +596,24 @@ public class TeamCommand extends BasicCommand {
ProxyServer.getInstance().getServers().put(info.getName(), info);
return info;
});
player.connect(ServerConnectRequest.builder()
.target(serverInfo)
.connectTimeout(BungeeCord.getInstance().getConfig().getServerConnectTimeout())
.retry(false)
.reason(ServerConnectEvent.Reason.PLUGIN)
.callback((success, error) -> {
if (error != null) {
Message.send("TEAM_OFFLINE", player);
}
})
.build());
/*
((UserConnection) player).connect(serverInfo, (success, error) -> {
if (error != null) {
Message.send("TEAM_OFFLINE", player);
}
}, false, ServerConnectEvent.Reason.PLUGIN, BungeeCord.getInstance().getConfig().getServerConnectTimeout(), false);
*/
}
private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){

Datei anzeigen

@ -19,12 +19,12 @@
package de.steamwar.bungeecore.listeners;
import io.github.waterfallmc.waterfall.utils.UUIDUtils;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.event.LoginEvent;
import net.md_5.bungee.connection.InitialHandler;
import net.md_5.bungee.connection.LoginResult;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.protocol.Property;
import net.md_5.bungee.util.AddressUtil;
import java.lang.reflect.Field;
@ -50,11 +50,12 @@ public class SubserverProtocolFixer extends BasicListener {
public void loginEvent(LoginEvent e) {
InitialHandler initialHandler = ((InitialHandler) e.getConnection());
String extraData = "\00" + AddressUtil.sanitizeAddress(inetSocketAddress) + "\00" + UUIDUtils.undash(initialHandler.getUniqueId().toString());
String undashedUUID = initialHandler.getUniqueId().toString().replace("-", "");
String extraData = "\00" + AddressUtil.sanitizeAddress(inetSocketAddress) + "\00" + undashedUUID;
LoginResult result = initialHandler.getLoginProfile();
if (result != null) {
LoginResult.Property[] properties = result.getProperties();
Property[] properties = result.getProperties();
if (properties.length > 0) {
extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties);
}

Datei anzeigen

@ -88,7 +88,7 @@ public class TablistManager extends BasicListener {
//Calculate server-player-map
tablist = new TablistGroup(true, "");
TablistGroup bau = new TablistGroup(false, "Bau");
for (ServerInfo server : ProxyServer.getInstance().getServersCopy().values()){
for (ServerInfo server : new ArrayList<>(ProxyServer.getInstance().getServers().values())){
if(server.getPlayers().isEmpty())
continue;