This commit is contained in:
ZeroEpoch1969 2019-11-12 19:50:53 -07:00
parent a40785f31e
commit 5c1c06afa0
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3
2 changed files with 14 additions and 1 deletions

View File

@ -89,6 +89,11 @@
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
</repositories>
<dependencies>

View File

@ -35,6 +35,7 @@ public class Module_list extends HTTPDModule
final JSONArray senioradmins = new JSONArray();
final JSONArray developers = new JSONArray();
final JSONArray executives = new JSONArray();
final JSONArray owners = new JSONArray();
for (Player player : Bukkit.getOnlinePlayers())
{
@ -59,9 +60,13 @@ public class Module_list extends HTTPDModule
executives.add(player.getName());
}
if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
{
owners.add(player.getName());
}
if (!plugin.al.isAdmin(player) && !hasSpecialTitle(player))
{
FLog.info(player.getName() + " is an op");
operators.add(player.getName());
}
@ -92,6 +97,9 @@ public class Module_list extends HTTPDModule
responseObject.put("senioradmins", senioradmins);
responseObject.put("developers", developers);
responseObject.put("executives", executives);
responseObject.put("owners", owners);
responseObject.put("online", server.getOnlinePlayers().size());
responseObject.put("max", server.getMaxPlayers());
final NanoHTTPD.Response response = new NanoHTTPD.Response(NanoHTTPD.Response.Status.OK, NanoHTTPD.MIME_JSON, responseObject.toString());
response.addHeader("Access-Control-Allow-Origin", "*");