Remove chat spy and admin bypass on login if player no longer has permission.

Resolves #636 and #705.
This commit is contained in:
Trent Hensler 2016-05-30 16:45:46 -07:00
parent 9f89010af1
commit f8ee2a5506
1 changed files with 10 additions and 0 deletions

View File

@ -86,6 +86,16 @@ public class FactionsPlayerListener implements Listener {
}
}
if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) {
me.setSpyingChat(false);
P.p.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
}
if (me.isAdminBypassing() && !player.hasPermission(Permission.BYPASS.node)) {
me.setIsAdminBypassing(false);
P.p.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
}
// If they have the permission, don't let them autoleave. Bad inverted setter :\
me.setAutoLeave(!player.hasPermission(Permission.AUTO_LEAVE_BYPASS.node));
}