Changeset 140
- Timestamp:
- Aug 28, 2014, 1:38:06 AM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r133 r140 79 79 <Compile Include="src\NetConnections\Servers\Web\SimpleRedirectHandler.cs" /> 80 80 <Compile Include="src\NetConnections\Servers\Web\MimeType.cs" /> 81 <Compile Include="src\CustomCommands\EnableRendering.cs" /> 81 82 </ItemGroup> 82 83 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs
r130 r140 11 11 try { 12 12 manager.m_GUIConsole.AddCommand (new CreativeMenu (manager.m_GUIConsole)); 13 manager.m_GUIConsole.AddCommand (new EnableRendering (manager.m_GUIConsole)); 13 14 manager.m_GUIConsole.AddCommand (new GetGamePrefs (manager.m_GUIConsole)); 14 15 manager.m_GUIConsole.AddCommand (new GetTime (manager.m_GUIConsole)); -
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs
r136 r140 26 26 private System.Timers.Timer chunkSaveTimer = new System.Timers.Timer (500); 27 27 private bool renderingFullMap = false; 28 public static bool renderingEnabled = true; 28 29 29 30 private MapRendering () … … 41 42 public static void RenderSingleChunk (Chunk chunk) 42 43 { 43 ThreadPool.QueueUserWorkItem ((o) => 44 { 45 try { 46 if (!Instance.renderingFullMap) { 47 Chunk c = (Chunk)o; 48 Vector3i cPos = c.GetWorldPos (); 49 Vector2i cPos2 = new Vector2i (cPos.x / Constants.MAP_CHUNK_SIZE, cPos.z / Constants.MAP_CHUNK_SIZE); 50 Instance.RenderChunk (c, cPos2); 51 Instance.chunkSaveTimer.Stop (); 52 Instance.chunkSaveTimer.Start (); 44 if (renderingEnabled) { 45 ThreadPool.QueueUserWorkItem ((o) => 46 { 47 try { 48 if (!Instance.renderingFullMap) { 49 Chunk c = (Chunk)o; 50 Vector3i cPos = c.GetWorldPos (); 51 Vector2i cPos2 = new Vector2i (cPos.x / Constants.MAP_CHUNK_SIZE, cPos.z / Constants.MAP_CHUNK_SIZE); 52 Instance.RenderChunk (c, cPos2); 53 Instance.chunkSaveTimer.Stop (); 54 Instance.chunkSaveTimer.Start (); 55 } 56 } catch (Exception e) { 57 Log.Out ("Exception in MapRendering.RenderSingleChunk(): " + e); 53 58 } 54 } catch (Exception e) { 55 Log.Out ("Exception in MapRendering.RenderSingleChunk(): " + e); 56 } 57 }, chunk); 59 }, chunk); 60 } 58 61 } 59 62 … … 114 117 115 118 private int saveCount = 0; 119 private long renderCount = 0; 116 120 117 121 private void SaveAllBlockMaps (object source, System.Timers.ElapsedEventArgs e) … … 119 123 Monitor.Enter (zoomLevelBuffers); 120 124 try { 121 Log.Out ("------- SaveAllBlockMaps " + ++saveCount );125 Log.Out ("------- SaveAllBlockMaps " + ++saveCount + " - " + renderCount); 122 126 for (int i = 0; i < Constants.ZOOMLEVELS; i++) { 123 127 zoomLevelBuffers [i].SaveBlock (); … … 142 146 Monitor.Enter (zoomLevelBuffers); 143 147 try { 148 renderCount++; 144 149 ushort[] mapColors = chunk.GetMapColors (); 145 150 if (mapColors != null) { -
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs
r134 r140 24 24 25 25 _listener.Prefixes.Add (String.Format ("http://*:{0}/", port)); 26 _listener.AuthenticationSchemes = AuthenticationSchemes.Basic;26 //_listener.AuthenticationSchemes = AuthenticationSchemes.Basic; 27 27 _listener.Start (); 28 28 … … 89 89 private bool Authorize (HttpListenerContext ctx, out HttpListenerBasicIdentity user) 90 90 { 91 user = null; 92 return true; 91 93 try { 92 94 user = (HttpListenerBasicIdentity)ctx.User.Identity;
Note:
See TracChangeset
for help on using the changeset viewer.