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
31097d94
Commit
31097d94
authored
May 29, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add param to turn chat off
parent
e29d534d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
Game/AI/Dialogs.cs
Game/AI/Dialogs.cs
+12
-3
Game/GameClient.cs
Game/GameClient.cs
+2
-0
Program.cs
Program.cs
+4
-0
WindBotInfo.cs
WindBotInfo.cs
+2
-0
No files found.
Game/AI/Dialogs.cs
View file @
31097d94
...
...
@@ -80,15 +80,15 @@ namespace WindBot.Game.AI
public
void
SendSorry
()
{
InternalSendMessage
(
new
[]
{
"Sorry, an error occurs."
});
InternalSendMessage
Forced
(
new
[]
{
"Sorry, an error occurs."
});
}
public
void
SendDeckSorry
(
string
card
)
{
if
(
card
==
"DECK"
)
InternalSendMessage
(
new
[]
{
"Deck illegal. Please check the database of your YGOPro and WindBot."
});
InternalSendMessage
Forced
(
new
[]
{
"Deck illegal. Please check the database of your YGOPro and WindBot."
});
else
InternalSendMessage
(
_deckerror
,
card
);
InternalSendMessage
Forced
(
_deckerror
,
card
);
}
public
void
SendWelcome
()
...
...
@@ -159,6 +159,15 @@ namespace WindBot.Game.AI
}
private
void
InternalSendMessage
(
IList
<
string
>
array
,
params
object
[]
opts
)
{
if
(!
_game
.
_chat
)
return
;
string
message
=
string
.
Format
(
array
[
Program
.
Rand
.
Next
(
array
.
Count
)],
opts
);
if
(
message
!=
""
)
_game
.
Chat
(
message
);
}
private
void
InternalSendMessageForced
(
IList
<
string
>
array
,
params
object
[]
opts
)
{
string
message
=
string
.
Format
(
array
[
Program
.
Rand
.
Next
(
array
.
Count
)],
opts
);
if
(
message
!=
""
)
...
...
Game/GameClient.cs
View file @
31097d94
...
...
@@ -15,6 +15,7 @@ namespace WindBot.Game
public
string
Dialog
;
public
int
Hand
;
public
bool
_chat
;
private
string
_serverHost
;
private
int
_serverPort
;
private
short
_proVersion
;
...
...
@@ -29,6 +30,7 @@ namespace WindBot.Game
Deck
=
Info
.
Deck
;
Dialog
=
Info
.
Dialog
;
Hand
=
Info
.
Hand
;
_chat
=
Info
.
Chat
;
_serverHost
=
Info
.
Host
;
_serverPort
=
Info
.
Port
;
_roomInfo
=
Info
.
HostInfo
;
...
...
Program.cs
View file @
31097d94
...
...
@@ -74,6 +74,7 @@ namespace WindBot
Info
.
HostInfo
=
Config
.
GetString
(
"HostInfo"
,
Info
.
HostInfo
);
Info
.
Version
=
Config
.
GetInt
(
"Version"
,
Info
.
Version
);
Info
.
Hand
=
Config
.
GetInt
(
"Hand"
,
Info
.
Hand
);
Info
.
Chat
=
Config
.
GetBool
(
"Chat"
,
Info
.
Chat
);
Run
(
Info
);
}
...
...
@@ -114,6 +115,9 @@ namespace WindBot
string
hand
=
HttpUtility
.
ParseQueryString
(
RawUrl
).
Get
(
"hand"
);
if
(
hand
!=
null
)
Info
.
Hand
=
Int32
.
Parse
(
hand
);
string
chat
=
HttpUtility
.
ParseQueryString
(
RawUrl
).
Get
(
"chat"
);
if
(
chat
!=
null
)
Info
.
Chat
=
bool
.
Parse
(
chat
);
if
(
Info
.
Name
==
null
||
Info
.
Host
==
null
||
port
==
null
)
{
...
...
WindBotInfo.cs
View file @
31097d94
...
...
@@ -13,6 +13,7 @@ namespace WindBot
public
int
Version
{
get
;
set
;
}
public
int
Hand
{
get
;
set
;
}
public
bool
Chat
{
get
;
set
;
}
public
WindBotInfo
()
{
Name
=
"WindBot"
;
...
...
@@ -23,6 +24,7 @@ namespace WindBot
HostInfo
=
""
;
Version
=
0x1343
;
Hand
=
0
;
Chat
=
true
;
}
}
}
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