diff --git a/SRMP/Console/SRMPConsole.cs b/SRMP/Console/SRMPConsole.cs index 539866b..20541a5 100644 --- a/SRMP/Console/SRMPConsole.cs +++ b/SRMP/Console/SRMPConsole.cs @@ -13,8 +13,8 @@ namespace SRMultiplayer { CLIENT, SERVER, - PLAYERAMMO - + PLAYERAMMO, + EXCHANGE } @@ -48,6 +48,7 @@ namespace SRMultiplayer //server automatically starts with all active List blockMessages = new List(); //keeps a list of message types that have been disabled List blockLogs = new List(); //keeps a list of log message types that have been disabled + bool DisplayTrace = false; private void Application_logMessageReceived(string condition, string stackTrace, LogType type) { // We're half way through typing something, so clear this line .. @@ -56,7 +57,7 @@ namespace SRMultiplayer //construct message string message = condition; - if (!string.IsNullOrEmpty(stackTrace)) + if (!string.IsNullOrEmpty(stackTrace) && DisplayTrace) { //add stack strace if included message += Environment.NewLine + stackTrace; @@ -96,7 +97,7 @@ namespace SRMultiplayer string data = condition; //remove the srmp tag and the time to check inner tags - if (type == LogType.Log) + if (type == LogType.Log && data.StartsWith("[SRMP]")) { data = data.Substring(17); @@ -104,7 +105,7 @@ namespace SRMultiplayer if (displayLog) { //try to pase the log message - if(Enum.TryParse(data.Split("]")[0].Substring(1), true, out LogItems logMessage)) + if (Enum.TryParse(data.Split("]"[0])[0].Substring(1), true, out LogItems logMessage)) { if (blockLogs.Contains(logMessage)) displayLog = false; } @@ -126,7 +127,7 @@ namespace SRMultiplayer { //for testing log disabled display //Console.ForegroundColor = ConsoleColor.Magenta; - //Console.WriteLine(type.ToString() + " Dismissed"); + Console.WriteLine(type.ToString() + " Dismissed"); //mark dupilcate count to -1 //prevent duplicate count for supressed messages from displaying @@ -140,14 +141,6 @@ namespace SRMultiplayer input.RedrawInputLine(); } - public static void ClearCurrentConsoleLine() - { - int currentLineCursor = Console.CursorTop; - Console.SetCursorPosition(0, Console.CursorTop); - Console.Write(new string(' ', Console.BufferWidth)); - Console.SetCursorPosition(0, currentLineCursor); - } - //create a log call that marks all console sent replys void ConsoleLog(string message) { @@ -352,9 +345,21 @@ namespace SRMultiplayer else { if (blockLogs.Contains(logMessage)) blockLogs.Add(logMessage); - ConsoleLog("[Console] " + logMessage.ToString() + " Log Messages Disabled"); + ConsoleLog(logMessage.ToString() + " Log Messages Disabled"); + } + }else if (args[1].Equals("stacktrace", StringComparison.InvariantCultureIgnoreCase) || args[1].Equals("stack_trace", StringComparison.InvariantCultureIgnoreCase)) + { + if (enable) + { + DisplayTrace = true; + ConsoleLog("Stack Trace Information Enabled"); + } + else + { + DisplayTrace = false; + ConsoleLog("Stack Trace Information Disabled"); + } } - } else { ConsoleLog("Invalid Feed back Type"); diff --git a/SRMP/MultiplayerUI.cs b/SRMP/MultiplayerUI.cs index 0409731..390ca81 100644 --- a/SRMP/MultiplayerUI.cs +++ b/SRMP/MultiplayerUI.cs @@ -193,9 +193,8 @@ public class MultiplayerUI : SRSingleton canHost = false; } - GUI.contentColor = Color.red; GUILayout.BeginHorizontal(); - GUILayout.Label("Connection Status: Disconnected"); + GUILayout.Label("Connection Status: Disconnected", red); GUILayout.FlexibleSpace(); if (canHost) diff --git a/SRMP/SRMP.csproj b/SRMP/SRMP.csproj index 70fef20..57e1473 100644 --- a/SRMP/SRMP.csproj +++ b/SRMP/SRMP.csproj @@ -16,7 +16,7 @@ true - full + portable false ..\Builds\SRMP\ __CONSTRAINED__;Standalone @@ -94,11 +94,6 @@ ..\Libs\Newtonsoft.Json.dll False - - False - ..\Libs\SRML.dll - False -