aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
authorRogueAI42 <[email protected]>2017-08-01 17:48:12 +1000
committerRogueAI42 <[email protected]>2017-08-01 17:48:12 +1000
commit9cad19bf1a099cf2ca166f1151d406d7ebef4d2a (patch)
tree171832029be05404a87bc428c21b612e9193b820 /ShiftOS_TheReturn
parentaa3de1b749800a6f82f4b04d559af33e0f450610 (diff)
parent6fd95f912823efc2901e7735df63e1aefa2ebb73 (diff)
downloadshiftos_thereturn-9cad19bf1a099cf2ca166f1151d406d7ebef4d2a.tar.gz
shiftos_thereturn-9cad19bf1a099cf2ca166f1151d406d7ebef4d2a.tar.bz2
shiftos_thereturn-9cad19bf1a099cf2ca166f1151d406d7ebef4d2a.zip
Merge remote-tracking branch 'upstream/monogame' into monogame
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/TerminalBackend.cs16
1 files changed, 6 insertions, 10 deletions
diff --git a/ShiftOS_TheReturn/TerminalBackend.cs b/ShiftOS_TheReturn/TerminalBackend.cs
index dcc4625..4e7392e 100644
--- a/ShiftOS_TheReturn/TerminalBackend.cs
+++ b/ShiftOS_TheReturn/TerminalBackend.cs
@@ -231,11 +231,13 @@ namespace ShiftOS.Engine
try
{
CommandHandler.Invoke(null, new[] { args });
+
}
catch
{
CommandHandler.Invoke(null, null);
}
+ CommandFinished?.Invoke(Localization.Parse(this.CommandInfo.name), args);
}
}
@@ -270,6 +272,8 @@ namespace ShiftOS.Engine
}
+ public static event Action<string, Dictionary<string, object>> CommandFinished;
+
public class MemoryTextWriter : System.IO.TextWriter
{
public override Encoding Encoding
@@ -402,14 +406,12 @@ namespace ShiftOS.Engine
{
if (string.IsNullOrWhiteSpace(text))
return;
- var tw = new MemoryTextWriter();
- Console.SetOut(tw);
+ var args = GetArgs(ref text);
+ var oargs = JsonConvert.DeserializeObject<Dictionary<string, object>>(GetSentArgs(args));
try
{
- var args = GetArgs(ref text);
bool commandWasClient = RunClient(text, args, isRemote);
-
if (!commandWasClient)
{
Console.WriteLine("Error: Command not found.");
@@ -423,12 +425,6 @@ namespace ShiftOS.Engine
PrefixEnabled = true;
}
- string buffer = tw.ToString();
- LastCommandBuffer = buffer;
- Console.SetOut(new TerminalTextWriter());
- if(!isRemote)
- Console.Write(buffer);
-
}
/// <summary>