Commit cb1e5433 authored by mercury233's avatar mercury233

update debugmode

parent 13140a0e
......@@ -256,10 +256,10 @@ namespace WindBot.Game
{
string myName = _room.Position == 0 ? _room.Names[0] : _room.Names[1];
string otherName = _room.Position == 0 ? _room.Names[1] : _room.Names[0];
if (player >= 4)
Logger.DebugWriteLine(myName + " System or Watch : " + message);
else
if (player < 4)
Logger.WriteLine(otherName + " say to " + myName + ": " + message);
//else
// Logger.WriteLine(myName + " System or Watch : " + message);
}
}
......
......@@ -175,23 +175,17 @@ namespace WindBot
Thread workThread = new Thread(new ParameterizedThreadStart(Run));
workThread.Start(Info);
}
catch (Exception ex)
catch (Exception ex) when (!DebugMode)
{
if (!DebugMode)
Logger.WriteErrorLine("Start Thread Error: " + ex);
else
throw ex;
Logger.WriteErrorLine("Start Thread Error: " + ex);
}
ctx.Response.StatusCode = 200;
ctx.Response.Close();
}
}
catch (Exception ex)
catch (Exception ex) when (!DebugMode)
{
if (!DebugMode)
Logger.WriteErrorLine("Parse Http Request Error: " + ex);
else
throw ex;
Logger.WriteErrorLine("Parse Http Request Error: " + ex);
}
}
}
......@@ -199,44 +193,30 @@ namespace WindBot
private static void Run(object o)
{
#if !DEBUG
try
{
#endif
WindBotInfo Info = (WindBotInfo)o;
GameClient client = new GameClient(Info);
client.Start();
Logger.DebugWriteLine(client.Username + " started.");
while (client.Connection.IsConnected)
{
#if !DEBUG
try
{
#endif
client.Tick();
Thread.Sleep(30);
#if !DEBUG
}
catch (Exception ex)
catch (Exception ex) when (!DebugMode)
{
if (!DebugMode)
Logger.WriteErrorLine("Tick Error: " + ex);
else
throw ex;
Logger.WriteErrorLine("Tick Error: " + ex);
}
#endif
}
Logger.DebugWriteLine(client.Username + " end.");
#if !DEBUG
}
catch (Exception ex)
catch (Exception ex) when (!DebugMode)
{
if (!DebugMode)
Logger.WriteErrorLine("Run Error: " + ex);
else
throw ex;
Logger.WriteErrorLine("Run Error: " + ex);
}
#endif
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment