Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
windbot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tang Xinwei
windbot
Commits
cb1e5433
Commit
cb1e5433
authored
Aug 29, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update debugmode
parent
13140a0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
31 deletions
+11
-31
Game/GameBehavior.cs
Game/GameBehavior.cs
+3
-3
Program.cs
Program.cs
+8
-28
No files found.
Game/GameBehavior.cs
View file @
cb1e5433
...
...
@@ -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);
}
}
...
...
Program.cs
View file @
cb1e5433
...
...
@@ -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
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment