Changeset 276 for binary-improvements/7dtd-server-fixes
- Timestamp:
- May 18, 2016, 4:56:14 PM (9 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/ModInfo.xml
r273 r276 5 5 <Description value="Common functions" /> 6 6 <Author value="Christian 'Alloc' Illy" /> 7 <Version value="1 0" />7 <Version value="11" /> 8 8 <Website value="http://7dtd.illy.bz" /> 9 9 </ModInfo> -
binary-improvements/7dtd-server-fixes/src/ChatHookExample.cs
r273 r276 14 14 GameManager.Instance.GameMessageServer (_cInfo, EnumGameMessages.Chat, string.Format("!{0}", _message), _playerName, false, "", false); 15 15 } else { 16 Log.Error (" Argument _cInfo null on message: {0}", _message);16 Log.Error ("ChatHookExample: Argument _cInfo null on message: {0}", _message); 17 17 } 18 18 return false; -
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r273 r276 26 26 [OptionalField] 27 27 private int maxChatLength; 28 [OptionalField] 29 private uint expToNextLevel; 30 [OptionalField] 31 private int level; 32 28 33 [NonSerialized] 29 34 private ClientInfo … … 112 117 } 113 118 119 120 // Deprecated 114 121 public uint Experience { 115 122 get { 116 return experience;123 return 0; 117 124 } 118 125 } … … 120 127 public float Level { 121 128 get { 122 float perc = (float)experience / 600000;123 perc = Mathf.Sqrt (perc);124 return Mathf.Clamp ((perc * 60) + 1, 1, 60);129 float expForNextLevel = (int)Math.Min ((Progression.BaseExpToLevel * Mathf.Pow (Progression.ExpMultiplier, level + 1)), int.MaxValue); 130 float fLevel = level + 1f - ((float)expToNextLevel / expForNextLevel); 131 return fLevel; 125 132 } 126 133 } … … 176 183 177 184 public void Update (PlayerDataFile _pdf) { 178 experience = _pdf.experience; 185 experience = 0; 186 expToNextLevel = _pdf.experience; 187 level = _pdf.level; 179 188 inventory.Update (_pdf); 180 189 } -
binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
r253 r276 12 12 public Player this [string steamId, bool create] { 13 13 get { 14 if (players.ContainsKey (steamId)) { 14 if (string.IsNullOrEmpty (steamId)) { 15 return null; 16 } else if (players.ContainsKey (steamId)) { 15 17 return players [steamId]; 16 18 } else {
Note:
See TracChangeset
for help on using the changeset viewer.