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
HiiragiGuardians
windbot
Commits
33b1c628
Commit
33b1c628
authored
Aug 24, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add MSG_SWAP support
parent
dffbba77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+22
-0
No files found.
Game/GameBehavior.cs
View file @
33b1c628
...
...
@@ -101,6 +101,7 @@ namespace WindBot.Game
_messages
.
Add
(
GameMessage
.
Recover
,
OnRecover
);
_messages
.
Add
(
GameMessage
.
LpUpdate
,
OnLpUpdate
);
_messages
.
Add
(
GameMessage
.
Move
,
OnMove
);
_messages
.
Add
(
GameMessage
.
Swap
,
OnSwap
);
_messages
.
Add
(
GameMessage
.
Attack
,
OnAttack
);
_messages
.
Add
(
GameMessage
.
PosChange
,
OnPosChange
);
_messages
.
Add
(
GameMessage
.
Chaining
,
OnChaining
);
...
...
@@ -576,6 +577,27 @@ namespace WindBot.Game
}
}
private
void
OnSwap
(
BinaryReader
packet
)
{
int
cardId1
=
packet
.
ReadInt32
();
int
controler1
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
location1
=
packet
.
ReadByte
();
int
sequence1
=
packet
.
ReadByte
();
packet
.
ReadByte
();
int
cardId2
=
packet
.
ReadInt32
();
int
controler2
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
location2
=
packet
.
ReadByte
();
int
sequence2
=
packet
.
ReadByte
();
packet
.
ReadByte
();
ClientCard
card1
=
_duel
.
GetCard
(
controler1
,
(
CardLocation
)
location1
,
sequence1
);
ClientCard
card2
=
_duel
.
GetCard
(
controler2
,
(
CardLocation
)
location2
,
sequence2
);
if
(
card1
==
null
||
card2
==
null
)
return
;
_duel
.
RemoveCard
((
CardLocation
)
location1
,
card1
,
controler1
,
sequence1
);
_duel
.
RemoveCard
((
CardLocation
)
location2
,
card2
,
controler2
,
sequence2
);
_duel
.
AddCard
((
CardLocation
)
location2
,
card1
,
controler2
,
sequence2
,
card1
.
Position
,
cardId1
);
_duel
.
AddCard
((
CardLocation
)
location1
,
card2
,
controler1
,
sequence1
,
card2
.
Position
,
cardId2
);
}
private
void
OnAttack
(
BinaryReader
packet
)
{
int
ca
=
GetLocalPlayer
(
packet
.
ReadByte
());
...
...
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