diff --git a/src/com/massivecraft/factions/cmd/CmdShow.java b/src/com/massivecraft/factions/cmd/CmdShow.java index 7799e074..d96cbcad 100644 --- a/src/com/massivecraft/factions/cmd/CmdShow.java +++ b/src/com/massivecraft/factions/cmd/CmdShow.java @@ -128,7 +128,7 @@ public class CmdShow extends FCommand for (FPlayer follower : admins) { listpart = follower.getNameAndTitle(fme)+p.txt.parse("")+", "; - if (follower.isOnline()) + if (follower.isOnlineAndVisibleTo(me)) { onlineList += listpart; } @@ -141,7 +141,7 @@ public class CmdShow extends FCommand { listpart = follower.getNameAndTitle(fme)+p.txt.parse("")+", "; if - (follower.isOnline()) + (follower.isOnlineAndVisibleTo(me)) { onlineList += listpart; } else { @@ -150,7 +150,7 @@ public class CmdShow extends FCommand } for (FPlayer follower : normals) { listpart = follower.getNameAndTitle(fme)+p.txt.parse("")+", "; - if (follower.isOnline()) { + if (follower.isOnlineAndVisibleTo(me)) { onlineList += listpart; } else { offlineList += listpart; diff --git a/src/com/massivecraft/factions/zcore/persist/PlayerEntity.java b/src/com/massivecraft/factions/zcore/persist/PlayerEntity.java index f8ccced9..bbe9491f 100644 --- a/src/com/massivecraft/factions/zcore/persist/PlayerEntity.java +++ b/src/com/massivecraft/factions/zcore/persist/PlayerEntity.java @@ -16,7 +16,14 @@ public class PlayerEntity extends Entity { return this.getPlayer() != null; } - + + // make sure target player should be able to detect that this player is online + public boolean isOnlineAndVisibleTo(Player player) + { + Player target = this.getPlayer(); + return target != null && player.canSee(target); + } + public boolean isOffline() { return ! isOnline();