assistant executive title now exists

This commit is contained in:
ZeroEpoch1969 2019-11-24 11:56:32 -07:00
parent fd809a0d33
commit e0bbbbdda8
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3
7 changed files with 20 additions and 4 deletions

2
.idea/modules.xml generated
View File

@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/totalfreedom.iml" filepath="$PROJECT_DIR$/totalfreedom.iml" /> <module fileurl="file://$PROJECT_DIR$/TotalFreedomMod.iml" filepath="$PROJECT_DIR$/TotalFreedomMod.iml" />
</modules> </modules>
</component> </component>
</project> </project>

View File

@ -47,6 +47,7 @@ public enum ConfigEntry
SERVER_MOTD(String.class, "server.motd"), SERVER_MOTD(String.class, "server.motd"),
SERVER_OWNERS(List.class, "server.owners"), SERVER_OWNERS(List.class, "server.owners"),
SERVER_EXECUTIVES(List.class, "server.executives"), SERVER_EXECUTIVES(List.class, "server.executives"),
SERVER_ASSISTANT_EXECUTIVES(List.class, "server.assistant_executives"),
SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"), SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"),
SERVER_BAN_URL(String.class, "server.ban_url"), SERVER_BAN_URL(String.class, "server.ban_url"),
SERVER_PERMBAN_URL(String.class, "server.permban_url"), SERVER_PERMBAN_URL(String.class, "server.permban_url"),

View File

@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -34,6 +33,7 @@ public class Module_list extends HTTPDModule
final JSONArray telnetadmins = new JSONArray(); final JSONArray telnetadmins = new JSONArray();
final JSONArray senioradmins = new JSONArray(); final JSONArray senioradmins = new JSONArray();
final JSONArray developers = new JSONArray(); final JSONArray developers = new JSONArray();
final JSONArray assistant_executives = new JSONArray();
final JSONArray executives = new JSONArray(); final JSONArray executives = new JSONArray();
final JSONArray owners = new JSONArray(); final JSONArray owners = new JSONArray();
@ -60,6 +60,11 @@ public class Module_list extends HTTPDModule
executives.add(player.getName()); executives.add(player.getName());
} }
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && !FUtil.DEVELOPERS.contains(player.getName()))
{
executives.add(player.getName());
}
if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName())) if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
{ {
owners.add(player.getName()); owners.add(player.getName());
@ -96,6 +101,7 @@ public class Module_list extends HTTPDModule
responseObject.put("telnetadmins", telnetadmins); responseObject.put("telnetadmins", telnetadmins);
responseObject.put("senioradmins", senioradmins); responseObject.put("senioradmins", senioradmins);
responseObject.put("developers", developers); responseObject.put("developers", developers);
responseObject.put("assistant_executives", assistant_executives);
responseObject.put("executives", executives); responseObject.put("executives", executives);
responseObject.put("owners", owners); responseObject.put("owners", owners);
responseObject.put("online", server.getOnlinePlayers().size()); responseObject.put("online", server.getOnlinePlayers().size());
@ -140,7 +146,7 @@ public class Module_list extends HTTPDModule
public boolean hasSpecialTitle(Player player) public boolean hasSpecialTitle(Player player)
{ {
if (FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_OWNERS.getList().contains(player.getName())) if (FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
{ {
return true; return true;
} }

View File

@ -67,6 +67,11 @@ public class RankManager extends FreedomService
return Title.EXECUTIVE; return Title.EXECUTIVE;
} }
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
{
return Title.ASSISTANT_EXECUTIVE;
}
if (plugin.al.isVerifiedAdmin(player)) if (plugin.al.isVerifiedAdmin(player))
{ {
return Title.VERIFIED_ADMIN; return Title.VERIFIED_ADMIN;

View File

@ -8,6 +8,7 @@ public enum Title implements Displayable
MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, "MB"), MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, "MB"),
VERIFIED_ADMIN("a", "Verified Admin", ChatColor.LIGHT_PURPLE, "VA"), VERIFIED_ADMIN("a", "Verified Admin", ChatColor.LIGHT_PURPLE, "VA"),
ASSISTANT_EXECUTIVE("an", "Assistant Executive", ChatColor.RED, "Asst Exec"),
EXECUTIVE("an", "Executive", ChatColor.RED, "Exec"), EXECUTIVE("an", "Executive", ChatColor.RED, "Exec"),
DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, "Dev"), DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, "Dev"),
OWNER("the", "Owner", ChatColor.DARK_RED, "Owner"); OWNER("the", "Owner", ChatColor.DARK_RED, "Owner");

View File

@ -82,7 +82,7 @@ public class FUtil
public static boolean isExecutive(String name) public static boolean isExecutive(String name)
{ {
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name); return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getStringList().contains(name);
} }
public static boolean isDeveloper(String name) public static boolean isDeveloper(String name)

View File

@ -24,6 +24,9 @@ server:
# All players who show up as executive # All players who show up as executive
executives: [] executives: []
# All players who show up as assistant executive
assistant_executives: []
# All those who can manage the master builder list # All those who can manage the master builder list
master_builder_management: [] master_builder_management: []