SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Prevent arena start dos' (#280) from dosPrevention into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #280
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2021-12-21 21:06:55 +01:00
Commit b6be4a68ba

Datei anzeigen

@ -247,7 +247,6 @@ public class BauCommand extends BasicCommand {
}
private static void deleteWorld(ProxiedPlayer player, String world) {
Message.send("BAU_DELETE_DELETED", player);
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) {
@ -256,16 +255,20 @@ public class BauCommand extends BasicCommand {
}
}
SubserverSystem.deleteFolder(Node.local, world);
Message.send("BAU_DELETE_DELETED", player);
});
}
public static boolean stopBauserver(ProxiedPlayer p){
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
if(!subserver.hasStarted()){
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId()) && !subserver.hasStarted()) {
Message.send("BAU_START_ALREADY", p);
return false;
}
}
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
subserver.stop();
try {
Thread.sleep(200); // Wait until possible testarena-World has been deleted