Rev | Line | |
---|
[332] | 1 | using System.Collections.Generic;
|
---|
[321] | 2 | using AllocsFixes.JSON;
|
---|
| 3 | using AllocsFixes.PersistentData;
|
---|
[382] | 4 | using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;
|
---|
| 5 | using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
|
---|
[321] | 6 |
|
---|
| 7 | namespace 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.