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
xiaoye
windbot
Commits
af01d0b9
Commit
af01d0b9
authored
Feb 03, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test tag mode
parent
b4da6453
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
Game/GameBehavior.cs
Game/GameBehavior.cs
+30
-1
No files found.
Game/GameBehavior.cs
View file @
af01d0b9
...
@@ -81,6 +81,7 @@ namespace WindBot.Game
...
@@ -81,6 +81,7 @@ namespace WindBot.Game
_messages
.
Add
(
GameMessage
.
Draw
,
OnDraw
);
_messages
.
Add
(
GameMessage
.
Draw
,
OnDraw
);
_messages
.
Add
(
GameMessage
.
ShuffleDeck
,
OnShuffleDeck
);
_messages
.
Add
(
GameMessage
.
ShuffleDeck
,
OnShuffleDeck
);
_messages
.
Add
(
GameMessage
.
ShuffleHand
,
OnShuffleHand
);
_messages
.
Add
(
GameMessage
.
ShuffleHand
,
OnShuffleHand
);
_messages
.
Add
(
GameMessage
.
TagSwap
,
OnTagSwap
);
_messages
.
Add
(
GameMessage
.
NewTurn
,
OnNewTurn
);
_messages
.
Add
(
GameMessage
.
NewTurn
,
OnNewTurn
);
_messages
.
Add
(
GameMessage
.
NewPhase
,
OnNewPhase
);
_messages
.
Add
(
GameMessage
.
NewPhase
,
OnNewPhase
);
_messages
.
Add
(
GameMessage
.
Damage
,
OnDamage
);
_messages
.
Add
(
GameMessage
.
Damage
,
OnDamage
);
...
@@ -135,7 +136,7 @@ namespace WindBot.Game
...
@@ -135,7 +136,7 @@ namespace WindBot.Game
{
{
int
type
=
packet
.
ReadByte
();
int
type
=
packet
.
ReadByte
();
int
pos
=
type
&
0xF
;
int
pos
=
type
&
0xF
;
if
(
pos
!=
0
&&
pos
!=
1
)
if
(
pos
<
0
||
pos
>
3
)
{
{
Connection
.
Close
();
Connection
.
Close
();
return
;
return
;
...
@@ -298,6 +299,34 @@ namespace WindBot.Game
...
@@ -298,6 +299,34 @@ namespace WindBot.Game
card
.
SetId
(
packet
.
ReadInt32
());
card
.
SetId
(
packet
.
ReadInt32
());
}
}
private
void
OnTagSwap
(
BinaryReader
packet
)
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
Logger
.
WriteLine
(
"swap "
+
player
);
int
mcount
=
packet
.
ReadByte
();
int
ecount
=
packet
.
ReadByte
();
int
pcount
=
packet
.
ReadByte
();
int
hcount
=
packet
.
ReadByte
();
int
topcode
=
packet
.
ReadInt32
();
_duel
.
Fields
[
player
].
Deck
.
Clear
();
for
(
int
i
=
0
;
i
<
mcount
;
++
i
)
{
_duel
.
Fields
[
player
].
Deck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Deck
));
}
_duel
.
Fields
[
player
].
ExtraDeck
.
Clear
();
for
(
int
i
=
0
;
i
<
ecount
;
++
i
)
{
int
code
=
packet
.
ReadInt32
()
&
0x7fffffff
;
_duel
.
Fields
[
player
].
ExtraDeck
.
Add
(
new
ClientCard
(
code
,
CardLocation
.
Extra
));
}
_duel
.
Fields
[
player
].
Hand
.
Clear
();
for
(
int
i
=
0
;
i
<
hcount
;
++
i
)
{
int
code
=
packet
.
ReadInt32
();
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
code
,
CardLocation
.
Hand
));
}
}
private
void
OnNewTurn
(
BinaryReader
packet
)
private
void
OnNewTurn
(
BinaryReader
packet
)
{
{
_duel
.
Turn
++;
_duel
.
Turn
++;
...
...
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