Line | |
---|
1 | using System.Collections.Generic;
|
---|
2 | using System.Net;
|
---|
3 | using AllocsFixes.JSON;
|
---|
4 | using AllocsFixes.PersistentData;
|
---|
5 |
|
---|
6 | namespace AllocsFixes.NetConnections.Servers.Web.API {
|
---|
7 | public class GetPlayerInventories : WebAPI {
|
---|
8 | public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
|
---|
9 | int _permissionLevel) {
|
---|
10 | GetPlayerInventory.GetInventoryArguments (_req, out bool showIconColor, out bool showIconName);
|
---|
11 |
|
---|
12 | JSONArray AllInventoriesResult = new JSONArray ();
|
---|
13 |
|
---|
14 | foreach (KeyValuePair<PlatformUserIdentifierAbs, Player> kvp in PersistentContainer.Instance.Players.Dict) {
|
---|
15 | Player p = kvp.Value;
|
---|
16 |
|
---|
17 | if (p == null) {
|
---|
18 | continue;
|
---|
19 | }
|
---|
20 |
|
---|
21 | if (p.IsOnline) {
|
---|
22 | AllInventoriesResult.Add (GetPlayerInventory.DoPlayer (p, showIconColor, showIconName));
|
---|
23 | }
|
---|
24 | }
|
---|
25 |
|
---|
26 | WriteJSON (_resp, AllInventoriesResult);
|
---|
27 | }
|
---|
28 | }
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.