Changeset 189 for binary-improvements/7dtd-server-fixes/src/MapRendering
- Timestamp:
- Sep 12, 2014, 11:14:11 AM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/MapRendering
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRenderBlockBuffer.cs
r168 r189 37 37 { 38 38 bool res = false; 39 Monitor.Enter (blockMap); 40 try { 39 lock (blockMap) { 41 40 string folder = Constants.MAP_DIRECTORY + "/" + (zoomLevel) + "/" + block.x; 42 41 string fileName = folder + "/" + block.y + ".png"; … … 48 47 } 49 48 currentBlockMap = fileName; 50 } finally {51 Monitor.Exit (blockMap);52 49 } 53 50 return res; -
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs
r187 r189 55 55 try { 56 56 if (!Instance.renderingFullMap) { 57 Monitor.Enter (Instance.zoomLevelBuffers); 58 try { 57 lock (Instance.zoomLevelBuffers) { 59 58 Chunk c = (Chunk)o; 60 59 Vector3i cPos = c.GetWorldPos (); … … 72 71 Instance.chunkSaveTimer.Start (); 73 72 } 74 } finally {75 Monitor.Exit (Instance.zoomLevelBuffers);76 73 } 77 74 } … … 103 100 ); 104 101 105 Monitor.Enter (Instance.zoomLevelBuffers); 106 try { 102 lock (Instance.zoomLevelBuffers) { 107 103 for (int i = 0; i < Constants.ZOOMLEVELS; i++) { 108 104 zoomLevelBuffers [i].ResetBlock (); … … 152 148 Log.Out (String.Format ("RenderMap: {0}/{1} ({2}%)", curFullMapPos.x, widthPix, (int)((float)curFullMapPos.x / widthPix * 100))); 153 149 } 154 } finally {155 Monitor.Exit (Instance.zoomLevelBuffers);156 150 } 157 151 … … 178 172 private void TimedRendering (object source, System.Timers.ElapsedEventArgs e) 179 173 { 180 Monitor.Enter (zoomLevelBuffers); 181 try { 174 lock (zoomLevelBuffers) { 182 175 RenderDirtyChunks (); 183 176 if (dirtyChunks.Count > 0) 184 177 Instance.chunkSaveTimer.Start (); 185 } finally {186 Monitor.Exit (zoomLevelBuffers);187 178 } 188 179 }
Note:
See TracChangeset
for help on using the changeset viewer.