Allow telnets to verify master builders, and mb httpd addition.

This commit is contained in:
ZeroEpoch1969 2018-05-21 19:49:03 -07:00
parent 69e82b5746
commit baf367b003
No known key found for this signature in database
GPG Key ID: E0AAB104FB9F8FDF
2 changed files with 16 additions and 5 deletions

View File

@ -85,11 +85,7 @@ public class Command_mbconfig extends FreedomCommand
}
checkConsole();
checkRank(Rank.SENIOR_ADMIN);
if (!FUtil.isExecutive(sender.getName()))
{
noPerms();
}
checkRank(Rank.TELNET_ADMIN);
// Player already on the list?
final Player player = getPlayer(args[1]);
@ -113,6 +109,12 @@ public class Command_mbconfig extends FreedomCommand
if (masterBuilder == null) // New entry
{
checkRank(Rank.SENIOR_ADMIN);
if (!FUtil.isExecutive(sender.getName()))
{
noPerms();
}
if (player == null)
{
msg(FreedomCommand.PLAYER_NOT_FOUND);

View File

@ -3,6 +3,7 @@ package me.totalfreedom.totalfreedommod.httpd.module;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@ -24,6 +25,7 @@ public class Module_players extends HTTPDModule
final JSONObject responseObject = new JSONObject();
final JSONArray players = new JSONArray();
final JSONArray masterbuilders = new JSONArray();
final JSONArray superadmins = new JSONArray();
final JSONArray telnetadmins = new JSONArray();
final JSONArray senioradmins = new JSONArray();
@ -54,10 +56,17 @@ public class Module_players extends HTTPDModule
}
}
// Master Builders
for (MasterBuilder masterBuilder : plugin.mbl.getAllMasterBuilders().values())
{
masterbuilders.add(masterBuilder.getName());
}
// Developers
developers.addAll(FUtil.DEVELOPERS);
responseObject.put("players", players);
responseObject.put("masterbuilders", masterbuilders);
responseObject.put("superadmins", superadmins);
responseObject.put("telnetadmins", telnetadmins);
responseObject.put("senioradmins", senioradmins);