Changeset 192
- Timestamp:
- Sep 17, 2014, 12:34:39 PM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs
r189 r192 22 22 } 23 23 24 private static object lockObject = new object (); 24 25 private MapRenderBlockBuffer[] zoomLevelBuffers; 25 26 private Dictionary<Vector2i, Color[]> dirtyChunks = new Dictionary<Vector2i, Color[]> (); … … 33 34 Constants.MAP_DIRECTORY = StaticDirectories.GetSaveGameDir () + "/map"; 34 35 35 if (File.Exists (Constants.MAP_DIRECTORY + "/mapinfo.json")) { 36 LoadMapInfo (); 37 } else { 38 WriteMapInfo (); 36 lock (lockObject) { 37 if (!LoadMapInfo ()) 38 WriteMapInfo (); 39 39 } 40 40 … … 55 55 try { 56 56 if (!Instance.renderingFullMap) { 57 lock ( Instance.zoomLevelBuffers) {57 lock (lockObject) { 58 58 Chunk c = (Chunk)o; 59 59 Vector3i cPos = c.GetWorldPos (); … … 100 100 ); 101 101 102 lock ( Instance.zoomLevelBuffers) {102 lock (lockObject) { 103 103 for (int i = 0; i < Constants.ZOOMLEVELS; i++) { 104 104 zoomLevelBuffers [i].ResetBlock (); … … 172 172 private void TimedRendering (object source, System.Timers.ElapsedEventArgs e) 173 173 { 174 lock ( zoomLevelBuffers) {174 lock (lockObject) { 175 175 RenderDirtyChunks (); 176 176 if (dirtyChunks.Count > 0) … … 251 251 } 252 252 253 private voidLoadMapInfo ()253 private bool LoadMapInfo () 254 254 { 255 255 if (File.Exists (Constants.MAP_DIRECTORY + "/mapinfo.json")) { 256 256 string json = File.ReadAllText (Constants.MAP_DIRECTORY + "/mapinfo.json", Encoding.UTF8); 257 JSONNode node = Parser.Parse (json); 258 if (node is JSONObject) { 259 JSONObject jo = (JSONObject)node; 260 if (jo.ContainsKey ("blockSize")) 261 Constants.MAP_BLOCK_SIZE = ((JSONNumber)jo ["blockSize"]).GetInt (); 262 if (jo.ContainsKey ("maxZoom")) 263 Constants.ZOOMLEVELS = ((JSONNumber)jo ["maxZoom"]).GetInt () + 1; 264 } 265 } 257 try { 258 JSONNode node = Parser.Parse (json); 259 if (node is JSONObject) { 260 JSONObject jo = (JSONObject)node; 261 if (jo.ContainsKey ("blockSize")) 262 Constants.MAP_BLOCK_SIZE = ((JSONNumber)jo ["blockSize"]).GetInt (); 263 if (jo.ContainsKey ("maxZoom")) 264 Constants.ZOOMLEVELS = ((JSONNumber)jo ["maxZoom"]).GetInt () + 1; 265 return true; 266 } 267 } catch (MalformedJSONException e) { 268 Log.Out ("Exception in LoadMapInfo: " + e); 269 } catch (InvalidCastException e) { 270 Log.Out ("Exception in LoadMapInfo: " + e); 271 } 272 } 273 return false; 266 274 } 267 275 -
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r189 r192 20 20 public void Update (PlayerDataFile pdf) 21 21 { 22 Log.Out ("Updating player inventory - player id: " + pdf.id);22 //Log.Out ("Updating player inventory - player id: " + pdf.id); 23 23 ProcessInv (bag, pdf.bag); 24 24 ProcessInv (belt, pdf.inventory); -
binary-improvements/bin/Release/7dtd-server-fixes_version.txt
r190 r192 1 Version: 0.93.53 69.229801 Version: 0.93.5373.22608
Note:
See TracChangeset
for help on using the changeset viewer.