Changeset 383 for binary-improvements2/MapRendering
- Timestamp:
- Aug 1, 2022, 1:16:11 PM (2 years ago)
- Location:
- binary-improvements2/MapRendering
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Commands/EnableOpenIDDebug.cs
r359 r383 1 using System;2 1 using System.Collections.Generic; 3 2 using AllocsFixes.NetConnections.Servers.Web; -
binary-improvements2/MapRendering/Commands/EnableRendering.cs
r359 r383 1 using System;2 1 using System.Collections.Generic; 3 2 -
binary-improvements2/MapRendering/Commands/ReloadWebPermissions.cs
r359 r383 1 using System;2 1 using System.Collections.Generic; 3 2 using AllocsFixes.NetConnections.Servers.Web; -
binary-improvements2/MapRendering/Commands/RenderMap.cs
r359 r383 1 using System;2 1 using System.Collections.Generic; 3 2 -
binary-improvements2/MapRendering/Commands/webstat.cs
r359 r383 1 using System;2 1 using System.Collections.Generic; 3 2 using AllocsFixes.NetConnections.Servers.Web; -
binary-improvements2/MapRendering/MapRendering/MapRendering.cs
r369 r383 24 24 private bool renderingFullMap; 25 25 private float renderTimeout = float.MaxValue; 26 private bool shutdown; 26 27 27 28 private MapRendering () { … … 59 60 60 61 public static void Shutdown () { 61 if (Instance?.renderCoroutineRef != null) { 62 if (Instance == null) { 63 return; 64 } 65 66 Instance.shutdown = true; 67 68 if (Instance.renderCoroutineRef != null) { 62 69 ThreadManager.StopCoroutine (Instance.renderCoroutineRef); 63 70 Instance.renderCoroutineRef = null; … … 201 208 202 209 private IEnumerator renderCoroutine () { 203 while ( true) {210 while (!shutdown) { 204 211 lock (lockObject) { 205 if (dirtyChunks.Count > 0 && renderTimeout == float.MaxValue) {212 if (dirtyChunks.Count > 0 && renderTimeout >= float.MaxValue / 2) { 206 213 renderTimeout = Time.time + 0.5f; 207 214 } … … 239 246 //Log.Out ("Start Dirty: " + chunkPos); 240 247 241 Vector2i block, blockOffset; 242 getBlockNumber (chunkPos, out block, out blockOffset, Constants.MAP_BLOCK_TO_CHUNK_DIV, 243 Constants.MAP_CHUNK_SIZE); 248 getBlockNumber (chunkPos, out Vector2i block, out _, Constants.MAP_BLOCK_TO_CHUNK_DIV, Constants.MAP_CHUNK_SIZE); 244 249 245 250 zoomLevelBuffers [Constants.ZOOMLEVELS - 1].LoadBlock (block); -
binary-improvements2/MapRendering/Web/API/GetAllowedCommands.cs
r382 r383 1 using System.Net;2 1 using AllocsFixes.JSON; 3 2 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; -
binary-improvements2/MapRendering/Web/API/GetAnimalsLocation.cs
r382 r383 1 1 using System.Collections.Generic; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using AllocsFixes.LiveData; -
binary-improvements2/MapRendering/Web/API/GetHostileLocation.cs
r382 r383 1 1 using System.Collections.Generic; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using AllocsFixes.LiveData; -
binary-improvements2/MapRendering/Web/API/GetLog.cs
r382 r383 1 1 using System.Collections.Generic; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; -
binary-improvements2/MapRendering/Web/API/GetPlayerInventories.cs
r382 r383 1 1 using System.Collections.Generic; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using AllocsFixes.PersistentData; -
binary-improvements2/MapRendering/Web/API/GetPlayerList.cs
r382 r383 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using System.Net;5 4 using System.Text.RegularExpressions; 6 5 using AllocsFixes.JSON; -
binary-improvements2/MapRendering/Web/API/GetPlayersLocation.cs
r382 r383 1 1 using System.Collections.Generic; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using AllocsFixes.PersistentData; -
binary-improvements2/MapRendering/Web/API/GetPlayersOnline.cs
r382 r383 1 1 using System.Collections.Generic; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using AllocsFixes.PersistentData; -
binary-improvements2/MapRendering/Web/API/GetServerInfo.cs
r382 r383 1 1 using System; 2 using System.Net;3 2 using AllocsFixes.JSON; 4 3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; -
binary-improvements2/MapRendering/Web/API/GetStats.cs
r382 r383 1 using System.Net;2 1 using AllocsFixes.JSON; 3 2 using AllocsFixes.LiveData; -
binary-improvements2/MapRendering/Web/API/GetWebUIUpdates.cs
r382 r383 1 using System.Net;2 1 using AllocsFixes.JSON; 3 2 using AllocsFixes.LiveData; -
binary-improvements2/MapRendering/Web/API/Null.cs
r382 r383 1 using System.Net; 2 using System.Text; 1 using System.Text; 3 2 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 4 3 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; -
binary-improvements2/MapRendering/Web/Handlers/AbsHandler.cs
r382 r383 1 using System.Net;2 1 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 3 2 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; -
binary-improvements2/MapRendering/Web/Handlers/SimpleRedirectHandler.cs
r382 r383 1 using System.Net;2 1 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 3 2 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; -
binary-improvements2/MapRendering/Web/Web.cs
r382 r383 164 164 response.ProtocolVersion = httpProtocolVersion; 165 165 166 // No game yet -> fail request 167 if (GameManager.Instance.World == null) { 168 response.StatusCode = (int) HttpStatusCode.ServiceUnavailable; 169 return; 170 } 171 172 if (request.Url == null) { 173 response.StatusCode = (int) HttpStatusCode.BadRequest; 174 return; 175 } 176 166 177 #if ENABLE_PROFILER 167 178 authSampler.Begin (); … … 172 183 #endif 173 184 174 175 185 //Log.Out ("Login status: conn!=null: {0}, permissionlevel: {1}", conn != null, permissionLevel); 176 177 186 178 187 if (conn != null) { … … 186 195 } 187 196 188 // No game yet -> fail request189 if (GameManager.Instance.World == null) {190 response.StatusCode = (int) HttpStatusCode.ServiceUnavailable;191 return;192 }193 194 197 string requestPath = request.Url.AbsolutePath; 195 198
Note:
See TracChangeset
for help on using the changeset viewer.