Server sleep time is slightly smarter + loading debug messages

This commit is contained in:
juanjp600
2017-06-22 00:24:30 -03:00
parent 6b65e94d41
commit c1780fa7b7
4 changed files with 12 additions and 3 deletions

View File

@@ -44,6 +44,7 @@ namespace Barotrauma
set
{
loadState = value;
DebugConsole.NewMessage("Loading: " + value.ToString() + "%",Color.Yellow);
DrawLoadingText = true;
}
}

View File

@@ -192,6 +192,7 @@ namespace Barotrauma
private IEnumerable<object> Load()
{
DebugConsole.NewMessage("LOADING COROUTINE", Color.Lime);
GUI.GraphicsDevice = base.GraphicsDevice;
GUI.Init(Content);
@@ -269,6 +270,7 @@ namespace Barotrauma
TitleScreen.LoadState = 100.0f;
hasLoaded = true;
DebugConsole.NewMessage("LOADING COROUTINE FINISHED", Color.Lime);
yield return CoroutineStatus.Success;
}

View File

@@ -100,14 +100,20 @@ namespace Barotrauma
NetLobbyScreen = new NetLobbyScreen();
Server = new GameServer("Dedicated Server Test", 14242, false, "asd", false, 10);
DateTime prevTime = DateTime.Now;
while (true)
{
prevTime = DateTime.Now;
DebugConsole.Update();
if (Screen.Selected != null) Screen.Selected.Update((float)Timing.Step);
Server.Update((float)Timing.Step);
CoroutineManager.Update((float)Timing.Step, (float)Timing.Step);
Thread.Sleep((int)(Timing.Step * 1000.0));
int frameTime = DateTime.Now.Subtract(prevTime).Milliseconds;
Thread.Sleep(Math.Max((int)(Timing.Step * 1000.0) - frameTime,0));
}
}

View File

@@ -29,7 +29,7 @@ namespace Barotrauma
static partial class DebugConsole
{
const int MaxMessages = 20000;
const int MaxMessages = 200;
public static List<ColoredText> Messages = new List<ColoredText>();