Ignore:
Timestamp:
Jan 19, 2019, 5:13:47 PM (6 years ago)
Author:
alloc
Message:

Fixed #156

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/Web/API/GetPlayerInventories.cs

    r332 r348  
    66namespace AllocsFixes.NetConnections.Servers.Web.API {
    77        public class GetPlayerInventories : WebAPI {
    8                 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
    9                         int permissionLevel) {
     8                public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
     9                        int _permissionLevel) {
     10
     11                        bool showIconColor, showIconName;
     12                        GetPlayerInventory.GetInventoryArguments (_req, out showIconColor, out showIconName);
     13
    1014                        JSONArray AllInventoriesResult = new JSONArray ();
    1115
     
    1822
    1923                                if (p.IsOnline) {
    20                                         PersistentData.Inventory inv = p.Inventory;
    21 
    22                                         JSONObject result = new JSONObject ();
    23                                         JSONArray bag = new JSONArray ();
    24                                         JSONArray belt = new JSONArray ();
    25                                         JSONObject equipment = new JSONObject ();
    26                                         result.Add ("steamid", new JSONString (kvp.Key));
    27                                         result.Add ("entityid", new JSONNumber (p.EntityID));
    28                                         result.Add ("playername", new JSONString (p.Name));
    29                                         result.Add ("bag", bag);
    30                                         result.Add ("belt", belt);
    31                                         result.Add ("equipment", equipment);
    32 
    33                                         GetPlayerInventory.DoInventory (belt, inv.belt);
    34                                         GetPlayerInventory.DoInventory (bag, inv.bag);
    35 
    36                                         GetPlayerInventory.AddEquipment (equipment, "head", inv.equipment, EquipmentSlots.Headgear);
    37                                         GetPlayerInventory.AddEquipment (equipment, "eyes", inv.equipment, EquipmentSlots.Eyewear);
    38                                         GetPlayerInventory.AddEquipment (equipment, "face", inv.equipment, EquipmentSlots.Face);
    39 
    40                                         GetPlayerInventory.AddEquipment (equipment, "armor", inv.equipment, EquipmentSlots.ChestArmor);
    41                                         GetPlayerInventory.AddEquipment (equipment, "jacket", inv.equipment, EquipmentSlots.Jacket);
    42                                         GetPlayerInventory.AddEquipment (equipment, "shirt", inv.equipment, EquipmentSlots.Shirt);
    43 
    44                                         GetPlayerInventory.AddEquipment (equipment, "legarmor", inv.equipment, EquipmentSlots.LegArmor);
    45                                         GetPlayerInventory.AddEquipment (equipment, "pants", inv.equipment, EquipmentSlots.Legs);
    46                                         GetPlayerInventory.AddEquipment (equipment, "boots", inv.equipment, EquipmentSlots.Feet);
    47 
    48                                         GetPlayerInventory.AddEquipment (equipment, "gloves", inv.equipment, EquipmentSlots.Hands);
    49 
    50                                         AllInventoriesResult.Add (result);
     24                                        AllInventoriesResult.Add (GetPlayerInventory.DoPlayer (kvp.Key, p, showIconName, showIconName));
    5125                                }
    5226                        }
    5327
    54                         WriteJSON (resp, AllInventoriesResult);
     28                        WriteJSON (_resp, AllInventoriesResult);
    5529                }
    5630        }
Note: See TracChangeset for help on using the changeset viewer.