- Timestamp:
- Oct 29, 2019, 11:20:45 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/ShowInventory.cs
r325 r359 25 25 26 26 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) { 27 try { 28 if (_params.Count < 1) { 29 SdtdConsole.Instance.Output ("Usage: showinventory <steamid|playername|entityid> [tag]"); 30 return; 31 } 27 if (_params.Count < 1) { 28 SdtdConsole.Instance.Output ("Usage: showinventory <steamid|playername|entityid> [tag]"); 29 return; 30 } 32 31 33 34 35 36 37 38 32 string steamid = PersistentContainer.Instance.Players.GetSteamID (_params [0], true); 33 if (steamid == null) { 34 SdtdConsole.Instance.Output ( 35 "Playername or entity/steamid id not found or no inventory saved (first saved after a player has been online for 30s)."); 36 return; 37 } 39 38 40 41 42 43 39 string tag = null; 40 if (_params.Count > 1 && _params [1].Length > 0) { 41 tag = _params [1]; 42 } 44 43 45 46 44 Player p = PersistentContainer.Instance.Players [steamid, false]; 45 PersistentData.Inventory inv = p.Inventory; 47 46 48 49 50 47 if (tag == null) { 48 SdtdConsole.Instance.Output ("Belt of player " + p.Name + ":"); 49 } 51 50 52 53 54 55 51 PrintInv (inv.belt, p.EntityID, "belt", tag); 52 if (tag == null) { 53 SdtdConsole.Instance.Output (string.Empty); 54 } 56 55 57 58 59 56 if (tag == null) { 57 SdtdConsole.Instance.Output ("Bagpack of player " + p.Name + ":"); 58 } 60 59 61 62 63 64 60 PrintInv (inv.bag, p.EntityID, "backpack", tag); 61 if (tag == null) { 62 SdtdConsole.Instance.Output (string.Empty); 63 } 65 64 66 67 68 65 if (tag == null) { 66 SdtdConsole.Instance.Output ("Equipment of player " + p.Name + ":"); 67 } 69 68 70 69 PrintEquipment (inv.equipment, p.EntityID, "equipment", tag); 71 70 72 if (tag != null) { 73 SdtdConsole.Instance.Output ("tracker_item id=" + p.EntityID + ", tag=" + tag + 74 ", SHOWINVENTORY DONE"); 75 } 76 } catch (Exception e) { 77 Log.Out ("Error in ShowInventory.Run: " + e); 71 if (tag != null) { 72 SdtdConsole.Instance.Output ("tracker_item id=" + p.EntityID + ", tag=" + tag + 73 ", SHOWINVENTORY DONE"); 78 74 } 79 75 }
Note:
See TracChangeset
for help on using the changeset viewer.