|
|
|
@ -20,6 +20,7 @@
|
|
|
|
|
package de.steamwar.bungeecore.commands;
|
|
|
|
|
|
|
|
|
|
import de.steamwar.bungeecore.Message;
|
|
|
|
|
import de.steamwar.bungeecore.Storage;
|
|
|
|
|
import de.steamwar.bungeecore.sql.Punishment;
|
|
|
|
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
|
|
|
|
import de.steamwar.bungeecore.sql.Team;
|
|
|
|
@ -31,8 +32,10 @@ import net.md_5.bungee.api.CommandSender;
|
|
|
|
|
import net.md_5.bungee.api.chat.ClickEvent;
|
|
|
|
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
|
|
|
|
|
|
|
|
import java.net.InetSocketAddress;
|
|
|
|
|
import java.sql.Timestamp;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.time.Instant;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Set;
|
|
|
|
@ -78,15 +81,24 @@ public class WhoisCommand extends SWCommand {
|
|
|
|
|
Message.send("WHOIS_USERNAME", player, user.getUserName());
|
|
|
|
|
Message.send("WHOIS_UUID", player, Message.parse("WHOIS_UUID_HOVER", player), new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, user.getUuid().toString()), user.getUuid().toString());
|
|
|
|
|
Message.send("WHOIS_ID", player, user.getId());
|
|
|
|
|
Message.send("WHOIS_GROUP", player, user.getUserGroup().getColorCode(), user.getUserGroup().name());
|
|
|
|
|
if (user.getDiscordId() != null) {
|
|
|
|
|
Message.send("WHOIS_DISCORD_ID", player, user.getDiscordId());
|
|
|
|
|
}
|
|
|
|
|
Timestamp firstJoin = user.getFirstjoin();
|
|
|
|
|
if (firstJoin == null)
|
|
|
|
|
if (firstJoin == null) {
|
|
|
|
|
Message.send("WHOIS_JOINED_FIRST", player, "0000-00-00 00:00:00");
|
|
|
|
|
else
|
|
|
|
|
} else {
|
|
|
|
|
Message.send("WHOIS_JOINED_FIRST", player, firstJoin.toString());
|
|
|
|
|
Message.send("WHOIS_HOURS_PLAYED", player, new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600));
|
|
|
|
|
}
|
|
|
|
|
Message.send("WHOIS_HOURS_PLAYED", player, new DecimalFormat("###.##").format(user.getOnlinetime() / 3600d));
|
|
|
|
|
|
|
|
|
|
if(BungeeCord.getInstance().getPlayer(user.getUuid()) != null) {
|
|
|
|
|
ProxiedPlayer target = BungeeCord.getInstance().getPlayer(user.getUuid());
|
|
|
|
|
Message.send("WHOIS_CURRENT_PLAYED", player, new DecimalFormat("####.##").format(Instant.now().getEpochSecond() - Storage.sessions.get(target).toInstant().getEpochSecond() / 60d));
|
|
|
|
|
Message.send("WHOIS_CURRENT_SERVER", player, target.getServer().getInfo().getName());
|
|
|
|
|
Message.send("WHOIS_CURRENT_PROTOCOL", player, target.getPendingConnection().getVersion());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Team team = Team.get(user.getTeam());
|
|
|
|
|
Message.send("WHOIS_TEAM", player, Message.parse("WHOIS_TEAM_HOVER", player, team.getTeamName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + team.getTeamKuerzel()), team.getTeamColor(), team.getTeamKuerzel(), team.getTeamName());
|
|
|
|
|