Merge branch 'master' into Playtime_Command
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Dieser Commit ist enthalten in:
Commit
6c6ecfccb3
@ -247,7 +247,6 @@ public class BauCommand extends BasicCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void deleteWorld(ProxiedPlayer player, String world) {
|
private static void deleteWorld(ProxiedPlayer player, String world) {
|
||||||
Message.send("BAU_DELETE_DELETED", player);
|
|
||||||
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
||||||
for (Subserver subserver : Subserver.getServerList()) {
|
for (Subserver subserver : Subserver.getServerList()) {
|
||||||
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) {
|
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);
|
SubserverSystem.deleteFolder(Node.local, world);
|
||||||
|
Message.send("BAU_DELETE_DELETED", player);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean stopBauserver(ProxiedPlayer p){
|
public static boolean stopBauserver(ProxiedPlayer p){
|
||||||
for (Subserver subserver : Subserver.getServerList()) {
|
for (Subserver subserver : Subserver.getServerList()) {
|
||||||
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
|
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId()) && !subserver.hasStarted()) {
|
||||||
if(!subserver.hasStarted()){
|
|
||||||
Message.send("BAU_START_ALREADY", p);
|
Message.send("BAU_START_ALREADY", p);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Subserver subserver : Subserver.getServerList()) {
|
||||||
|
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
|
||||||
subserver.stop();
|
subserver.stop();
|
||||||
try {
|
try {
|
||||||
Thread.sleep(200); // Wait until possible testarena-World has been deleted
|
Thread.sleep(200); // Wait until possible testarena-World has been deleted
|
||||||
|
@ -51,7 +51,7 @@ public class ChatListener extends BasicListener {
|
|||||||
public void onChatEvent(ChatEvent e){
|
public void onChatEvent(ChatEvent e){
|
||||||
if(e.getMessage().contains("jndi:ldap")) {
|
if(e.getMessage().contains("jndi:ldap")) {
|
||||||
e.setCancelled(true);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class TablistManager extends BasicListener {
|
|||||||
if(bau.size() > 0)
|
if(bau.size() > 0)
|
||||||
tablist.addSubTablist(bau);
|
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);
|
tablists.values().forEach(Tablist::refresh);
|
||||||
seconds++;
|
seconds++;
|
||||||
}
|
}
|
||||||
@ -197,10 +197,11 @@ public class TablistManager extends BasicListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int slimSize(ProxiedPlayer viewer) {
|
public int slimSize(ProxiedPlayer viewer) {
|
||||||
int size = subTablists.stream().mapToInt(tPart -> viewer == null ? tPart.size() : tPart.slimSize(viewer)).sum();
|
return subTablists.stream().mapToInt(tPart -> viewer == null ? tPart.size() : tPart.slimSize(viewer)).map(size -> {
|
||||||
if(withHeaders)
|
size += withHeaders ? 1 : 0; // Space for header
|
||||||
size += subTablists.size() * 2;
|
size += withHeaders && size > 1 ? 1 : 0; // Space for footer
|
||||||
return size;
|
return size;
|
||||||
|
}).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -210,13 +211,30 @@ public class TablistManager extends BasicListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void print(Tablist viewer, boolean slim) {
|
public void print(Tablist viewer, boolean slim) {
|
||||||
subTablists.forEach(tPart -> {
|
for (int i = 0; i < subTablists.size(); i++) {
|
||||||
if(withHeaders)
|
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);
|
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);
|
tPart.print(viewer, slim);
|
||||||
if(withHeaders)
|
if (withHeaders && !withoutFooter) {
|
||||||
viewer.setSlot(darkGray, "", 1000);
|
viewer.setSlot(darkGray, "", 1000);
|
||||||
});
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,6 +137,11 @@ public class SteamwarUser {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user = SteamwarUser.get(uuid);
|
||||||
|
if (user != null) {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
return SteamwarUser.createUserInDatabase(uuid, name);
|
return SteamwarUser.createUserInDatabase(uuid, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +294,7 @@ public class SteamwarUser {
|
|||||||
player.disconnect(punishmentMessage(punishment, player));
|
player.disconnect(punishmentMessage(punishment, player));
|
||||||
for (BannedUserIPs banned : BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) {
|
for (BannedUserIPs banned : BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) {
|
||||||
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
|
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);
|
bannedUser.punish(punishment, time, banReason, from, perma);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren