mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
asot
This commit is contained in:
parent
a40785f31e
commit
5c1c06afa0
5
pom.xml
5
pom.xml
@ -89,6 +89,11 @@
|
|||||||
<id>sk89q-repo</id>
|
<id>sk89q-repo</id>
|
||||||
<url>http://maven.sk89q.com/repo/</url>
|
<url>http://maven.sk89q.com/repo/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>CodeMC</id>
|
||||||
|
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -35,6 +35,7 @@ public class Module_list extends HTTPDModule
|
|||||||
final JSONArray senioradmins = new JSONArray();
|
final JSONArray senioradmins = new JSONArray();
|
||||||
final JSONArray developers = new JSONArray();
|
final JSONArray developers = new JSONArray();
|
||||||
final JSONArray executives = new JSONArray();
|
final JSONArray executives = new JSONArray();
|
||||||
|
final JSONArray owners = new JSONArray();
|
||||||
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers())
|
for (Player player : Bukkit.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
@ -59,9 +60,13 @@ public class Module_list extends HTTPDModule
|
|||||||
executives.add(player.getName());
|
executives.add(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
|
||||||
|
{
|
||||||
|
owners.add(player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
if (!plugin.al.isAdmin(player) && !hasSpecialTitle(player))
|
if (!plugin.al.isAdmin(player) && !hasSpecialTitle(player))
|
||||||
{
|
{
|
||||||
FLog.info(player.getName() + " is an op");
|
|
||||||
operators.add(player.getName());
|
operators.add(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,6 +97,9 @@ public class Module_list extends HTTPDModule
|
|||||||
responseObject.put("senioradmins", senioradmins);
|
responseObject.put("senioradmins", senioradmins);
|
||||||
responseObject.put("developers", developers);
|
responseObject.put("developers", developers);
|
||||||
responseObject.put("executives", executives);
|
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());
|
final NanoHTTPD.Response response = new NanoHTTPD.Response(NanoHTTPD.Response.Status.OK, NanoHTTPD.MIME_JSON, responseObject.toString());
|
||||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
Loading…
Reference in New Issue
Block a user