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
9e8dbeeb
Commit
9e8dbeeb
authored
May 31, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround: use STOC_HS_PlayerEnter_size
parent
6faa54a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/network.h
gframe/network.h
+3
-2
No files found.
gframe/duelclient.cpp
View file @
9e8dbeeb
...
...
@@ -818,11 +818,11 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
break
;
}
case
STOC_HS_PLAYER_ENTER
:
{
if
(
len
<
1
+
(
int
)
sizeof
(
STOC_HS_PlayerEnter
)
)
if
(
len
<
1
+
STOC_HS_PlayerEnter_size
)
return
;
soundManager
.
PlaySoundEffect
(
SOUND_PLAYER_ENTER
);
STOC_HS_PlayerEnter
packet
;
std
::
memcpy
(
&
packet
,
pdata
,
sizeof
packet
);
std
::
memcpy
(
&
packet
,
pdata
,
STOC_HS_PlayerEnter_size
);
const
auto
*
pkt
=
&
packet
;
if
(
pkt
->
pos
>
3
)
break
;
...
...
gframe/network.h
View file @
9e8dbeeb
...
...
@@ -158,10 +158,11 @@ constexpr int SIZE_STOC_CHAT = (LEN_CHAT_PLAYER + LEN_CHAT_MSG) * sizeof(uint16_
struct
STOC_HS_PlayerEnter
{
uint16_t
name
[
20
];
unsigned
char
pos
;
unsigned
char
padding
;
// only for padding
// byte padding[1]
};
check_trivially_copyable
(
STOC_HS_PlayerEnter
);
static_assert
(
sizeof
(
STOC_HS_PlayerEnter
)
==
42
,
"size mismatch: STOC_HS_PlayerEnter"
);
//static_assert(sizeof(STOC_HS_PlayerEnter) == 42, "size mismatch: STOC_HS_PlayerEnter");
constexpr
int
STOC_HS_PlayerEnter_size
=
41
;
//workwround
struct
STOC_HS_PlayerChange
{
//pos<<4 | state
...
...
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