Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
苍蓝
ygopro
Commits
d50ffd16
Commit
d50ffd16
authored
Apr 30, 2020
by
DailyShana
Committed by
GitHub
Apr 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add STOC_DECK_COUNT (#2290)
* add STOC_DECK_COUNT * side count * show deck in tag duel
parent
f7fa8c18
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
0 deletions
+45
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+14
-0
gframe/network.h
gframe/network.h
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+14
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+16
-0
No files found.
gframe/duelclient.cpp
View file @
d50ffd16
...
@@ -408,6 +408,19 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -408,6 +408,19 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
break
;
break
;
}
}
case
STOC_DECK_COUNT
:
{
mainGame
->
gMutex
.
lock
();
int
deckc
=
BufferIO
::
ReadInt16
(
pdata
);
int
extrac
=
BufferIO
::
ReadInt16
(
pdata
);
int
sidec
=
BufferIO
::
ReadInt16
(
pdata
);
mainGame
->
dField
.
Initial
(
0
,
deckc
,
extrac
);
deckc
=
BufferIO
::
ReadInt16
(
pdata
);
extrac
=
BufferIO
::
ReadInt16
(
pdata
);
sidec
=
BufferIO
::
ReadInt16
(
pdata
);
mainGame
->
dField
.
Initial
(
1
,
deckc
,
extrac
);
mainGame
->
gMutex
.
unlock
();
break
;
}
case
STOC_JOIN_GAME
:
{
case
STOC_JOIN_GAME
:
{
STOC_JoinGame
*
pkt
=
(
STOC_JoinGame
*
)
pdata
;
STOC_JoinGame
*
pkt
=
(
STOC_JoinGame
*
)
pdata
;
std
::
wstring
str
;
std
::
wstring
str
;
...
@@ -1164,6 +1177,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1164,6 +1177,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
showcard
=
0
;
mainGame
->
showcard
=
0
;
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
Clear
();
int
playertype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
playertype
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dInfo
.
isFirst
=
(
playertype
&
0xf
)
?
false
:
true
;
mainGame
->
dInfo
.
isFirst
=
(
playertype
&
0xf
)
?
false
:
true
;
if
(
playertype
&
0xf0
)
if
(
playertype
&
0xf0
)
...
...
gframe/network.h
View file @
d50ffd16
...
@@ -185,6 +185,7 @@ public:
...
@@ -185,6 +185,7 @@ public:
#define STOC_TP_RESULT 0x6
#define STOC_TP_RESULT 0x6
#define STOC_CHANGE_SIDE 0x7
#define STOC_CHANGE_SIDE 0x7
#define STOC_WAITING_SIDE 0x8
#define STOC_WAITING_SIDE 0x8
#define STOC_DECK_COUNT 0x9
#define STOC_CREATE_GAME 0x11
#define STOC_CREATE_GAME 0x11
#define STOC_JOIN_GAME 0x12
#define STOC_JOIN_GAME 0x12
#define STOC_TYPE_CHANGE 0x13
#define STOC_TYPE_CHANGE 0x13
...
...
gframe/single_duel.cpp
View file @
d50ffd16
...
@@ -328,6 +328,20 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
...
@@ -328,6 +328,20 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
NetServer
::
ReSendToPlayer
(
*
oit
);
NetServer
::
ReSendToPlayer
(
*
oit
);
}
}
char
deckbuff
[
12
];
char
*
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
char
tempbuff
[
6
];
memcpy
(
tempbuff
,
deckbuff
,
6
);
memcpy
(
deckbuff
,
deckbuff
+
6
,
6
);
memcpy
(
deckbuff
+
6
,
tempbuff
,
6
);
NetServer
::
SendBufferToPlayer
(
players
[
1
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
hand_result
[
0
]
=
0
;
hand_result
[
0
]
=
0
;
...
...
gframe/tag_duel.cpp
View file @
d50ffd16
...
@@ -285,6 +285,22 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
...
@@ -285,6 +285,22 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
NetServer
::
ReSendToPlayer
(
*
oit
);
NetServer
::
ReSendToPlayer
(
*
oit
);
}
}
char
deckbuff
[
12
];
char
*
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
char
tempbuff
[
6
];
memcpy
(
tempbuff
,
deckbuff
,
6
);
memcpy
(
deckbuff
,
deckbuff
+
6
,
6
);
memcpy
(
deckbuff
+
6
,
tempbuff
,
6
);
NetServer
::
SendBufferToPlayer
(
players
[
2
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
ReSendToPlayer
(
players
[
3
]);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
hand_result
[
0
]
=
0
;
hand_result
[
0
]
=
0
;
...
...
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