some stuff
This commit is contained in:
@@ -206,11 +206,14 @@ public final class FriendCommand extends AbstractCommandCollection {
|
|||||||
|
|
||||||
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
|
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
|
||||||
RankLookup ranks = NetworkCore.getInstance().getRankLookup();
|
RankLookup ranks = NetworkCore.getInstance().getRankLookup();
|
||||||
|
net.kewwbec.networkcore.api.VanishService vanish = NetworkCore.getInstance().getVanishService();
|
||||||
|
|
||||||
int online = 0;
|
int online = 0;
|
||||||
for (Friendship f : all) {
|
for (Friendship f : all) {
|
||||||
UUID otherUuid = f.fromUuid().equals(sender.getUuid()) ? f.toUuid() : f.fromUuid();
|
UUID otherUuid = f.fromUuid().equals(sender.getUuid()) ? f.toUuid() : f.fromUuid();
|
||||||
if (presence != null && presence.getLocation(otherUuid) != null) online++;
|
PlayerLocation loc = presence != null ? presence.getLocation(otherUuid) : null;
|
||||||
|
if (loc != null && vanish != null && vanish.isHiddenFrom(otherUuid, sender)) loc = null;
|
||||||
|
if (loc != null) online++;
|
||||||
}
|
}
|
||||||
ctx.sendMessage(Message.raw("=== Friends (" + online + "/" + all.size() + " online) ===").color(Color.YELLOW));
|
ctx.sendMessage(Message.raw("=== Friends (" + online + "/" + all.size() + " online) ===").color(Color.YELLOW));
|
||||||
|
|
||||||
@@ -218,6 +221,7 @@ public final class FriendCommand extends AbstractCommandCollection {
|
|||||||
UUID otherUuid = f.fromUuid().equals(sender.getUuid()) ? f.toUuid() : f.fromUuid();
|
UUID otherUuid = f.fromUuid().equals(sender.getUuid()) ? f.toUuid() : f.fromUuid();
|
||||||
String otherName = f.fromUuid().equals(sender.getUuid()) ? f.toName() : f.fromName();
|
String otherName = f.fromUuid().equals(sender.getUuid()) ? f.toName() : f.fromName();
|
||||||
PlayerLocation loc = (presence == null) ? null : presence.getLocation(otherUuid);
|
PlayerLocation loc = (presence == null) ? null : presence.getLocation(otherUuid);
|
||||||
|
if (loc != null && vanish != null && vanish.isHiddenFrom(otherUuid, sender)) loc = null;
|
||||||
String status = (loc == null) ? "offline" : "online on " + loc.serverId();
|
String status = (loc == null) ? "offline" : "online on " + loc.serverId();
|
||||||
RankInfo rank = (ranks == null) ? null : safeLookup(ranks, otherUuid);
|
RankInfo rank = (ranks == null) ? null : safeLookup(ranks, otherUuid);
|
||||||
ctx.sendMessage(buildRow(rank, otherName, status, loc != null));
|
ctx.sendMessage(buildRow(rank, otherName, status, loc != null));
|
||||||
|
|||||||
@@ -102,11 +102,13 @@ public final class FriendsListPage {
|
|||||||
}
|
}
|
||||||
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
|
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
|
||||||
RankLookup ranks = NetworkCore.getInstance().getRankLookup();
|
RankLookup ranks = NetworkCore.getInstance().getRankLookup();
|
||||||
|
net.kewwbec.networkcore.api.VanishService vanish = NetworkCore.getInstance().getVanishService();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Friendship f : friends) {
|
for (Friendship f : friends) {
|
||||||
UUID otherUuid = f.fromUuid().equals(playerRef.getUuid()) ? f.toUuid() : f.fromUuid();
|
UUID otherUuid = f.fromUuid().equals(playerRef.getUuid()) ? f.toUuid() : f.fromUuid();
|
||||||
String otherName = f.fromUuid().equals(playerRef.getUuid()) ? f.toName() : f.fromName();
|
String otherName = f.fromUuid().equals(playerRef.getUuid()) ? f.toName() : f.fromName();
|
||||||
PlayerLocation loc = (presence == null) ? null : presence.getLocation(otherUuid);
|
PlayerLocation loc = (presence == null) ? null : presence.getLocation(otherUuid);
|
||||||
|
if (loc != null && vanish != null && vanish.isHiddenFrom(otherUuid, playerRef)) loc = null;
|
||||||
String status = (loc == null) ? "offline" : "online on " + loc.serverId();
|
String status = (loc == null) ? "offline" : "online on " + loc.serverId();
|
||||||
RankInfo rank = (ranks == null) ? null : safeLookup(ranks, otherUuid);
|
RankInfo rank = (ranks == null) ? null : safeLookup(ranks, otherUuid);
|
||||||
sb.append(renderNameRow(rank, otherName, status));
|
sb.append(renderNameRow(rank, otherName, status));
|
||||||
|
|||||||
@@ -62,9 +62,13 @@ public final class GuildRosterPage {
|
|||||||
List<GuildMember> roster = ctx.guilds.roster(gc.guild().id());
|
List<GuildMember> roster = ctx.guilds.roster(gc.guild().id());
|
||||||
int online = 0;
|
int online = 0;
|
||||||
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
|
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
|
||||||
|
net.kewwbec.networkcore.api.VanishService vanish = NetworkCore.getInstance().getVanishService();
|
||||||
if (presence != null) {
|
if (presence != null) {
|
||||||
for (GuildMember m : roster) {
|
for (GuildMember m : roster) {
|
||||||
if (presence.getLocation(m.uuid()) != null) online++;
|
PlayerLocation l = presence.getLocation(m.uuid());
|
||||||
|
if (l == null) continue;
|
||||||
|
if (vanish != null && vanish.isHiddenFrom(m.uuid(), playerRef)) continue;
|
||||||
|
online++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +78,7 @@ public final class GuildRosterPage {
|
|||||||
String rankName = rankNames.getOrDefault(m.rankId(), "?");
|
String rankName = rankNames.getOrDefault(m.rankId(), "?");
|
||||||
String self = m.uuid().equals(playerRef.getUuid()) ? " (you)" : "";
|
String self = m.uuid().equals(playerRef.getUuid()) ? " (you)" : "";
|
||||||
PlayerLocation loc = (presence == null) ? null : presence.getLocation(m.uuid());
|
PlayerLocation loc = (presence == null) ? null : presence.getLocation(m.uuid());
|
||||||
|
if (loc != null && vanish != null && vanish.isHiddenFrom(m.uuid(), playerRef)) loc = null;
|
||||||
String status = (loc == null) ? "offline" : "on " + loc.serverId();
|
String status = (loc == null) ? "offline" : "on " + loc.serverId();
|
||||||
body.append("<p>")
|
body.append("<p>")
|
||||||
.append(escape(m.name()))
|
.append(escape(m.name()))
|
||||||
|
|||||||
Reference in New Issue
Block a user