Check permissions correctly

This commit is contained in:
Trever Fischer 2012-02-27 19:24:04 -05:00
parent 4c91b5d749
commit 731aa96648

View File

@ -57,17 +57,16 @@ public class JoinListener extends PlayerListener {
public void onPlayerLogin(PlayerLoginEvent event) { public void onPlayerLogin(PlayerLoginEvent event) {
Player p = event.getPlayer(); Player p = event.getPlayer();
if (p.hasPermission("caminus.whitelisted"))
return;
try { try {
if (!isUserAuthed(p.getName())) { if (!isUserAuthed(p.getName())) {
event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "An active camin.us account is required."); event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "An active camin.us account is required.");
return;
} }
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "Auth URL is invalid!"); event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "Auth URL is invalid!");
return;
} catch (IOException e) { } catch (IOException e) {
event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "Camin.us auth server seems down."); event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "Camin.us auth server seems down.");
return;
} }
String[] motd = null; String[] motd = null;
try { try {