Changeset 197 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Sep 21, 2014, 7:20:16 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r196 r197 124 124 <Compile Include="src\JSON\MalformedJSONException.cs" /> 125 125 <Compile Include="src\CustomCommands\Unban.cs" /> 126 <Compile Include="src\ItemList.cs" /> 126 127 </ItemGroup> 127 128 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/src/CustomCommands/Give.cs
r130 r197 36 36 } 37 37 38 ItemBase item = null; 39 40 foreach (ItemBase ib in ItemBase.list) { 41 if (ib.name != null && ib.name.ToLower ().Equals (_params [1].ToLower ())) { 42 item = ib; 43 break; 44 } 45 } 46 47 if (item == null) { 38 Nullable<ItemValue> iv = ItemList.Instance.GetItemValue(_params[1]); 39 if (iv == null) { 48 40 m_Console.SendResult ("Item not found."); 49 41 return; … … 57 49 58 50 EntityPlayer p = CommonMappingFunctions.GetEntityPlayer (ci); 59 CommonMappingFunctions.GetGameManager ().DropEntityItemServer ( item.itemID, n, p.GetPosition (), Vector3.zero, Vector3.zero, 50, CommonMappingFunctions.GetEntityID (ci));51 CommonMappingFunctions.GetGameManager ().DropEntityItemServer ((int)iv.Value.rawData, n, p.GetPosition (), Vector3.zero, Vector3.zero, 50, CommonMappingFunctions.GetEntityID (ci)); 60 52 61 53 m_Console.SendResult ("Dropped item"); -
binary-improvements/7dtd-server-fixes/src/CustomCommands/ListItems.cs
r130 r197 29 29 30 30 int n = 0; 31 foreach ( ItemBase ib in ItemBase.list) {32 if ( ib.name != null && ib.name.ToLower ().Contains (_params [0].ToLower ())) {33 m_Console.SendResult (" " + ib.name);31 foreach (string s in ItemList.Instance.ItemNames) { 32 if (s.ToLower ().Contains (_params [0].ToLower ())) { 33 m_Console.SendResult (" " + s); 34 34 n++; 35 35 } -
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r192 r197 21 21 { 22 22 //Log.Out ("Updating player inventory - player id: " + pdf.id); 23 ProcessInv (bag, pdf.bag );24 ProcessInv (belt, pdf.inventory );23 ProcessInv (bag, pdf.bag, pdf.id); 24 ProcessInv (belt, pdf.inventory, pdf.id); 25 25 } 26 26 27 private void ProcessInv (List<InvItem> target, InventoryField[] sourceFields )27 private void ProcessInv (List<InvItem> target, InventoryField[] sourceFields, int id) 28 28 { 29 29 lock (target) { … … 32 32 if (sourceFields [i].count > 0) { 33 33 int count = sourceFields [i].count; 34 int maxAllowed = ItemBase.list [sourceFields [i].itemValue.type].StackNumber; 34 35 string name = getInvFieldName (sourceFields [i]); 35 36 37 if (count > maxAllowed) 38 Log.Out ("Player with ID " + id + " has stack for \"" + name + "\" greater than allowed (" + count + " > " + maxAllowed + ")"); 36 39 target.Add (new InvItem (name, count)); 37 40 } else { … … 45 48 { 46 49 ItemBase iBase = ItemBase.list [item.itemValue.type]; 47 return iBase.GetItemName (item.itemValue);50 return iBase.GetItemName (item.itemValue); 48 51 } 49 52 -
binary-improvements/7dtd-server-fixes/src/StateManager.cs
r182 r197 12 12 try { 13 13 Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version); 14 new Web ();15 new Telnet ();14 new Web (); 15 new Telnet (); 16 16 17 ItemList.Instance.Init (); 17 18 CommandExtensions.InitCommandExtensions (manager); 18 19
Note:
See TracChangeset
for help on using the changeset viewer.