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
f9b5c7ed
Commit
f9b5c7ed
authored
May 20, 2025
by
salix5
Committed by
GitHub
May 20, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix MSG_AI_NAME, MSG_SHOW_HINT (#2800)
* fix MSG_AI_NAME * fix MSG_SHOW_HINT
parent
4954c537
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+2
-2
gframe/single_mode.cpp
gframe/single_mode.cpp
+14
-10
No files found.
gframe/replay_mode.cpp
View file @
f9b5c7ed
...
...
@@ -824,12 +824,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_AI_NAME
:
{
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
int
len
=
buffer_read
<
uint16_t
>
(
pbuf
);
pbuf
+=
len
+
1
;
break
;
}
case
MSG_SHOW_HINT
:
{
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
int
len
=
buffer_read
<
uint16_t
>
(
pbuf
);
pbuf
+=
len
+
1
;
break
;
}
...
...
gframe/single_mode.cpp
View file @
f9b5c7ed
...
...
@@ -749,21 +749,25 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
case
MSG_AI_NAME
:
{
char
namebuf
[
128
]{};
wchar_t
wname
[
20
]{};
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
auto
begin
=
pbuf
;
pbuf
+=
len
+
1
;
std
::
memcpy
(
namebuf
,
begin
,
len
+
1
);
int
name_len
=
buffer_read
<
uint16_t
>
(
pbuf
);
if
(
name_len
+
1
<=
(
int
)
sizeof
namebuf
)
{
std
::
memcpy
(
namebuf
,
pbuf
,
name_len
);
namebuf
[
name_len
]
=
0
;
}
pbuf
+=
name_len
+
1
;
BufferIO
::
DecodeUTF8
(
namebuf
,
wname
);
BufferIO
::
CopyCharArray
(
wname
,
mainGame
->
dInfo
.
clientname
);
break
;
}
case
MSG_SHOW_HINT
:
{
char
msgbuf
[
1024
];
wchar_t
msg
[
1024
];
int
len
=
BufferIO
::
ReadInt16
(
pbuf
);
auto
begin
=
pbuf
;
pbuf
+=
len
+
1
;
std
::
memcpy
(
msgbuf
,
begin
,
len
+
1
);
char
msgbuf
[
1024
]{};
wchar_t
msg
[
1024
]{};
int
msg_len
=
buffer_read
<
uint16_t
>
(
pbuf
);
if
(
msg_len
+
1
<=
(
int
)
sizeof
msgbuf
)
{
std
::
memcpy
(
msgbuf
,
pbuf
,
msg_len
);
msgbuf
[
msg_len
]
=
0
;
}
pbuf
+=
msg_len
+
1
;
BufferIO
::
DecodeUTF8
(
msgbuf
,
msg
);
mainGame
->
gMutex
.
lock
();
mainGame
->
SetStaticText
(
mainGame
->
stMessage
,
310
,
mainGame
->
guiFont
,
msg
);
...
...
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