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
efa05ad5
Commit
efa05ad5
authored
Jun 08, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
cba72d5e
Changes
4
Show 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 @
efa05ad5
...
...
@@ -612,7 +612,6 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
turn_player
=
0
;
phase
=
1
;
deck_reversed
=
false
;
std
::
memset
(
deck_top
,
0
,
sizeof
(
deck_top
));
#endif
RefreshExtra
(
0
);
RefreshExtra
(
1
);
...
...
@@ -1102,14 +1101,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
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
;
#endif
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -1910,7 +1902,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
uint32_t
position
=
0
;
while
(
qbuf
<
query_buffer
+
qlen
)
{
auto
clen
=
BufferIO
::
ReadInt32
(
qbuf
);
if
(
qbuf
+
clen
==
query_buffer
+
qlen
)
{
if
(
qbuf
+
clen
-
4
==
query_buffer
+
qlen
)
{
// last card
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
position
=
GetPosition
(
qbuf
,
8
);
...
...
@@ -1924,7 +1916,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt32
(
pbuf
,
deck_top
[
i
]
);
BufferIO
::
WriteInt32
(
pbuf
,
code
);
});
}
...
...
gframe/single_duel.h
View file @
efa05ad5
...
...
@@ -72,7 +72,6 @@ protected:
unsigned
char
turn_player
{
0
};
unsigned
short
phase
{
0
};
bool
deck_reversed
{
false
};
uint32_t
deck_top
[
2
]{};
#endif
Replay
last_replay
;
bool
match_mode
{
false
};
...
...
gframe/tag_duel.cpp
View file @
efa05ad5
...
...
@@ -605,7 +605,6 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
turn_player
=
0
;
phase
=
1
;
deck_reversed
=
false
;
std
::
memset
(
deck_top
,
0
,
sizeof
(
deck_top
));
#endif
RefreshExtra
(
0
);
RefreshExtra
(
1
);
...
...
@@ -1064,14 +1063,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
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
;
#endif
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
...
@@ -1998,12 +1990,12 @@ void TagDuel::RequestField(DuelPlayer* dp) {
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
;
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
)
{
if
(
qbuf
+
clen
-
4
==
query_buffer
+
qlen
)
{
// last card
code
=
*
(
uint32_t
*
)(
qbuf
+
4
);
position
=
GetPosition
(
qbuf
,
8
);
...
...
@@ -2017,7 +2009,7 @@ void TagDuel::RequestField(DuelPlayer* dp) {
BufferIO
::
WriteInt8
(
pbuf
,
MSG_DECK_TOP
);
BufferIO
::
WriteInt8
(
pbuf
,
i
);
BufferIO
::
WriteInt8
(
pbuf
,
0
);
BufferIO
::
WriteInt32
(
pbuf
,
deck_top
[
i
]
);
BufferIO
::
WriteInt32
(
pbuf
,
code
);
});
}
...
...
gframe/tag_duel.h
View file @
efa05ad5
...
...
@@ -68,7 +68,6 @@ protected:
unsigned
char
turn_player
{
0
};
unsigned
short
phase
{
0
};
bool
deck_reversed
{
false
};
uint32_t
deck_top
[
2
]{};
#endif
bool
ready
[
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