Added whitelist check in CoreClientManager

This commit is contained in:
Jonathan Williams 2014-02-10 02:04:20 -08:00
parent 525df6c2b0
commit a75ced170c

View File

@ -19,6 +19,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -138,6 +139,19 @@ public class CoreClientManager implements Listener
event.disallow(Result.KICK_OTHER, "Error retrieving information from web, please retry in a minute.");
}
if (Bukkit.hasWhitelist() && !Get(event.getName()).GetRank().Has(Rank.MODERATOR))
{
for (OfflinePlayer player : Bukkit.getWhitelistedPlayers())
{
if (player.getName().equalsIgnoreCase(event.getName()))
{
return;
}
}
event.disallow(Result.KICK_WHITELIST, "You are not whitelisted my friend.");
}
}
private void LoadClient(CoreClient client, String ipAddress)