SteamWar/BungeeCore
Archiviert
13
2

Star fixes, whois ID based only ADMINISTRATION, Prefix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-11-29 17:20:19 +01:00
Ursprung 792bbd610d
Commit 0df03a7dfb
3 geänderte Dateien mit 24 neuen und 17 gelöschten Zeilen

Datei anzeigen

@ -48,14 +48,18 @@ public class WhoisCommand extends SWCommand {
@Register(description = "WHOIS_USAGE") @Register(description = "WHOIS_USAGE")
public void genericCommand(ProxiedPlayer player, @Mapper("player") String target, WhoisParameterTypes... parameters) { public void genericCommand(ProxiedPlayer player, @Mapper("player") String target, WhoisParameterTypes... parameters) {
ChatSender sender = ChatSender.of(player);
SteamwarUser user = SteamwarUser.get(target); SteamwarUser user = SteamwarUser.get(target);
if (sender.user().hasPerm(UserPerm.ADMINISTRATION)) {
if (user == null) { if (user == null) {
try { try {
int id = Integer.parseInt(target); int id = Integer.parseInt(target);
user = SteamwarUser.get(id); user = SteamwarUser.get(id);
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
// Ignored
} }
} }
if (user == null) { if (user == null) {
try { try {
long id = Long.parseLong(target); long id = Long.parseLong(target);
@ -64,12 +68,13 @@ public class WhoisCommand extends SWCommand {
// Ignored // Ignored
} }
} }
}
if (user == null) { if (user == null) {
Message.send("UNKNOWN_PLAYER", player); sender.system("UNKNOWN_PLAYER");
} else { } else {
EnumSet<WhoisParameterTypes> set = parameters.length == 0 ? EnumSet.noneOf(WhoisParameterTypes.class) : EnumSet.copyOf(Arrays.asList(parameters)); EnumSet<WhoisParameterTypes> set = parameters.length == 0 ? EnumSet.noneOf(WhoisParameterTypes.class) : EnumSet.copyOf(Arrays.asList(parameters));
sendUserinfo(player, user, set); sendUserinfo(sender, user, set);
} }
} }
@ -78,11 +83,11 @@ public class WhoisCommand extends SWCommand {
return SWCommandUtils.createMapper(s -> s, s -> BungeeCord.getInstance().getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList())); return SWCommandUtils.createMapper(s -> s, s -> BungeeCord.getInstance().getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()));
} }
private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user, EnumSet<WhoisParameterTypes> parameterTypes) { private static void sendUserinfo(ChatSender sender, SteamwarUser user, EnumSet<WhoisParameterTypes> parameterTypes) {
ChatSender sender = ChatSender.of(player);
Team team = Team.get(user.getTeam()); Team team = Team.get(user.getTeam());
sender.system("WHOIS_USERNAME", user.getUserName()); sender.system("WHOIS_USERNAME", user.getUserName());
sender.system("WHOIS_PREFIX", user.prefix().getChatPrefix());
sender.system("WHOIS_TEAM", new Message("WHOIS_TEAM_HOVER", team.getTeamName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + team.getTeamKuerzel()), team.getTeamColor(), team.getTeamKuerzel(), team.getTeamName()); sender.system("WHOIS_TEAM", new Message("WHOIS_TEAM_HOVER", team.getTeamName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + team.getTeamKuerzel()), team.getTeamColor(), team.getTeamKuerzel(), team.getTeamName());
if (!sender.user().hasPerm(UserPerm.TEAM)) if (!sender.user().hasPerm(UserPerm.TEAM))

Datei anzeigen

@ -380,7 +380,7 @@ TUTORIAL_NAME=§e{0}
TUTORIAL_BY=§8von §7{0} TUTORIAL_BY=§8von §7{0}
TUTORIAL_STARS=§e{0} §7Stars TUTORIAL_STARS=§e{0} §7Stars
TUTORIAL_RATE_TITLE=Rate tutorial TUTORIAL_RATE_TITLE=Rate tutorial
TUTORIAL_RATE=§e{0} §7Star(e) TUTORIAL_RATE=§e{0} §7Star(s)
TUTORIAL_DELETE=§cDelete with Shift+Right-Click TUTORIAL_DELETE=§cDelete with Shift+Right-Click
TUTORIAL_CREATE_HELP=§8/§7tutorial create §8[§ematerial§8] §8[§ename§8] TUTORIAL_CREATE_HELP=§8/§7tutorial create §8[§ematerial§8] §8[§ename§8]
TUTORIAL_CREATE_MISSING=§cA tutorial can only be created on a tutorial server! TUTORIAL_CREATE_MISSING=§cA tutorial can only be created on a tutorial server!
@ -598,6 +598,7 @@ SERVER_WORLD_ERROR=§cCreating the world failed.
#WhoisCommand #WhoisCommand
WHOIS_USAGE=§c/whois [player/ID] [-a/-m] WHOIS_USAGE=§c/whois [player/ID] [-a/-m]
WHOIS_USERNAME=§7Username§8: §e{0} WHOIS_USERNAME=§7Username§8: §e{0}
WHOIS_PREFIX=§7Chat-Prefix§8: {0}
WHOIS_UUID=§7UUID§8: §e{0} WHOIS_UUID=§7UUID§8: §e{0}
WHOIS_UUID_HOVER=§eCopy UUID WHOIS_UUID_HOVER=§eCopy UUID
WHOIS_ID=§7ID§8: §e{0} WHOIS_ID=§7ID§8: §e{0}

Datei anzeigen

@ -576,6 +576,7 @@ SERVER_WORLD_ERROR=§cDas Erstellen der Welt ist fehlgeschlagen.
#WhoisCommand #WhoisCommand
WHOIS_USAGE=§c/whois [Spieler/ID] [-a/-m] WHOIS_USAGE=§c/whois [Spieler/ID] [-a/-m]
WHOIS_USERNAME=§7Username§8: §e{0} WHOIS_USERNAME=§7Username§8: §e{0}
WHOIS_PREFIX=§7Chat-Präfix§8: {0}
WHOIS_PERMS=§7Rechte§8: §7{0} WHOIS_PERMS=§7Rechte§8: §7{0}
WHOIS_UUID=§7UUID§8: §e{0} WHOIS_UUID=§7UUID§8: §e{0}
WHOIS_UUID_HOVER=§eUUID Kopieren WHOIS_UUID_HOVER=§eUUID Kopieren