linux fixes
This commit is contained in:
@@ -134,6 +134,7 @@ namespace Game
|
||||
}
|
||||
|
||||
// Echoes error text to Console
|
||||
[DebuggerHidden]
|
||||
public static void PrintError(string text)
|
||||
{
|
||||
instance.PrintError(text);
|
||||
@@ -399,6 +400,8 @@ namespace Game
|
||||
}
|
||||
|
||||
// Echoes error text to Console
|
||||
//[DebuggerNonUserCode]
|
||||
[DebuggerHidden]
|
||||
public void PrintError(string text)
|
||||
{
|
||||
foreach (string line in text.Split('\n'))
|
||||
@@ -408,9 +411,9 @@ namespace Game
|
||||
OnPrint?.Invoke(text);
|
||||
}
|
||||
|
||||
if (Debugger.IsAttached)
|
||||
/*if (Debugger.IsAttached)
|
||||
Debugger.Break();
|
||||
else
|
||||
else*/
|
||||
throw new Exception(text);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ namespace Game
|
||||
NetworkManager_Cleanup();
|
||||
|
||||
var networkSettings = GameSettings.Load<NetworkSettings>();
|
||||
networkSettings.Address = "any";
|
||||
networkSettings.Port = DefaultServerPort;
|
||||
GameSettings.LoadAsset<NetworkSettings>().SetInstance(networkSettings);
|
||||
|
||||
currentGameMode = new GameMode()
|
||||
{
|
||||
ServerAddress = "localhost",
|
||||
@@ -76,7 +80,7 @@ namespace Game
|
||||
failure = NetworkManager.StartServer();
|
||||
if (failure)
|
||||
{
|
||||
Console.PrintError("Server startup failed.");
|
||||
Console.PrintError($"Failed to start the server, unable to bind to address {networkSettings.Address}:{networkSettings.Port}");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Game
|
||||
{
|
||||
if (data[index] != ' ' && data[index] != '\r' && data[index] != '\n')
|
||||
break;
|
||||
index++;
|
||||
//index++;
|
||||
}
|
||||
|
||||
if (index >= data.Length)
|
||||
@@ -213,7 +213,8 @@ namespace Game
|
||||
sb.Append((char)data[index]);
|
||||
}
|
||||
|
||||
index++;
|
||||
//if (data[index] == '\n')
|
||||
// index++;
|
||||
|
||||
while (index < data.Length)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Game
|
||||
//private string mapPath = @"C:\dev\GoakeFlax\Assets\Maps\cube_valve.map";
|
||||
//private string mapPath = @"C:\dev\GoakeFlax\Assets\Maps\dm4.map";
|
||||
|
||||
public string mapPath = @"C:\dev\Goake\maps\aerowalk\aerowalk.map";
|
||||
public string mapPath;// = @"C:\dev\Goake\maps\aerowalk\aerowalk.map";
|
||||
//private string mapPath = @"C:\dev\GoakeFlax\Assets\Maps\problematic.map";
|
||||
|
||||
public bool importLights = false;
|
||||
@@ -350,6 +350,7 @@ namespace Game
|
||||
|
||||
if (resetLights)
|
||||
{
|
||||
resetLights = false;
|
||||
if (worldSpawnActor == null || !worldSpawnActor || root == null)
|
||||
{
|
||||
Debug.Log("worldspawn or root is null");
|
||||
@@ -371,8 +372,6 @@ namespace Game
|
||||
// ParsePlayerSpawn(entity, ref playerSpawnIndex);
|
||||
// break;
|
||||
}
|
||||
|
||||
resetLights = false;
|
||||
}
|
||||
|
||||
if (dirtyMap)
|
||||
@@ -384,14 +383,13 @@ namespace Game
|
||||
|
||||
if (dirtyLights)
|
||||
{
|
||||
dirtyLights = false;
|
||||
foreach (var light in worldSpawnActor.GetChildren<Light>())
|
||||
{
|
||||
light.IsActive = sceneLighting;
|
||||
if (light is PointLight pointLight)
|
||||
pointLight.ShadowsStrength = sceneShadows ? 1.0f : 0.0f;
|
||||
}
|
||||
|
||||
dirtyLights = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +411,12 @@ namespace Game
|
||||
private void LoadMap(bool forceLoad)
|
||||
{
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
byte[] mapChars = File.ReadAllBytes(mapPath);
|
||||
|
||||
string mapPath_ = mapPath;
|
||||
if (!File.Exists(mapPath_))
|
||||
mapPath_ = Path.Combine(Directory.GetCurrentDirectory(), mapPath_);
|
||||
|
||||
byte[] mapChars = File.ReadAllBytes(mapPath_);
|
||||
root = MapParser.Parse(mapChars);
|
||||
sw.Stop();
|
||||
//Console.Print("Map parsing time: " + sw.Elapsed.TotalMilliseconds + "ms");
|
||||
@@ -1103,10 +1106,8 @@ namespace Game
|
||||
}
|
||||
|
||||
|
||||
for (int i=0; i<10000; i++)
|
||||
{
|
||||
Debug.Log($"{i} udfghjosa fuhoag guiha7 2382835yayhahn0 generate:{generateSdf}, GI:{Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None}, {sdfModels.Count}");
|
||||
}
|
||||
//for (int i=0; i<10000; i++)
|
||||
// Debug.Log($"{i} udfghjosa fuhoag guiha7 2382835yayhahn0 generate:{generateSdf}, GI:{Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None}, {sdfModels.Count}");
|
||||
|
||||
//Debug.Log($"generate:{generateSdf}, GI:{Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None}, {sdfModels.Count}");
|
||||
if (generateSdf && globalIllumination /*&& Graphics.PostProcessSettings.GlobalIllumination.Mode != GlobalIlluminationMode.None*/ && sdfModels.Count > 1)
|
||||
|
||||
Reference in New Issue
Block a user