mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-05-15 04:11:17 +00:00
* Allows external apps to see online admins through API. This commit allows external apps/plugins to see which admins are online through the HTTP API. This could be used to develop plugins quicker, without needing to integrate them directly into TFM. * Fixed formatting error.
This commit is contained in:
parent
0b9960b0d9
commit
6448bc934a
|
@ -24,6 +24,7 @@ public class Module_players extends HTTPDModule
|
|||
final JSONObject responseObject = new JSONObject();
|
||||
|
||||
final JSONArray players = new JSONArray();
|
||||
final JSONArray onlineadmins = new JSONArray();
|
||||
final JSONArray superadmins = new JSONArray();
|
||||
final JSONArray telnetadmins = new JSONArray();
|
||||
final JSONArray senioradmins = new JSONArray();
|
||||
|
@ -33,6 +34,10 @@ public class Module_players extends HTTPDModule
|
|||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
players.add(player.getName());
|
||||
if (plugin.al.isAdmin(player) && !plugin.al.isAdminImpostor(player))
|
||||
{
|
||||
onlineadmins.add(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// Admins
|
||||
|
@ -58,6 +63,7 @@ public class Module_players extends HTTPDModule
|
|||
developers.addAll(FUtil.DEVELOPERS);
|
||||
|
||||
responseObject.put("players", players);
|
||||
responseObject.put("onlineadmins", onlineadmins);
|
||||
responseObject.put("superadmins", superadmins);
|
||||
responseObject.put("telnetadmins", telnetadmins);
|
||||
responseObject.put("senioradmins", senioradmins);
|
||||
|
|
Loading…
Reference in a new issue