Do not display chat to unlogged/unregistered player

This commit is contained in:
Xephi 2014-09-05 05:02:44 +02:00
parent 7dc9238288
commit 53437ed33c
2 changed files with 8 additions and 2 deletions

View File

@ -274,8 +274,14 @@ public class AuthMePlayerListener implements Listener {
if (Utils.getInstance().isUnrestricted(player)) if (Utils.getInstance().isUnrestricted(player))
return; return;
if (PlayerCache.getInstance().isAuthenticated(name)) if (PlayerCache.getInstance().isAuthenticated(name)) {
if (!Settings.isChatAllowed)
for (Player p : event.getRecipients()) {
if (!PlayerCache.getInstance().isAuthenticated(p.getName()))
event.getRecipients().remove(p);
}
return; return;
}
String cmd = event.getMessage().split(" ")[0]; String cmd = event.getMessage().split(" ")[0];

View File

@ -74,7 +74,7 @@ settings:
# And try to login with an another IP Address? # And try to login with an another IP Address?
sessionExpireOnIpChange: false sessionExpireOnIpChange: false
restrictions: restrictions:
# Can unregistered players chat, care , that block all commands except followers # Can unregistered/unlogged players chat and see chat, care , that block all commands except followers
allowChat: false allowChat: false
# Commands allowed when a player is unlogged # Commands allowed when a player is unlogged
allowCommands: allowCommands: