SteamWar/BungeeCore
Archiviert
13
2

Update Peer Review stuff and add message
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-11-29 18:30:04 +01:00
Ursprung 6f31058d61
Commit a571832d67
3 geänderte Dateien mit 12 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -84,12 +84,8 @@ public class CheckCommand extends SWCommand {
Message.sendPrefixless("CHECK_LIST_HEADER", player, schematicList.size()); Message.sendPrefixless("CHECK_LIST_HEADER", player, schematicList.size());
SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId());
int playerTeam = steamwarUser.hasPerm(UserPerm.MODERATION) ? 0 : steamwarUser.getTeam();
for (SchematicNode schematic : schematicList) { for (SchematicNode schematic : schematicList) {
SteamwarUser schematicOwner = SteamwarUser.get(schematic.getOwner());
CheckSession current = currentSchems.get(schematic.getId()); CheckSession current = currentSchems.get(schematic.getId());
boolean sameTeam = schematicOwner.getTeam() != 0 && schematicOwner.getTeam() == playerTeam;
long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime(); long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime();
String color = waitedMillis > 14400000 ? (waitedMillis > 86400000 ? "§c" : "§e") : "§a"; String color = waitedMillis > 14400000 ? (waitedMillis > 86400000 ? "§c" : "§e") : "§a";
long hours = waitedMillis / 3600000; long hours = waitedMillis / 3600000;
@ -98,15 +94,15 @@ public class CheckCommand extends SWCommand {
if (current == null) { if (current == null) {
Message.sendPrefixless("CHECK_LIST_TO_CHECK", player, Message.sendPrefixless("CHECK_LIST_TO_CHECK", player,
Message.parse("CHECK_LIST_TO_CHECK_HOVER", player), Message.parse("CHECK_LIST_TO_CHECK_HOVER", player),
sameTeam ? null : new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check schematic " + schematic.getId()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check schematic " + schematic.getId()),
waitTime, waitTime,
schematic.getSchemtype().getKuerzel(), schematicOwner.getUserName(), schematic.getName()); schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName());
} else { } else {
Message.sendPrefixless("CHECK_LIST_CHECKING", player, Message.sendPrefixless("CHECK_LIST_CHECKING", player,
Message.parse("CHECK_LIST_CHECKING_HOVER", player), Message.parse("CHECK_LIST_CHECKING_HOVER", player),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + current.checker.getName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + current.checker.getName()),
waitTime, waitTime,
schematic.getSchemtype().getKuerzel(), schematicOwner.getUserName(), schematic.getName(), current.checker.getName()); schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName(), current.checker.getName());
} }
} }
} }
@ -118,18 +114,21 @@ public class CheckCommand extends SWCommand {
return; return;
} }
SteamwarUser checkingUser = SteamwarUser.get(player.getUniqueId());
SchematicNode schem = SchematicNode.getSchematicNode(Integer.parseInt(schemID)); SchematicNode schem = SchematicNode.getSchematicNode(Integer.parseInt(schemID));
if(!schem.getSchemtype().check()){ if(!schem.getSchemtype().check()){
ProxyServer.getInstance().getLogger().log(Level.SEVERE, player.getName() + " tried to check an uncheckable schematic!"); ProxyServer.getInstance().getLogger().log(Level.SEVERE, player.getName() + " tried to check an uncheckable schematic!");
return; return;
}else if(schem.getOwner() == SteamwarUser.get(player.getUniqueId()).getId()) { }else if(schem.getOwner() == checkingUser.getId()) {
Message.send("CHECK_SCHEMATIC_OWN", player); Message.send("CHECK_SCHEMATIC_OWN", player);
return; return;
} }
int playerTeam = SteamwarUser.get(player.getUniqueId()).getTeam(); int playerTeam = checkingUser.hasPerm(UserPerm.MODERATION) ? 0 : checkingUser.getTeam();
boolean sameTeam = SteamwarUser.get(schem.getOwner()).getTeam() == playerTeam; if (playerTeam != 0 && SteamwarUser.get(schem.getOwner()).getTeam() == playerTeam) {
if (sameTeam) return; Message.send("CHECK_SCHEMATIC_OWN_TEAM", player);
return;
}
new CheckSession(player, schem); new CheckSession(player, schem);
} }

Datei anzeigen

@ -293,6 +293,7 @@ CHECK_LIST_CHECKING={0} §8{1} §7{2} §e{3} §7is being reviewed by §e{4}
CHECK_LIST_CHECKING_HOVER=§eTo the reviewer CHECK_LIST_CHECKING_HOVER=§eTo the reviewer
CHECK_SCHEMATIC_ALREADY_CHECKING=§cYou are already reviewing a schematic! CHECK_SCHEMATIC_ALREADY_CHECKING=§cYou are already reviewing a schematic!
CHECK_SCHEMATIC_OWN=§cYou cannot review your own schematics. CHECK_SCHEMATIC_OWN=§cYou cannot review your own schematics.
CHECK_SCHEMATIC_OWN_TEAM=§cYou cannot review your team schematics.
CHECK_SCHEMATIC_PREVIOUS=§7{0} from {1}§8: §e{2} CHECK_SCHEMATIC_PREVIOUS=§7{0} from {1}§8: §e{2}
CHECK_INVALID_RANK=§cUnknown schematic rank. CHECK_INVALID_RANK=§cUnknown schematic rank.
CHECK_ABORT=§aThe test operation was canceled! CHECK_ABORT=§aThe test operation was canceled!

Datei anzeigen

@ -276,6 +276,7 @@ CHECK_LIST_CHECKING={0} §8{1} §7{2} §e{3} §7wird geprüft von §e{4}
CHECK_LIST_CHECKING_HOVER=§eZum Prüfer CHECK_LIST_CHECKING_HOVER=§eZum Prüfer
CHECK_SCHEMATIC_ALREADY_CHECKING=§cDu prüfst schon eine Schematic! CHECK_SCHEMATIC_ALREADY_CHECKING=§cDu prüfst schon eine Schematic!
CHECK_SCHEMATIC_OWN=§cDu kannst nicht deine eigenen Schematics prüfen. CHECK_SCHEMATIC_OWN=§cDu kannst nicht deine eigenen Schematics prüfen.
CHECK_SCHEMATIC_OWN_TEAM=§cDu kannst nicht Schematics deines Teams prüfen.
CHECK_SCHEMATIC_PREVIOUS=§7{0} von {1}§8: §e{2} CHECK_SCHEMATIC_PREVIOUS=§7{0} von {1}§8: §e{2}
CHECK_INVALID_RANK=§cUnbekannter Schematicrang. CHECK_INVALID_RANK=§cUnbekannter Schematicrang.
CHECK_ABORT=§aDer Prüfvorgang wurde abgebrochen! CHECK_ABORT=§aDer Prüfvorgang wurde abgebrochen!