Changeset 145 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Aug 30, 2014, 6:32:41 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CustomCommands/ShowInventory.cs
r144 r145 29 29 } 30 30 31 string steamid = PersistentContainer.Instance.Players.GetSteamID (_params[0], true);31 string steamid = PersistentContainer.Instance.Players.GetSteamID (_params [0], true); 32 32 if (steamid == null) { 33 33 m_Console.SendResult ("Playername or entity/steamid id not found or no inventory saved (first saved after a player has been online for 30s)."); … … 35 35 } 36 36 37 Log.Out ( "SteamID: " + steamid); 38 39 Player p = PersistentContainer.Instance.Players[steamid]; 40 41 Log.Out ("Player"); 42 37 Player p = PersistentContainer.Instance.Players [steamid]; 43 38 PersistentData.Inventory inv = p.Inventory; 44 45 Log.Out ("Inv");46 39 47 40 m_Console.SendResult ("Belt of player:"); 48 41 for (int i = 0; i < inv.belt.Count; i++) { 49 m_Console.SendResult (string.Format (" Slot {0}: {1:000} * {2}", i, inv.belt[i].count, inv.belt[i].itemName)); 42 if (inv.belt [i] != null) 43 m_Console.SendResult (string.Format (" Slot {0}: {1:000} * {2}", i, inv.belt [i].count, inv.belt [i].itemName)); 50 44 } 51 45 m_Console.SendResult (string.Empty); 52 46 m_Console.SendResult ("Bagpack of player:"); 53 47 for (int i = 0; i < inv.bag.Count; i++) { 54 m_Console.SendResult (string.Format (" Slot {0}: {1:000} * {2}", i, inv.bag[i].count, inv.bag[i].itemName)); 48 if (inv.bag [i] != null) 49 m_Console.SendResult (string.Format (" Slot {0}: {1:000} * {2}", i, inv.bag [i].count, inv.bag [i].itemName)); 55 50 } 56 51 m_Console.SendResult (string.Empty); -
binary-improvements/7dtd-server-fixes/src/PersistentData/InvItem.cs
r144 r145 12 12 public InvItem (string itemName, int count) 13 13 { 14 this.itemName = itemName; 15 this.count = count; 14 16 } 15 17 } -
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r144 r145 23 23 ProcessInv (bag, pdf.bag); 24 24 ProcessInv (belt, pdf.inventory); 25 Log.Out ("Now: belt: " + belt.Count + " - bag: " + bag.Count);26 25 } 27 26 -
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r144 r145 24 24 public int EntityID { 25 25 get { return entityId; } 26 set { entityId = value; }27 26 } 28 27 29 28 public string Name { 30 29 get { return name; } 31 set { name = value; }32 30 } 33 31 34 32 public string IP { 35 33 get { return ip; } 36 set { ip = value; }37 34 } 38 35 -
binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
r144 r145 47 47 } 48 48 } 49 } 49 50 50 _nameOrId = _nameOrId.ToLower (); 51 foreach (KeyValuePair<string, Player> kvp in players) { 52 string name = kvp.Value.Name.ToLower (); 53 if (_ignoreColorCodes) { 54 name = Regex.Replace (name, "\\[[0-9a-fA-F]{6}\\]", ""); 55 } 56 if (kvp.Value.IsOnline && kvp.Value.Name.Equals (name)) { 57 return kvp.Key; 58 } 51 _nameOrId = _nameOrId.ToLower (); 52 foreach (KeyValuePair<string, Player> kvp in players) { 53 string name = kvp.Value.Name.ToLower (); 54 if (_ignoreColorCodes) { 55 name = Regex.Replace (name, "\\[[0-9a-fA-F]{6}\\]", ""); 56 } 57 if (kvp.Value.IsOnline && name.Equals (_nameOrId)) { 58 return kvp.Key; 59 59 } 60 60 } -
binary-improvements/7dtd-server-fixes/src/StateManager.cs
r144 r145 18 18 { 19 19 try { 20 Log.Out ("Server shutting down!"); 20 21 PersistentData.PersistentContainer.Instance.Save (); 21 22 } catch (Exception e) {
Note:
See TracChangeset
for help on using the changeset viewer.