netcode good condition
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -78,6 +79,7 @@ namespace Game
|
||||
|
||||
public static ReadOnlySpan<ConsoleLine> Lines => instance.Lines;
|
||||
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (instance != null)
|
||||
@@ -210,8 +212,15 @@ namespace Game
|
||||
|
||||
public bool ShowExecutedLines = true;
|
||||
|
||||
private StreamWriter logStream;
|
||||
|
||||
internal ConsoleInstance()
|
||||
{
|
||||
#if FLAX_EDITOR
|
||||
logStream = new StreamWriter(@"C:\dev\GoakeFlax\console.log", false);
|
||||
#else
|
||||
logStream = new StreamWriter(Path.Combine(Directory.GetCurrentDirectory(), "console.log"), false);
|
||||
#endif
|
||||
}
|
||||
|
||||
public bool IsOpen { get; internal set; } = true;
|
||||
@@ -225,6 +234,12 @@ namespace Game
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (logStream != null)
|
||||
{
|
||||
logStream.Flush();
|
||||
logStream.Dispose();
|
||||
logStream = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Initializes the Console system.
|
||||
@@ -413,6 +428,7 @@ namespace Game
|
||||
{
|
||||
ConsoleLine lineEntry = new ConsoleLine(line);
|
||||
consoleLines.Add(lineEntry);
|
||||
logStream.WriteLine(line);
|
||||
OnPrint?.Invoke(text);
|
||||
}
|
||||
}
|
||||
@@ -420,8 +436,10 @@ namespace Game
|
||||
{
|
||||
ConsoleLine lineEntry = new ConsoleLine(text);
|
||||
consoleLines.Add(lineEntry);
|
||||
logStream.WriteLine(text);
|
||||
OnPrint?.Invoke(text);
|
||||
}
|
||||
logStream.Flush();
|
||||
if (Debugger.IsAttached)
|
||||
System.Diagnostics.Debug.WriteLine(text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user