mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Avoid adding blocked IPs to the superadmin list
This commit is contained in:
parent
8b45482d0a
commit
794b76321a
@ -1,3 +1,3 @@
|
|||||||
#Build Number for ANT. Do not edit!
|
#Build Number for ANT. Do not edit!
|
||||||
#Sat Aug 30 16:14:15 CEST 2014
|
#Thu Nov 13 18:09:08 CET 2014
|
||||||
build.number=949
|
build.number=951
|
||||||
|
@ -433,12 +433,12 @@ public class TFM_AdminList
|
|||||||
|
|
||||||
final Player player = (Player) sender;
|
final Player player = (Player) sender;
|
||||||
|
|
||||||
if (Bukkit.getOnlineMode() && superUUIDs.contains(TFM_UuidManager.getUniqueId(player)))
|
if (superIps.contains(TFM_Util.getIp(player)))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (superIps.contains(TFM_Util.getIp(player)))
|
if (Bukkit.getOnlineMode() && superUUIDs.contains(TFM_UuidManager.getUniqueId(player)))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -556,6 +556,7 @@ public class TFM_AdminList
|
|||||||
{
|
{
|
||||||
final UUID uuid = TFM_UuidManager.getUniqueId(player);
|
final UUID uuid = TFM_UuidManager.getUniqueId(player);
|
||||||
final String ip = TFM_Util.getIp(player);
|
final String ip = TFM_Util.getIp(player);
|
||||||
|
final boolean canSuperIp = !TFM_MainConfig.getList(TFM_ConfigEntry.NOADMIN_IPS).contains(ip);
|
||||||
|
|
||||||
if (adminList.containsKey(uuid))
|
if (adminList.containsKey(uuid))
|
||||||
{
|
{
|
||||||
@ -566,7 +567,7 @@ public class TFM_AdminList
|
|||||||
{
|
{
|
||||||
superadmin.setLastLogin(new Date());
|
superadmin.setLastLogin(new Date());
|
||||||
|
|
||||||
if (ip != null && !TFM_MainConfig.getList(TFM_ConfigEntry.NOADMIN_IPS).contains(ip))
|
if (ip != null && canSuperIp)
|
||||||
{
|
{
|
||||||
superadmin.addIp(ip);
|
superadmin.addIp(ip);
|
||||||
}
|
}
|
||||||
@ -579,11 +580,17 @@ public class TFM_AdminList
|
|||||||
|
|
||||||
if (ip == null)
|
if (ip == null)
|
||||||
{
|
{
|
||||||
TFM_Log.severe("Cannot add superadmin: " + TFM_Util.formatPlayer(player));
|
TFM_Log.severe("Could not add superadmin: " + TFM_Util.formatPlayer(player));
|
||||||
TFM_Log.severe("Could not retrieve IP!");
|
TFM_Log.severe("Could not retrieve IP!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!canSuperIp)
|
||||||
|
{
|
||||||
|
TFM_Log.warning("Could not add superadmin: " + TFM_Util.formatPlayer(player));
|
||||||
|
TFM_Log.warning("IP " + ip + " may not be supered.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final TFM_Admin superadmin = new TFM_Admin(
|
final TFM_Admin superadmin = new TFM_Admin(
|
||||||
uuid,
|
uuid,
|
||||||
|
Loading…
Reference in New Issue
Block a user