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-520DIY
ygopro
Commits
98d81e9a
Commit
98d81e9a
authored
Jun 08, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server-patch-reversedeck' of ../versions/ygopro-mc into server-develop
parents
0d3b2659
cba72d5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
11 deletions
+43
-11
gframe/single_duel.cpp
gframe/single_duel.cpp
+22
-3
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+21
-8
No files found.
gframe/single_duel.cpp
View file @
98d81e9a
...
...
@@ -1972,19 +1972,38 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
RefreshRemoved
(
player
,
0xefffff
,
0
,
dp
);
// send MSG_REVERSE_DECK if deck is reversed
if
(
deck_reversed
)
{
if
(
deck_reversed
)
WriteMsg
([
&
](
uint8_t
*&
pbuf
)
{
BufferIO
::
WriteInt8
(
pbuf
,
MSG_REVERSE_DECK
);
});
for
(
uint8_t
i
=
0
;
i
<
2
;
++
i
)
{
uint8_t
query_buffer
[
SIZE_QUERY_BUFFER
];
for
(
uint8_t
i
=
0
;
i
<
2
;
++
i
)
{
// get decktop card
auto
qlen
=
query_field_card
(
pduel
,
i
,
LOCATION_DECK
,
QUERY_CODE
|
QUERY_POSITION
,
query_buffer
,
0
);
if
(
!
qlen
)
continue
;
// no cards in deck
uint8_t
*
qbuf
=
query_buffer
;
uint32_t
code
=
0
;
uint32_t
position
=
0
;
while
(
qbuf
<
query_buffer
+
qlen
)
{
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
if
(
qbuf
+
clen
==
query_buffer
+
qlen
)
{
// last card
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
position
=
GetPosition
(
qbuf
,
8
);
}
qbuf
+=
clen
-
4
;
}
if
(
position
&
POS_FACEUP
)
code
|=
0x80000000
;
// mark as reversed
if
(
deck_reversed
||
position
&
POS_FACEUP
)
WriteMsg
([
&
](
uint8_t
*&
pbuf
)
{
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt32
(
pbuf
,
deck_top
[
i
]);
});
}
}
/*
...
...
gframe/tag_duel.cpp
View file @
98d81e9a
...
...
@@ -2071,20 +2071,33 @@ void TagDuel::RequestField(DuelPlayer* dp) {
RefreshRemoved
(
1
-
player
,
0xefffff
,
0
,
dp
);
RefreshRemoved
(
player
,
0xefffff
,
0
,
dp
);
// send MSG_REVERSE_DECK if deck is reversed
if
(
deck_reversed
)
{
WriteMsg
([
&
](
uint8_t
*&
pbuf
)
{
BufferIO
::
WriteInt8
(
pbuf
,
MSG_REVERSE_DECK
);
});
for
(
uint8_t
i
=
0
;
i
<
2
;
++
i
)
{
uint8_t
query_buffer
[
SIZE_QUERY_BUFFER
];
for
(
uint8_t
i
=
0
;
i
<
2
;
++
i
)
{
// get decktop card
auto
qlen
=
query_field_card
(
pduel
,
i
,
LOCATION_DECK
,
QUERY_CODE
|
QUERY_POSITION
,
query_buffer
,
0
);
if
(
!
qlen
)
continue
;
// no cards in deck
uint8_t
*
qbuf
=
query_buffer
;
uint32_t
code
=
0
;
uint32_t
position
=
0
;
while
(
qbuf
<
query_buffer
+
qlen
)
{
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
if
(
qbuf
+
clen
==
query_buffer
+
qlen
)
{
// last card
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
position
=
GetPosition
(
qbuf
,
8
);
}
qbuf
+=
clen
-
4
;
}
if
(
position
&
POS_FACEUP
)
code
|=
0x80000000
;
// mark as reversed
if
(
deck_reversed
||
position
&
POS_FACEUP
)
WriteMsg
([
&
](
uint8_t
*&
pbuf
)
{
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt32
(
pbuf
,
deck_top
[
i
]);
});
}
}
/*
...
...
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