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
13140a0e
Commit
13140a0e
authored
Aug 29, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change run behavior
parent
d20052fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
Dialogs/default.json
Dialogs/default.json
+1
-1
Program.cs
Program.cs
+14
-5
No files found.
Dialogs/default.json
View file @
13140a0e
{
"welcome"
:
[
"Hi, I'm Wind
b
ot."
"Hi, I'm Wind
B
ot."
],
"deckerror"
:
[
"Sorry, it seems that I have too much {0} in my deck."
...
...
Program.cs
View file @
13140a0e
...
...
@@ -21,6 +21,8 @@ namespace WindBot
internal
static
void
Main
(
string
[]
args
)
{
Logger
.
WriteLine
(
"WindBot starting..."
);
InitDatas
(
"cards.cdb"
);
int
argc
=
args
.
Length
;
...
...
@@ -48,6 +50,7 @@ namespace WindBot
else
if
(
argc
==
5
)
{
RunFromArgs
(
args
);
Logger
.
WriteLine
(
"WindBot ended."
);
}
// Use environment variables to run Windbot
...
...
@@ -73,13 +76,17 @@ namespace WindBot
else
if
(
Environment
.
GetEnvironmentVariable
(
"YGOPRO_NAME"
)
!=
null
)
{
RunFromEnv
();
Logger
.
WriteLine
(
"WindBot ended."
);
}
// Else,
run from the default settings
// Else,
tell the user to run it correctly
else
{
WindBotInfo
Info
=
new
WindBotInfo
();
Run
(
Info
);
Logger
.
WriteLine
(
""
);
Logger
.
WriteLine
(
"See the readme for how to run WindBot!"
);
Logger
.
WriteLine
(
"Press any key to quit..."
);
Logger
.
WriteLine
(
""
);
Console
.
ReadKey
();
}
}
...
...
@@ -88,6 +95,8 @@ namespace WindBot
Rand
=
new
Random
();
DecksManager
.
Init
();
string
absolutePath
=
Path
.
GetFullPath
(
databasePath
);
if
(!
File
.
Exists
(
absolutePath
))
absolutePath
=
Path
.
GetFullPath
(
"../"
+
databasePath
);
NamedCardsManager
.
Init
(
absolutePath
);
}
...
...
@@ -128,8 +137,8 @@ namespace WindBot
MainServer
.
AuthenticationSchemes
=
AuthenticationSchemes
.
Anonymous
;
MainServer
.
Prefixes
.
Add
(
"http://127.0.0.1:"
+
ServerPort
+
"/"
);
MainServer
.
Start
();
Logger
.
WriteLine
(
"Wind
bot Server Start S
uccessed."
);
Logger
.
WriteLine
(
"HTTP GET http://127.0.0.1:"
+
ServerPort
+
"/?name=Wind
b
ot&host=127.0.0.1&port=7911 to call the bot."
);
Logger
.
WriteLine
(
"Wind
Bot server start s
uccessed."
);
Logger
.
WriteLine
(
"HTTP GET http://127.0.0.1:"
+
ServerPort
+
"/?name=Wind
B
ot&host=127.0.0.1&port=7911 to call the bot."
);
while
(
true
)
{
try
...
...
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