Server sleep time is slightly smarter + loading debug messages
This commit is contained in:
@@ -44,6 +44,7 @@ namespace Barotrauma
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
loadState = value;
|
loadState = value;
|
||||||
|
DebugConsole.NewMessage("Loading: " + value.ToString() + "%",Color.Yellow);
|
||||||
DrawLoadingText = true;
|
DrawLoadingText = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private IEnumerable<object> Load()
|
private IEnumerable<object> Load()
|
||||||
{
|
{
|
||||||
|
DebugConsole.NewMessage("LOADING COROUTINE", Color.Lime);
|
||||||
GUI.GraphicsDevice = base.GraphicsDevice;
|
GUI.GraphicsDevice = base.GraphicsDevice;
|
||||||
GUI.Init(Content);
|
GUI.Init(Content);
|
||||||
|
|
||||||
@@ -269,6 +270,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
TitleScreen.LoadState = 100.0f;
|
TitleScreen.LoadState = 100.0f;
|
||||||
hasLoaded = true;
|
hasLoaded = true;
|
||||||
|
DebugConsole.NewMessage("LOADING COROUTINE FINISHED", Color.Lime);
|
||||||
yield return CoroutineStatus.Success;
|
yield return CoroutineStatus.Success;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,14 +100,20 @@ namespace Barotrauma
|
|||||||
NetLobbyScreen = new NetLobbyScreen();
|
NetLobbyScreen = new NetLobbyScreen();
|
||||||
|
|
||||||
Server = new GameServer("Dedicated Server Test", 14242, false, "asd", false, 10);
|
Server = new GameServer("Dedicated Server Test", 14242, false, "asd", false, 10);
|
||||||
|
|
||||||
|
DateTime prevTime = DateTime.Now;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
prevTime = DateTime.Now;
|
||||||
|
|
||||||
DebugConsole.Update();
|
DebugConsole.Update();
|
||||||
if (Screen.Selected != null) Screen.Selected.Update((float)Timing.Step);
|
if (Screen.Selected != null) Screen.Selected.Update((float)Timing.Step);
|
||||||
Server.Update((float)Timing.Step);
|
Server.Update((float)Timing.Step);
|
||||||
CoroutineManager.Update((float)Timing.Step, (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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
static partial class DebugConsole
|
static partial class DebugConsole
|
||||||
{
|
{
|
||||||
const int MaxMessages = 20000;
|
const int MaxMessages = 200;
|
||||||
|
|
||||||
public static List<ColoredText> Messages = new List<ColoredText>();
|
public static List<ColoredText> Messages = new List<ColoredText>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user