mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 19:46:42 +00:00
Revert "Merge branch 'development' of https://github.com/TFPatches/TotalFreedomMod into development"
This reverts commit4407e9e6ec
, reversing changes made toe4c9ea656e
.
This commit is contained in:
@ -9,11 +9,11 @@ public enum Rank implements Displayable
|
||||
IMPOSTOR("an", "Impostor", Type.PLAYER, "Imp", ChatColor.YELLOW, null, false),
|
||||
NON_OP("a", "Non-Op", Type.PLAYER, "", ChatColor.WHITE, null, false),
|
||||
OP("an", "Operator", Type.PLAYER, "OP", ChatColor.GREEN, null, false),
|
||||
TRIAL_MOD("a", "Trial Moderator", Type.STAFF, "Trial Mod", ChatColor.AQUA, org.bukkit.ChatColor.AQUA, true),
|
||||
MOD("a", "Moderator", Type.STAFF, "Mod", ChatColor.DARK_GREEN, org.bukkit.ChatColor.DARK_GREEN, true),
|
||||
ADMIN("a", "Administrator", Type.STAFF, "Administrator", ChatColor.GOLD, org.bukkit.ChatColor.GOLD, true),
|
||||
MOD_CONSOLE("the", "Console", Type.STAFF_CONSOLE, "Console", ChatColor.DARK_PURPLE, null, false),
|
||||
ADMIN_CONSOLE("the", "Console", Type.STAFF_CONSOLE, "Console", ChatColor.DARK_PURPLE, null, false);
|
||||
SUPER_ADMIN("a", "Super Admin", Type.ADMIN, "SA", ChatColor.AQUA, org.bukkit.ChatColor.AQUA, true),
|
||||
TELNET_ADMIN("a", "Telnet Admin", Type.ADMIN, "STA", ChatColor.DARK_GREEN, org.bukkit.ChatColor.DARK_GREEN, true),
|
||||
SENIOR_ADMIN("a", "Senior Admin", Type.ADMIN, "SrA", ChatColor.GOLD, org.bukkit.ChatColor.GOLD, true),
|
||||
TELNET_CONSOLE("the", "Console", Type.ADMIN_CONSOLE, "Console", ChatColor.DARK_PURPLE, null, false),
|
||||
SENIOR_CONSOLE("the", "Console", Type.ADMIN_CONSOLE, "Console", ChatColor.DARK_PURPLE, null, false);
|
||||
@Getter
|
||||
private final Type type;
|
||||
@Getter
|
||||
@ -71,7 +71,7 @@ public enum Rank implements Displayable
|
||||
|
||||
public boolean isConsole()
|
||||
{
|
||||
return getType() == Type.STAFF_CONSOLE;
|
||||
return getType() == Type.ADMIN_CONSOLE;
|
||||
}
|
||||
|
||||
public int getLevel()
|
||||
@ -96,7 +96,7 @@ public enum Rank implements Displayable
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
return getType() == Type.STAFF || getType() == Type.STAFF_CONSOLE;
|
||||
return getType() == Type.ADMIN || getType() == Type.ADMIN_CONSOLE;
|
||||
}
|
||||
|
||||
public boolean hasConsoleVariant()
|
||||
@ -108,12 +108,12 @@ public enum Rank implements Displayable
|
||||
{
|
||||
switch (this)
|
||||
{
|
||||
case MOD:
|
||||
case MOD_CONSOLE:
|
||||
return MOD_CONSOLE;
|
||||
case ADMIN:
|
||||
case ADMIN_CONSOLE:
|
||||
return ADMIN_CONSOLE;
|
||||
case TELNET_ADMIN:
|
||||
case TELNET_CONSOLE:
|
||||
return TELNET_CONSOLE;
|
||||
case SENIOR_ADMIN:
|
||||
case SENIOR_CONSOLE:
|
||||
return SENIOR_CONSOLE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@ -136,8 +136,8 @@ public enum Rank implements Displayable
|
||||
{
|
||||
|
||||
PLAYER,
|
||||
STAFF,
|
||||
STAFF_CONSOLE;
|
||||
ADMIN,
|
||||
ADMIN_CONSOLE;
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.rank;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
@ -39,7 +39,7 @@ public class RankManager extends FreedomService
|
||||
final Player player = (Player)sender;
|
||||
|
||||
// Display impostors
|
||||
if (plugin.sl.isAdminImpostor(player))
|
||||
if (plugin.al.isAdminImpostor(player))
|
||||
{
|
||||
return Rank.IMPOSTOR;
|
||||
}
|
||||
@ -56,29 +56,29 @@ public class RankManager extends FreedomService
|
||||
return Title.DEVELOPER;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) && plugin.sl.isStaff(player))
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.sl.isStaff(player))
|
||||
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.ASSISTANT_EXECUTIVE;
|
||||
}
|
||||
|
||||
if (plugin.sl.isVerifiedAdmin(player))
|
||||
if (plugin.al.isVerifiedAdmin(player))
|
||||
{
|
||||
return Title.VERIFIED_ADMIN;
|
||||
}
|
||||
|
||||
// Master builders show up if they are not admins
|
||||
if (plugin.pl.getData(player).isMasterBuilder() && !plugin.sl.isStaff(player))
|
||||
if (plugin.pl.getData(player).isMasterBuilder() && !plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.MASTER_BUILDER;
|
||||
}
|
||||
|
||||
PlayerData playerData = plugin.pl.getData(player);
|
||||
if (!plugin.sl.isStaff(player) && playerData.isDonator())
|
||||
if (!plugin.al.isAdmin(player) && playerData.isDonator())
|
||||
{
|
||||
return Title.DONATOR;
|
||||
}
|
||||
@ -86,26 +86,26 @@ public class RankManager extends FreedomService
|
||||
return getRank(player);
|
||||
}
|
||||
|
||||
public Displayable getDisplay(StaffMember staffMember)
|
||||
public Displayable getDisplay(Admin admin)
|
||||
{
|
||||
// If the player's an owner, display that
|
||||
if (ConfigEntry.SERVER_OWNERS.getList().contains(staffMember.getName()))
|
||||
if (ConfigEntry.SERVER_OWNERS.getList().contains(admin.getName()))
|
||||
{
|
||||
return Title.OWNER;
|
||||
}
|
||||
|
||||
// Developers always show up
|
||||
if (FUtil.isDeveloper(staffMember.getName()))
|
||||
if (FUtil.isDeveloper(admin.getName()))
|
||||
{
|
||||
return Title.DEVELOPER;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(staffMember.getName()))
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(admin.getName()))
|
||||
{
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
return staffMember.getRank();
|
||||
return admin.getRank();
|
||||
}
|
||||
|
||||
public Rank getRank(CommandSender sender)
|
||||
@ -118,19 +118,19 @@ public class RankManager extends FreedomService
|
||||
// CONSOLE?
|
||||
if (sender.getName().equals("CONSOLE"))
|
||||
{
|
||||
return ConfigEntry.STAFFLIST_CONSOLE_IS_SENIOR.getBoolean() ? Rank.ADMIN_CONSOLE : Rank.MOD_CONSOLE;
|
||||
return ConfigEntry.ADMINLIST_CONSOLE_IS_SENIOR.getBoolean() ? Rank.SENIOR_CONSOLE : Rank.TELNET_CONSOLE;
|
||||
}
|
||||
|
||||
// Console admin, get by name
|
||||
StaffMember staffMember = plugin.sl.getEntryByName(sender.getName());
|
||||
Admin admin = plugin.al.getEntryByName(sender.getName());
|
||||
|
||||
// Unknown console: RCON?
|
||||
if (staffMember == null)
|
||||
if (admin == null)
|
||||
{
|
||||
return Rank.ADMIN_CONSOLE;
|
||||
return Rank.SENIOR_CONSOLE;
|
||||
}
|
||||
|
||||
Rank rank = staffMember.getRank();
|
||||
Rank rank = admin.getRank();
|
||||
|
||||
// Get console
|
||||
if (rank.hasConsoleVariant())
|
||||
@ -142,12 +142,12 @@ public class RankManager extends FreedomService
|
||||
|
||||
public Rank getRank(Player player)
|
||||
{
|
||||
if (plugin.sl.isAdminImpostor(player) || plugin.pl.isPlayerImpostor(player))
|
||||
if (plugin.al.isAdminImpostor(player) || plugin.pl.isPlayerImpostor(player))
|
||||
{
|
||||
return Rank.IMPOSTOR;
|
||||
}
|
||||
|
||||
final StaffMember entry = plugin.sl.getAdmin(player);
|
||||
final Admin entry = plugin.al.getAdmin(player);
|
||||
if (entry != null)
|
||||
{
|
||||
return entry.getRank();
|
||||
@ -179,7 +179,7 @@ public class RankManager extends FreedomService
|
||||
FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||
PlayerData data = plugin.pl.getData(player);
|
||||
Displayable display = getDisplay(player);
|
||||
if (plugin.sl.isStaff(player) || data.isMasterBuilder() || data.isDonator() || FUtil.isDeveloper(player.getName()))
|
||||
if (plugin.al.isAdmin(player) || data.isMasterBuilder() || data.isDonator() || FUtil.isDeveloper(player.getName()))
|
||||
{
|
||||
String displayName = display.getColor() + player.getName();
|
||||
player.setPlayerListName(displayName);
|
||||
@ -203,11 +203,11 @@ public class RankManager extends FreedomService
|
||||
PlayerData target = plugin.pl.getData(player);
|
||||
|
||||
// Unban admins
|
||||
boolean isAdmin = plugin.sl.isStaff(player);
|
||||
boolean isAdmin = plugin.al.isAdmin(player);
|
||||
if (isAdmin)
|
||||
{
|
||||
// Verify strict IP match
|
||||
if (!plugin.sl.isIdentityMatched(player))
|
||||
if (!plugin.al.isIdentityMatched(player))
|
||||
{
|
||||
FUtil.bcastMsg("Warning: " + player.getName() + " is an admin, but is using an account not registered to one of their ip-list.", ChatColor.RED);
|
||||
fPlayer.setSuperadminIdVerified(false);
|
||||
@ -215,21 +215,21 @@ public class RankManager extends FreedomService
|
||||
else
|
||||
{
|
||||
fPlayer.setSuperadminIdVerified(true);
|
||||
plugin.sl.updateLastLogin(player);
|
||||
plugin.al.updateLastLogin(player);
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.sl.isVerifiedAdmin(player))
|
||||
if (plugin.al.isVerifiedAdmin(player))
|
||||
{
|
||||
FUtil.bcastMsg("Warning: " + player.getName() + " is an admin, but does not have any admin permissions.", ChatColor.RED);
|
||||
}
|
||||
|
||||
// Handle impostors
|
||||
boolean isImpostor = plugin.sl.isAdminImpostor(player) || plugin.pl.isPlayerImpostor(player);
|
||||
boolean isImpostor = plugin.al.isAdminImpostor(player) || plugin.pl.isPlayerImpostor(player);
|
||||
if (isImpostor)
|
||||
{
|
||||
FUtil.bcastMsg(ChatColor.AQUA + player.getName() + " is " + Rank.IMPOSTOR.getColoredLoginMessage());
|
||||
if (plugin.sl.isAdminImpostor(player))
|
||||
if (plugin.al.isAdminImpostor(player))
|
||||
{
|
||||
FUtil.bcastMsg("Warning: " + player.getName() + " has been flagged as an admin impostor and has been frozen!", ChatColor.RED);
|
||||
}
|
||||
@ -250,7 +250,7 @@ public class RankManager extends FreedomService
|
||||
// Broadcast login message
|
||||
if (isAdmin || FUtil.isDeveloper(player.getName()) || plugin.pl.getData(player).isMasterBuilder() || plugin.pl.getData(player).isDonator())
|
||||
{
|
||||
if (!plugin.sl.isVanished(player))
|
||||
if (!plugin.al.isVanished(player))
|
||||
{
|
||||
FUtil.bcastMsg(craftLoginMessage(player, null));
|
||||
}
|
||||
@ -272,14 +272,14 @@ public class RankManager extends FreedomService
|
||||
{
|
||||
Displayable display = plugin.rm.getDisplay(player);
|
||||
String loginMessage = ChatColor.AQUA + player.getName() + " is " + display.getColoredLoginMessage();
|
||||
if (plugin.sl.isStaff(player))
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
StaffMember staffMember = plugin.sl.getAdmin(player);
|
||||
if (staffMember.hasLoginMessage())
|
||||
Admin admin = plugin.al.getAdmin(player);
|
||||
if (admin.hasLoginMessage())
|
||||
{
|
||||
if (message == null)
|
||||
{
|
||||
message = staffMember.getLoginMessage();
|
||||
message = admin.getLoginMessage();
|
||||
}
|
||||
loginMessage = FUtil.colorize(ChatColor.AQUA + (message.contains("%name%") ? "" : player.getName() + " is ")
|
||||
+ FUtil.colorize(message).replace("%name%", player.getName())
|
||||
|
Reference in New Issue
Block a user