mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 12:36:41 +00:00
Security & improvement update (#19)
This commit is contained in:
@ -6,6 +6,7 @@ import lombok.Setter;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.command.Command_vanish;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -110,11 +111,10 @@ public class LoginProcess extends FreedomService
|
||||
}
|
||||
|
||||
// Check if player is admin
|
||||
// Not safe to use TFM_Util.isSuperAdmin(player) because player.getAddress() will return a null until after player login.
|
||||
final boolean isAdmin = plugin.al.getEntryByIp(ip) != null;
|
||||
|
||||
// Validation below this point
|
||||
if (isAdmin) // Player is superadmin
|
||||
if (isAdmin) // Player is admin
|
||||
{
|
||||
// Force-allow log in
|
||||
event.allow();
|
||||
@ -168,15 +168,15 @@ public class LoginProcess extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
// // Whitelist
|
||||
// if (plugin.si.isWhitelisted())
|
||||
// {
|
||||
// if (!plugin.si.getWhitelisted().contains(username.toLowerCase()))
|
||||
// {
|
||||
// event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server.");
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// Whitelist
|
||||
if (plugin.si.isWhitelisted())
|
||||
{
|
||||
if (!plugin.si.getWhitelisted().contains(username.toLowerCase()))
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@ -184,6 +184,11 @@ public class LoginProcess extends FreedomService
|
||||
{
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
for (Player p : Command_vanish.VANISHED)
|
||||
{
|
||||
player.hidePlayer(p);
|
||||
}
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user