diff --git a/Backend/BackendLoop.cs b/Backend/BackendLoop.cs index 51c9ecb0..e3055b0c 100644 --- a/Backend/BackendLoop.cs +++ b/Backend/BackendLoop.cs @@ -72,7 +72,7 @@ namespace Swarmops.Backend if (!Debugger.IsAttached) { - killSignals = new UnixSignal[] {new UnixSignal (Signum.SIGINT), new UnixSignal (Signum.SIGTERM)}; + killSignals = new UnixSignal[] {new UnixSignal (Signum.SIGINT), new UnixSignal (Signum.SIGTERM), new UnixSignal(Signum.SIGKILL) }; } BotLog.Write (0, "MainCycle", string.Empty); diff --git a/Logic/Support/PayloadBase.cs b/Logic/Support/PayloadBase.cs index d5a10ce6..16a80512 100644 --- a/Logic/Support/PayloadBase.cs +++ b/Logic/Support/PayloadBase.cs @@ -37,12 +37,9 @@ namespace Swarmops.Logic.Support xml = xml.Replace ("�", ""); xml = xml.Replace ("\x00", ""); - Console.WriteLine("XML: " + xml); - Console.WriteLine("FromXml before new XmlSerializer()"); - - if (xml.Trim().Length < 1) + if (String.IsNullOrWhiteSpace(xml)) { - throw new InvalidOperationException("xml is empty"); // Catch a weird empty-XML error and try to get a stack trace + throw new ArgumentException("xml is empty"); // Catch a weird empty-XML error and try to get a stack trace } XmlSerializer serializer = new XmlSerializer (typeof (T)); @@ -51,14 +48,10 @@ namespace Swarmops.Logic.Support byte[] xmlBytes = Encoding.UTF8.GetBytes (xml); stream.Write (xmlBytes, 0, xmlBytes.Length); - Console.WriteLine("Before Deserialize()"); - stream.Position = 0; T result = (T) serializer.Deserialize (stream); stream.Close(); - Console.WriteLine("Before Returning"); - return result; } }