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
65e2bde7
Commit
65e2bde7
authored
Jul 27, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
say sorry when MSG_RETRY
parent
41f5ba8c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
Game/AI/Dialogs.cs
Game/AI/Dialogs.cs
+5
-0
Game/GameAI.cs
Game/GameAI.cs
+8
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+1
-0
Program.cs
Program.cs
+1
-8
No files found.
Game/AI/Dialogs.cs
View file @
65e2bde7
...
...
@@ -74,6 +74,11 @@ namespace WindBot.Game.AI
}
}
public
void
SendSorry
()
{
InternalSendMessage
(
new
[]
{
"Sorry, an error occurs."
});
}
public
void
SendWelcome
()
{
InternalSendMessage
(
_welcome
);
...
...
Game/GameAI.cs
View file @
65e2bde7
...
...
@@ -22,6 +22,14 @@ namespace WindBot.Game
_dialogs
=
new
Dialogs
(
game
);
}
/// <summary>
/// Called when the AI got the error message.
/// </summary>
public
void
OnRetry
()
{
_dialogs
.
SendSorry
();
}
/// <summary>
/// Called when the AI join the game.
/// </summary>
...
...
Game/GameBehavior.cs
View file @
65e2bde7
...
...
@@ -235,6 +235,7 @@ namespace WindBot.Game
private
void
OnRetry
(
BinaryReader
packet
)
{
_ai
.
OnRetry
();
Connection
.
Close
();
throw
new
Exception
(
"Got MSG_RETRY."
);
}
...
...
Program.cs
View file @
65e2bde7
...
...
@@ -118,14 +118,7 @@ namespace WindBot
string
EnvPassword
=
Environment
.
GetEnvironmentVariable
(
"YGOPRO_PASSWORD"
);
if
(
EnvPassword
!=
null
)
Info
.
HostInfo
=
EnvPassword
;
GameClient
client
=
new
GameClient
(
Info
);
client
.
Start
();
while
(
client
.
Connection
.
IsConnected
)
{
client
.
Tick
();
Thread
.
Sleep
(
client
.
nextTickDelay
);
}
Run
(
Info
);
}
private
static
void
RunAsServer
(
int
ServerPort
)
...
...
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