Changeset 253 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Dec 12, 2015, 4:08:53 PM (9 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 2 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r251 r253 46 46 <Private>False</Private> 47 47 </Reference> 48 <Reference Include="System.Drawing">49 <HintPath>..\7dtd-binaries\System.Drawing.dll</HintPath>50 <Private>False</Private>51 </Reference>52 48 <Reference Include="UnityEngine"> 53 49 <HintPath>..\7dtd-binaries\UnityEngine.dll</HintPath> … … 92 88 <Compile Include="src\API.cs" /> 93 89 <Compile Include="src\ChatHookExample.cs" /> 94 <Compile Include="src\PetesUtils.cs" /> 90 <Compile Include="src\AllocsUtils.cs" /> 91 <Compile Include="src\LandClaimList.cs" /> 95 92 </ItemGroup> 96 93 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/ModInfo.xml
r250 r253 5 5 <Description value="Common functions" /> 6 6 <Author value="Christian 'Alloc' Illy" /> 7 <Version value=" 7" />7 <Version value="8" /> 8 8 <Website value="http://7dtd.illy.bz" /> 9 9 </ModInfo> -
binary-improvements/7dtd-server-fixes/src/PersistentData/InvItem.cs
r251 r253 5 5 { 6 6 [Serializable] 7 public class InvItem 8 { 7 public class InvItem { 9 8 public string itemName; 10 9 public int count; 11 10 public int quality; 12 11 public InvItem[] parts; 13 14 12 public string icon = ""; 13 public string iconcolor = ""; 15 14 16 public InvItem (string itemName, int count, int quality = -1) 17 { 15 public InvItem (string itemName, int count, int quality = -1) { 18 16 this.itemName = itemName; 19 17 this.count = count; -
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r251 r253 59 59 private InvItem CreateInvItem (ItemValue _itemValue, int _count, int _playerId) { 60 60 if (_count > 0 && _itemValue != null && !_itemValue.Equals (ItemValue.None)) { 61 int maxAllowed = ItemClass.list [_itemValue.type].Stacknumber.Value; 62 string name = ItemClass.list [_itemValue.type].GetItemName (); 61 ItemClass itemClass = ItemClass.list [_itemValue.type]; 62 int maxAllowed = itemClass.Stacknumber.Value; 63 string name = itemClass.GetItemName (); 63 64 64 65 if (_count > maxAllowed) { … … 73 74 } 74 75 75 // Figure out the icon's name 76 string icon_name = ""; 76 item.icon = itemClass.GetIconName (); 77 77 78 ItemClass item_class = ItemClass.list [_itemValue.type]; 79 80 if (!PetesUtils.ValidText (icon_name)) { 81 try { 82 icon_name = item_class.GetIconName (); 83 } 84 catch { } 85 } 86 87 if (!PetesUtils.ValidText (icon_name)) { 88 try { 89 icon_name = item_class.MeshFile; 90 } 91 catch { } 92 } 93 94 if (!PetesUtils.ValidText (icon_name)) { 95 try { 96 icon_name = item_class.DropMeshFile; 97 } 98 catch { } 99 } 100 101 if (!PetesUtils.ValidText (icon_name)) 102 icon_name = item_class.GetItemName (); 103 104 if (icon_name.Contains ("\\")) 105 icon_name = icon_name.Substring (icon_name.LastIndexOf ("\"") + 1); 106 107 item.icon = icon_name; 108 109 try { 110 item.iconcolor = item_class.CustomIconTint.ToHexStringRGB (); 111 } 112 catch { 113 item.iconcolor = "FFFFFF"; 114 } 78 item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ()); 115 79 116 80 return item; -
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r238 r253 96 96 } 97 97 98 public bool LandProtectionActive { 99 get { 100 return GameManager.Instance.World.IsLandProtectionValidForPlayer (GameManager.Instance.GetPersistentPlayerList ().GetPlayerData (SteamID)); 101 } 102 } 103 104 public float LandProtectionMultiplier { 105 get { 106 return GameManager.Instance.World.GetLandProtectionHardnessModifierForPlayer (GameManager.Instance.GetPersistentPlayerList ().GetPlayerData (SteamID)); 107 } 108 } 109 98 110 public uint Experience { 99 111 get { -
binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
r251 r253 6 6 namespace AllocsFixes.PersistentData 7 7 { 8 [Serializable] 9 public class Players 10 { 8 [Serializable] 9 public class Players { 11 10 private Dictionary<string, Player> players = new Dictionary<string, Player> (); 12 11 13 12 public Player this [string steamId, bool create] { 14 13 get { 15 if (players.ContainsKey (steamId)) 14 if (players.ContainsKey (steamId)) { 16 15 return players [steamId]; 17 else {16 } else { 18 17 if (create && steamId != null && steamId.Length == 17) { 19 18 Log.Out ("Created new player entry for ID: " + steamId); … … 44 43 // } 45 44 46 public string GetSteamID (string _nameOrId, bool _ignoreColorCodes) 47 { 48 if (_nameOrId == null || _nameOrId.Length == 0) 45 public string GetSteamID (string _nameOrId, bool _ignoreColorCodes) { 46 if (_nameOrId == null || _nameOrId.Length == 0) { 49 47 return null; 48 } 50 49 51 50 long tempLong;
Note:
See TracChangeset
for help on using the changeset viewer.