mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Fixes several bugs caused by any potential issues in TFM's admin loading system
This commit is contained in:
parent
4d98108a46
commit
c0f3712c8d
@ -59,7 +59,7 @@ public class Admin
|
|||||||
{
|
{
|
||||||
final StringBuilder output = new StringBuilder();
|
final StringBuilder output = new StringBuilder();
|
||||||
|
|
||||||
output.append("Admin: ").append(getName()).append("\n")
|
output.append("Admin: ").append(getName() != null ? getName() : getUuid().toString()).append("\n")
|
||||||
.append("- IPs: ").append(StringUtils.join(ips, ", ")).append("\n")
|
.append("- IPs: ").append(StringUtils.join(ips, ", ")).append("\n")
|
||||||
.append("- Last Login: ").append(FUtil.dateToString(lastLogin)).append("\n")
|
.append("- Last Login: ").append(FUtil.dateToString(lastLogin)).append("\n")
|
||||||
.append("- Rank: ").append(rank.getName()).append("\n")
|
.append("- Rank: ").append(rank.getName()).append("\n")
|
||||||
@ -172,7 +172,7 @@ public class Admin
|
|||||||
setPotionSpy(false);
|
setPotionSpy(false);
|
||||||
|
|
||||||
Server server = Bukkit.getServer();
|
Server server = Bukkit.getServer();
|
||||||
Player player = server.getPlayer(getName());
|
Player player = server.getPlayer(getUuid());
|
||||||
|
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
|
@ -48,12 +48,18 @@ public class AdminList extends FreedomService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
ResultSet adminSet = plugin.sql.getAdminList();
|
ResultSet adminSet = plugin.sql.getAdminList();
|
||||||
{
|
|
||||||
while (adminSet.next())
|
while (adminSet.next())
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Admin admin = new Admin(adminSet);
|
Admin admin = new Admin(adminSet);
|
||||||
allAdmins.add(admin);
|
allAdmins.add(admin);
|
||||||
}
|
}
|
||||||
|
catch (Throwable ex)
|
||||||
|
{
|
||||||
|
FLog.warning("An error occurred whilst reading the admin entry at row #" + adminSet.getRow());
|
||||||
|
FLog.warning(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
@ -245,7 +251,10 @@ public class AdminList extends FreedomService
|
|||||||
|
|
||||||
activeAdmins.add(admin);
|
activeAdmins.add(admin);
|
||||||
uuidTable.put(admin.getUuid(), admin);
|
uuidTable.put(admin.getUuid(), admin);
|
||||||
|
if (admin.getName() != null)
|
||||||
|
{
|
||||||
nameTable.put(admin.getName().toLowerCase(), admin);
|
nameTable.put(admin.getName().toLowerCase(), admin);
|
||||||
|
}
|
||||||
|
|
||||||
for (String ip : admin.getIps())
|
for (String ip : admin.getIps())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user