SteamWar/BungeeCore
Archiviert
13
2

Merge branch 'master' into Playtime_Command
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
zOnlyKroks 2021-12-24 11:17:29 +01:00
Commit 6c6ecfccb3
4 geänderte Dateien mit 43 neuen und 17 gelöschten Zeilen

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

Datei anzeigen

@ -51,7 +51,7 @@ public class ChatListener extends BasicListener {
public void onChatEvent(ChatEvent e){
if(e.getMessage().contains("jndi:ldap")) {
e.setCancelled(true);
SteamwarUser.get(((ProxiedPlayer) e.getSender()).getUniqueId()).punish(Punishment.PunishmentType.Ban, Timestamp.from(Instant.now()), "Versuchte Exploit-Ausnutzung", 0, true);
SteamwarUser.get(((ProxiedPlayer) e.getSender()).getUniqueId()).punish(Punishment.PunishmentType.Ban, Timestamp.from(Instant.ofEpochSecond(946674800)), "Versuchte Exploit-Ausnutzung", 0, true);
return;
}

Datei anzeigen

@ -103,7 +103,7 @@ public class TablistManager extends BasicListener {
if(bau.size() > 0)
tablist.addSubTablist(bau);
size = (int) Math.ceil(tablist.size() / 20.0);
size = (int) Math.ceil((tablist.size() - 1) / 20.0);
tablists.values().forEach(Tablist::refresh);
seconds++;
}
@ -197,10 +197,11 @@ public class TablistManager extends BasicListener {
@Override
public int slimSize(ProxiedPlayer viewer) {
int size = subTablists.stream().mapToInt(tPart -> viewer == null ? tPart.size() : tPart.slimSize(viewer)).sum();
if(withHeaders)
size += subTablists.size() * 2;
return subTablists.stream().mapToInt(tPart -> viewer == null ? tPart.size() : tPart.slimSize(viewer)).map(size -> {
size += withHeaders ? 1 : 0; // Space for header
size += withHeaders && size > 1 ? 1 : 0; // Space for footer
return size;
}).sum();
}
@Override
@ -210,13 +211,30 @@ public class TablistManager extends BasicListener {
@Override
public void print(Tablist viewer, boolean slim) {
subTablists.forEach(tPart -> {
if(withHeaders)
for (int i = 0; i < subTablists.size(); i++) {
TablistPart tPart = subTablists.get(i);
boolean withoutFooter = i == subTablists.size() - 1;
if (withHeaders) {
if (slim) {
int slimSize = tPart.slimSize(viewer.player);
int size = tPart.size();
if (size == slimSize) {
viewer.setSlot(gray, "§7§l" + tPart.name(), 1000);
} else if (slimSize == 0) {
viewer.setSlot(gray, "§7§l" + tPart.name() + " §8(§7" + size + "§8)", 1000);
withoutFooter = true;
} else {
viewer.setSlot(gray, "§7§l" + tPart.name() + " §8(§7+" + (size - slimSize) + "§8)", 1000);
}
} else {
viewer.setSlot(gray, "§7§l" + tPart.name(), 1000);
}
}
tPart.print(viewer, slim);
if(withHeaders)
if (withHeaders && !withoutFooter) {
viewer.setSlot(darkGray, "", 1000);
});
}
}
}
}

Datei anzeigen

@ -137,6 +137,11 @@ public class SteamwarUser {
return null;
}
user = SteamwarUser.get(uuid);
if (user != null) {
return user;
}
return SteamwarUser.createUserInDatabase(uuid, name);
}
@ -289,7 +294,7 @@ public class SteamwarUser {
player.disconnect(punishmentMessage(punishment, player));
for (BannedUserIPs banned : BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) {
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
if (isPunished(punishment) && banned.getTimestamp().before(time)) {
if (isPunished(punishment) && bannedUser.getPunishment(punishment).getEndTime().before(time)) {
bannedUser.punish(punishment, time, banReason, from, perma);
}
}