Make hidden players not reported when joining/quitting server

This commit is contained in:
Mike Primm 2011-11-13 22:54:41 -06:00
parent 7cee034fbb
commit e0c0729d08
2 changed files with 10 additions and 4 deletions

View File

@ -59,14 +59,16 @@ public class SimpleWebChatComponent extends Component {
@Override
public void onPlayerJoin(PlayerJoinEvent event) {
if(plugin.mapManager != null)
if((plugin.mapManager != null) && (plugin.playerList != null) && (plugin.playerList.isVisiblePlayer(event.getPlayer()))) {
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getDisplayName(), event.getPlayer().getName()));
}
}
@Override
public void onPlayerQuit(PlayerQuitEvent event) {
if(plugin.mapManager != null)
if((plugin.mapManager != null) && (plugin.playerList != null) && (plugin.playerList.isVisiblePlayer(event.getPlayer()))) {
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getDisplayName(), event.getPlayer().getName()));
}
}
}

View File

@ -60,12 +60,16 @@ public class HeroWebChatComponent extends Component {
protected class PlayerChatListener extends PlayerListener {
@Override
public void onPlayerJoin(PlayerJoinEvent event) {
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getDisplayName(), event.getPlayer().getName()));
if((plugin.mapManager != null) && (plugin.playerList != null) && (plugin.playerList.isVisiblePlayer(event.getPlayer()))) {
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getDisplayName(), event.getPlayer().getName()));
}
}
@Override
public void onPlayerQuit(PlayerQuitEvent event) {
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getDisplayName(), event.getPlayer().getName()));
if((plugin.mapManager != null) && (plugin.playerList != null) && (plugin.playerList.isVisiblePlayer(event.getPlayer()))) {
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getDisplayName(), event.getPlayer().getName()));
}
}
}
}