source: binary-improvements2/MapRendering/Web/API/GetPlayerInventories.cs@ 383

Last change on this file since 383 was 383, checked in by alloc, 3 years ago

Fixed a bunch of warnings

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