mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Merge pull request #263 from AtlasMediaGroup/FS-450
Fixes several bugs caused by potential issues in TFM's admin loading system (FS-450)
This commit is contained in:
commit
1ddeb4b621
@ -59,7 +59,7 @@ public class Admin
|
||||
{
|
||||
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("- Last Login: ").append(FUtil.dateToString(lastLogin)).append("\n")
|
||||
.append("- Rank: ").append(rank.getName()).append("\n")
|
||||
@ -172,7 +172,7 @@ public class Admin
|
||||
setPotionSpy(false);
|
||||
|
||||
Server server = Bukkit.getServer();
|
||||
Player player = server.getPlayer(getName());
|
||||
Player player = server.getPlayer(getUuid());
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
|
@ -48,12 +48,18 @@ public class AdminList extends FreedomService
|
||||
try
|
||||
{
|
||||
ResultSet adminSet = plugin.sql.getAdminList();
|
||||
while (adminSet.next())
|
||||
{
|
||||
while (adminSet.next())
|
||||
try
|
||||
{
|
||||
Admin admin = new Admin(adminSet);
|
||||
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)
|
||||
@ -245,7 +251,10 @@ public class AdminList extends FreedomService
|
||||
|
||||
activeAdmins.add(admin);
|
||||
uuidTable.put(admin.getUuid(), admin);
|
||||
nameTable.put(admin.getName().toLowerCase(), admin);
|
||||
if (admin.getName() != null)
|
||||
{
|
||||
nameTable.put(admin.getName().toLowerCase(), admin);
|
||||
}
|
||||
|
||||
for (String ip : admin.getIps())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user