Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
Windbot-408
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
神之吹息
Windbot-408
Commits
381f7f5d
Commit
381f7f5d
authored
Jun 25, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set env to optional
parent
b764fea6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
Game/AI/Dialogs.cs
Game/AI/Dialogs.cs
+7
-1
Program.cs
Program.cs
+12
-3
No files found.
Game/AI/Dialogs.cs
View file @
381f7f5d
...
...
@@ -55,7 +55,13 @@ namespace WindBot.Game.AI
{
_game
=
game
;
DataContractJsonSerializer
serializer
=
new
DataContractJsonSerializer
(
typeof
(
DialogsData
));
using
(
FileStream
fs
=
File
.
OpenRead
(
"Dialogs/"
+
Environment
.
GetEnvironmentVariable
(
"YGOPRO_DIALOG"
)
+
".json"
))
string
dialogfilename
=
"zh-CN"
;
string
envdialogfilename
=
Environment
.
GetEnvironmentVariable
(
"YGOPRO_DIALOG"
);
if
(
envdialogfilename
!=
null
)
{
dialogfilename
=
envdialogfilename
;
}
using
(
FileStream
fs
=
File
.
OpenRead
(
"Dialogs/"
+
dialogfilename
+
".json"
))
{
DialogsData
data
=
(
DialogsData
)
serializer
.
ReadObject
(
fs
);
_welcome
=
data
.
welcome
;
...
...
Program.cs
View file @
381f7f5d
...
...
@@ -9,7 +9,7 @@ namespace WindBot
{
public
class
Program
{
public
static
short
ProVersion
=
Int16
.
Parse
(
Environment
.
GetEnvironmentVariable
(
"YGOPRO_VERSION"
))
;
public
static
short
ProVersion
=
0x133A
;
public
static
int
PlayerNameSize
=
20
;
internal
static
Random
Rand
;
...
...
@@ -40,8 +40,17 @@ namespace WindBot
private
static
void
Run
()
{
Init
(
"cards.cdb"
);
GameClient
client
=
new
GameClient
(
Environment
.
GetEnvironmentVariable
(
"YGOPRO_NAME"
),
Environment
.
GetEnvironmentVariable
(
"YGOPRO_DECK"
),
Environment
.
GetEnvironmentVariable
(
"YGOPRO_HOST"
),
Int32
.
Parse
(
Environment
.
GetEnvironmentVariable
(
"YGOPRO_PORT"
)));
GameClient
client
;
string
EnvName
=
Environment
.
GetEnvironmentVariable
(
"YGOPRO_NAME"
);
if
(
EnvName
!=
null
)
{
ProVersion
=
Int16
.
Parse
(
Environment
.
GetEnvironmentVariable
(
"YGOPRO_VERSION"
));
client
=
new
GameClient
(
EnvName
,
Environment
.
GetEnvironmentVariable
(
"YGOPRO_DECK"
),
Environment
.
GetEnvironmentVariable
(
"YGOPRO_HOST"
),
Int32
.
Parse
(
Environment
.
GetEnvironmentVariable
(
"YGOPRO_PORT"
)));
}
else
{
client
=
new
GameClient
(
"谜之剑士LV4"
,
"Blue-Eyes"
,
"127.0.0.1"
,
7911
);
}
client
.
Start
();
while
(
client
.
Connection
.
IsConnected
)
{
...
...
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