mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-02 04:56:40 +00:00
staff -> admins
* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias) * format almost every file correctly * a few other improvements
This commit is contained in:
@ -53,7 +53,7 @@ public class LoginProcess extends FreedomService
|
||||
public void onPlayerPreLogin(AsyncPlayerPreLoginEvent event)
|
||||
{
|
||||
final String ip = event.getAddress().getHostAddress().trim();
|
||||
final boolean isStaff = plugin.sl.getEntryByIp(ip) != null;
|
||||
final boolean isAdmin = plugin.al.getEntryByIp(ip) != null;
|
||||
|
||||
// Check if the player is already online
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
@ -63,10 +63,10 @@ public class LoginProcess extends FreedomService
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isStaff)
|
||||
if (isAdmin)
|
||||
{
|
||||
event.allow();
|
||||
FSync.playerKick(onlinePlayer, "A staff member just logged in with the username you are using.");
|
||||
FSync.playerKick(onlinePlayer, "An admin just logged in with the username you are using.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -113,11 +113,8 @@ public class LoginProcess extends FreedomService
|
||||
}
|
||||
}
|
||||
|
||||
// Check if player is staff
|
||||
final boolean isStaff = plugin.sl.getEntryByIp(ip) != null;
|
||||
|
||||
// Validation below this point
|
||||
if (isStaff) // Player is staff
|
||||
if (plugin.al.getEntryByIp(ip) != null) // Check if player is admin
|
||||
{
|
||||
// Force-allow log in
|
||||
event.allow();
|
||||
@ -127,9 +124,9 @@ public class LoginProcess extends FreedomService
|
||||
{
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.sl.isStaff(onlinePlayer))
|
||||
if (!plugin.al.isAdmin(onlinePlayer))
|
||||
{
|
||||
onlinePlayer.kickPlayer("You have been kicked to free up room for a staff member.");
|
||||
onlinePlayer.kickPlayer("You have been kicked to free up room for an admin.");
|
||||
count--;
|
||||
}
|
||||
|
||||
@ -149,7 +146,7 @@ public class LoginProcess extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
// Player is not a staff member
|
||||
// Player is not an admin
|
||||
// Server full check
|
||||
if (server.getOnlinePlayers().size() >= server.getMaxPlayers())
|
||||
{
|
||||
@ -157,10 +154,10 @@ public class LoginProcess extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
// Staff-only mode
|
||||
if (ConfigEntry.STAFF_ONLY_MODE.getBoolean())
|
||||
// Admin-only mode
|
||||
if (ConfigEntry.ADMIN_ONLY_MODE.getBoolean())
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Server is temporarily open to staff only.");
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Server is temporarily open to admins only.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -226,7 +223,7 @@ public class LoginProcess extends FreedomService
|
||||
player.setPlayerListFooter(FUtil.colorize(ConfigEntry.SERVER_TABLIST_FOOTER.getString()).replace("\\n", "\n"));
|
||||
}
|
||||
|
||||
if (!plugin.sl.isStaff(player))
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
String tag = playerData.getTag();
|
||||
if (tag != null)
|
||||
@ -237,14 +234,14 @@ public class LoginProcess extends FreedomService
|
||||
int noteCount = playerData.getNotes().size();
|
||||
if (noteCount != 0)
|
||||
{
|
||||
String noteMessage = "This player has " + noteCount + " staff note" + (noteCount > 1 ? "s" : "") + ".";
|
||||
String noteMessage = "This player has " + noteCount + " admin note" + (noteCount > 1 ? "s" : "") + ".";
|
||||
JSONMessage notice = JSONMessage.create(ChatColor.GOLD + noteMessage + " Click here to view them.")
|
||||
.tooltip("Click here to view them.")
|
||||
.runCommand("/notes " + player.getName() + " list");
|
||||
FLog.info(noteMessage);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.sl.isStaffImpostor(p))
|
||||
if (plugin.al.isAdminImpostor(p))
|
||||
{
|
||||
notice.send(p);
|
||||
}
|
||||
@ -257,9 +254,9 @@ public class LoginProcess extends FreedomService
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (ConfigEntry.STAFF_ONLY_MODE.getBoolean())
|
||||
if (ConfigEntry.ADMIN_ONLY_MODE.getBoolean())
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Server is currently closed to non-staff.");
|
||||
player.sendMessage(ChatColor.RED + "Server is currently closed to non-admins.");
|
||||
}
|
||||
|
||||
if (lockdownEnabled)
|
||||
|
Reference in New Issue
Block a user