Removed one set of debug console.writelines

This commit is contained in:
Rick Falkvinge
2021-02-04 16:14:20 +01:00
parent cbb6482f44
commit 36ebbf952b
2 changed files with 3 additions and 10 deletions
+1 -1
View File
@@ -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);
+2 -9
View File
@@ -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;
}
}