geforkt von SteamWar/BungeeCore
Convert everything from waterfall to plain bungee
Dieser Commit ist enthalten in:
Ursprung
27750d4e71
Commit
bad4efd520
@ -1 +1 @@
|
|||||||
Subproject commit 919c4d525ea39756b24bd961bb72d8d58bdd5bd4
|
Subproject commit 492894ca8d41ee0bde4dcb9d520db5f7478c50c7
|
@ -92,7 +92,7 @@ dependencies {
|
|||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
testAnnotationProcessor '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/PersistentBungeeCore.jar")
|
||||||
compileOnly files("${projectDir}/lib/BungeeTabListPlus.jar")
|
compileOnly files("${projectDir}/lib/BungeeTabListPlus.jar")
|
||||||
implementation("net.dv8tion:JDA:4.3.0_299") {
|
implementation("net.dv8tion:JDA:4.3.0_299") {
|
||||||
|
@ -31,6 +31,7 @@ import net.md_5.bungee.UserConnection;
|
|||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
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.ClickEvent;
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
@ -595,11 +596,24 @@ public class TeamCommand extends BasicCommand {
|
|||||||
ProxyServer.getInstance().getServers().put(info.getName(), info);
|
ProxyServer.getInstance().getServers().put(info.getName(), info);
|
||||||
return 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) -> {
|
((UserConnection) player).connect(serverInfo, (success, error) -> {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
Message.send("TEAM_OFFLINE", player);
|
Message.send("TEAM_OFFLINE", player);
|
||||||
}
|
}
|
||||||
}, false, ServerConnectEvent.Reason.PLUGIN, BungeeCord.getInstance().getConfig().getServerConnectTimeout(), false);
|
}, false, ServerConnectEvent.Reason.PLUGIN, BungeeCord.getInstance().getConfig().getServerConnectTimeout(), false);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
|
private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package de.steamwar.bungeecore.listeners;
|
package de.steamwar.bungeecore.listeners;
|
||||||
|
|
||||||
import io.github.waterfallmc.waterfall.utils.UUIDUtils;
|
|
||||||
import net.md_5.bungee.BungeeCord;
|
import net.md_5.bungee.BungeeCord;
|
||||||
import net.md_5.bungee.api.event.LoginEvent;
|
import net.md_5.bungee.api.event.LoginEvent;
|
||||||
import net.md_5.bungee.connection.InitialHandler;
|
import net.md_5.bungee.connection.InitialHandler;
|
||||||
import net.md_5.bungee.connection.LoginResult;
|
import net.md_5.bungee.connection.LoginResult;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
import net.md_5.bungee.protocol.Property;
|
||||||
import net.md_5.bungee.util.AddressUtil;
|
import net.md_5.bungee.util.AddressUtil;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -50,11 +50,12 @@ public class SubserverProtocolFixer extends BasicListener {
|
|||||||
public void loginEvent(LoginEvent e) {
|
public void loginEvent(LoginEvent e) {
|
||||||
InitialHandler initialHandler = ((InitialHandler) e.getConnection());
|
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();
|
LoginResult result = initialHandler.getLoginProfile();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
LoginResult.Property[] properties = result.getProperties();
|
Property[] properties = result.getProperties();
|
||||||
if (properties.length > 0) {
|
if (properties.length > 0) {
|
||||||
extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties);
|
extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties);
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public class TablistManager extends BasicListener {
|
|||||||
//Calculate server-player-map
|
//Calculate server-player-map
|
||||||
tablist = new TablistGroup(true, "");
|
tablist = new TablistGroup(true, "");
|
||||||
TablistGroup bau = new TablistGroup(false, "Bau");
|
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())
|
if(server.getPlayers().isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren