Commit cb1e5433 authored by mercury233's avatar mercury233

update debugmode

parent 13140a0e
...@@ -256,10 +256,10 @@ namespace WindBot.Game ...@@ -256,10 +256,10 @@ namespace WindBot.Game
{ {
string myName = _room.Position == 0 ? _room.Names[0] : _room.Names[1]; string myName = _room.Position == 0 ? _room.Names[0] : _room.Names[1];
string otherName = _room.Position == 0 ? _room.Names[1] : _room.Names[0]; string otherName = _room.Position == 0 ? _room.Names[1] : _room.Names[0];
if (player >= 4) if (player < 4)
Logger.DebugWriteLine(myName + " System or Watch : " + message);
else
Logger.WriteLine(otherName + " say to " + myName + ": " + message); Logger.WriteLine(otherName + " say to " + myName + ": " + message);
//else
// Logger.WriteLine(myName + " System or Watch : " + message);
} }
} }
......
...@@ -175,23 +175,17 @@ namespace WindBot ...@@ -175,23 +175,17 @@ namespace WindBot
Thread workThread = new Thread(new ParameterizedThreadStart(Run)); Thread workThread = new Thread(new ParameterizedThreadStart(Run));
workThread.Start(Info); workThread.Start(Info);
} }
catch (Exception ex) catch (Exception ex) when (!DebugMode)
{ {
if (!DebugMode)
Logger.WriteErrorLine("Start Thread Error: " + ex); Logger.WriteErrorLine("Start Thread Error: " + ex);
else
throw ex;
} }
ctx.Response.StatusCode = 200; ctx.Response.StatusCode = 200;
ctx.Response.Close(); ctx.Response.Close();
} }
} }
catch (Exception ex) catch (Exception ex) when (!DebugMode)
{ {
if (!DebugMode)
Logger.WriteErrorLine("Parse Http Request Error: " + ex); Logger.WriteErrorLine("Parse Http Request Error: " + ex);
else
throw ex;
} }
} }
} }
...@@ -199,44 +193,30 @@ namespace WindBot ...@@ -199,44 +193,30 @@ namespace WindBot
private static void Run(object o) private static void Run(object o)
{ {
#if !DEBUG
try try
{ {
#endif
WindBotInfo Info = (WindBotInfo)o; WindBotInfo Info = (WindBotInfo)o;
GameClient client = new GameClient(Info); GameClient client = new GameClient(Info);
client.Start(); client.Start();
Logger.DebugWriteLine(client.Username + " started."); Logger.DebugWriteLine(client.Username + " started.");
while (client.Connection.IsConnected) while (client.Connection.IsConnected)
{ {
#if !DEBUG
try try
{ {
#endif
client.Tick(); client.Tick();
Thread.Sleep(30); Thread.Sleep(30);
#if !DEBUG
} }
catch (Exception ex) catch (Exception ex) when (!DebugMode)
{ {
if (!DebugMode)
Logger.WriteErrorLine("Tick Error: " + ex); Logger.WriteErrorLine("Tick Error: " + ex);
else
throw ex;
} }
#endif
} }
Logger.DebugWriteLine(client.Username + " end."); Logger.DebugWriteLine(client.Username + " end.");
#if !DEBUG
} }
catch (Exception ex) catch (Exception ex) when (!DebugMode)
{ {
if (!DebugMode)
Logger.WriteErrorLine("Run Error: " + ex); Logger.WriteErrorLine("Run Error: " + ex);
else
throw 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