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
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
MyCard
ygopro
Commits
a006addb
Commit
a006addb
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
6ad5982b
efa05ad5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
24 deletions
+6
-24
gframe/single_duel.cpp
gframe/single_duel.cpp
+2
-10
gframe/single_duel.h
gframe/single_duel.h
+0
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+4
-12
gframe/tag_duel.h
gframe/tag_duel.h
+0
-1
No files found.
gframe/single_duel.cpp
View file @
a006addb
...
@@ -654,7 +654,6 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -654,7 +654,6 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
turn_player
=
0
;
turn_player
=
0
;
phase
=
1
;
phase
=
1
;
deck_reversed
=
false
;
deck_reversed
=
false
;
std
::
memset
(
deck_top
,
0
,
sizeof
(
deck_top
));
#endif
#endif
RefreshExtra
(
0
);
RefreshExtra
(
0
);
RefreshExtra
(
1
);
RefreshExtra
(
1
);
...
@@ -1180,14 +1179,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
...
@@ -1180,14 +1179,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
break
;
}
}
case
MSG_DECK_TOP
:
{
case
MSG_DECK_TOP
:
{
#ifdef YGOPRO_SERVER_MODE
auto
player
=
BufferIO
::
ReadUInt8
(
pbuf
);
auto
seq
=
BufferIO
::
ReadUInt8
(
pbuf
);
auto
code
=
BufferIO
::
ReadInt32
(
pbuf
);
deck_top
[
player
]
=
code
;
#else
pbuf
+=
6
;
pbuf
+=
6
;
#endif
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
@@ -1988,7 +1980,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
...
@@ -1988,7 +1980,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
uint32_t
position
=
0
;
uint32_t
position
=
0
;
while
(
qbuf
<
query_buffer
+
qlen
)
{
while
(
qbuf
<
query_buffer
+
qlen
)
{
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
if
(
qbuf
+
clen
==
query_buffer
+
qlen
)
{
if
(
qbuf
+
clen
-
4
==
query_buffer
+
qlen
)
{
// last card
// last card
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
position
=
GetPosition
(
qbuf
,
8
);
position
=
GetPosition
(
qbuf
,
8
);
...
@@ -2002,7 +1994,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
...
@@ -2002,7 +1994,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt32
(
pbuf
,
deck_top
[
i
]
);
BufferIO
::
WriteInt32
(
pbuf
,
code
);
});
});
}
}
...
...
gframe/single_duel.h
View file @
a006addb
...
@@ -75,7 +75,6 @@ protected:
...
@@ -75,7 +75,6 @@ protected:
unsigned
char
turn_player
{
0
};
unsigned
char
turn_player
{
0
};
unsigned
short
phase
{
0
};
unsigned
short
phase
{
0
};
bool
deck_reversed
{
false
};
bool
deck_reversed
{
false
};
uint32_t
deck_top
[
2
]{};
#endif
#endif
Replay
last_replay
;
Replay
last_replay
;
bool
match_mode
{
false
};
bool
match_mode
{
false
};
...
...
gframe/tag_duel.cpp
View file @
a006addb
...
@@ -652,7 +652,6 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -652,7 +652,6 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
turn_player
=
0
;
turn_player
=
0
;
phase
=
1
;
phase
=
1
;
deck_reversed
=
false
;
deck_reversed
=
false
;
std
::
memset
(
deck_top
,
0
,
sizeof
(
deck_top
));
#endif
#endif
RefreshExtra
(
0
);
RefreshExtra
(
0
);
RefreshExtra
(
1
);
RefreshExtra
(
1
);
...
@@ -1142,14 +1141,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
...
@@ -1142,14 +1141,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
break
;
}
}
case
MSG_DECK_TOP
:
{
case
MSG_DECK_TOP
:
{
#ifdef YGOPRO_SERVER_MODE
auto
player
=
BufferIO
::
ReadUInt8
(
pbuf
);
auto
seq
=
BufferIO
::
ReadUInt8
(
pbuf
);
auto
code
=
BufferIO
::
ReadInt32
(
pbuf
);
deck_top
[
player
]
=
code
;
#else
pbuf
+=
6
;
pbuf
+=
6
;
#endif
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
@@ -2072,17 +2064,17 @@ void TagDuel::RequestField(DuelPlayer* dp) {
...
@@ -2072,17 +2064,17 @@ void TagDuel::RequestField(DuelPlayer* dp) {
RefreshRemoved
(
player
,
0xefffff
,
0
,
dp
);
RefreshRemoved
(
player
,
0xefffff
,
0
,
dp
);
uint8_t
query_buffer
[
SIZE_QUERY_BUFFER
];
uint8_t
query_buffer
[
SIZE_QUERY_BUFFER
];
for
(
uint8_t
i
=
0
;
i
<
2
;
++
i
)
{
for
(
uint8_t
i
=
0
;
i
<
2
;
++
i
)
{
// get decktop card
// get decktop card
auto
qlen
=
query_field_card
(
pduel
,
i
,
LOCATION_DECK
,
QUERY_CODE
|
QUERY_POSITION
,
query_buffer
,
0
);
auto
qlen
=
query_field_card
(
pduel
,
i
,
LOCATION_DECK
,
QUERY_CODE
|
QUERY_POSITION
,
query_buffer
,
0
);
if
(
!
qlen
)
if
(
!
qlen
)
continue
;
// no cards in deck
continue
;
// no cards in deck
uint8_t
*
qbuf
=
query_buffer
;
uint8_t
*
qbuf
=
query_buffer
;
uint32_t
code
=
0
;
uint32_t
code
=
0
;
uint32_t
position
=
0
;
uint32_t
position
=
0
;
while
(
qbuf
<
query_buffer
+
qlen
)
{
while
(
qbuf
<
query_buffer
+
qlen
)
{
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
if
(
qbuf
+
clen
==
query_buffer
+
qlen
)
{
if
(
qbuf
+
clen
-
4
==
query_buffer
+
qlen
)
{
// last card
// last card
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
position
=
GetPosition
(
qbuf
,
8
);
position
=
GetPosition
(
qbuf
,
8
);
...
@@ -2096,7 +2088,7 @@ void TagDuel::RequestField(DuelPlayer* dp) {
...
@@ -2096,7 +2088,7 @@ void TagDuel::RequestField(DuelPlayer* dp) {
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt32
(
pbuf
,
deck_top
[
i
]
);
BufferIO
::
WriteInt32
(
pbuf
,
code
);
});
});
}
}
...
...
gframe/tag_duel.h
View file @
a006addb
...
@@ -71,7 +71,6 @@ protected:
...
@@ -71,7 +71,6 @@ protected:
unsigned
char
turn_player
{
0
};
unsigned
char
turn_player
{
0
};
unsigned
short
phase
{
0
};
unsigned
short
phase
{
0
};
bool
deck_reversed
{
false
};
bool
deck_reversed
{
false
};
uint32_t
deck_top
[
2
]{};
#endif
#endif
bool
ready
[
4
];
bool
ready
[
4
];
bool
surrender
[
4
];
bool
surrender
[
4
];
...
...
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