8000 Debug: update SetAIName, ShowHint by salix5 · Pull Request #754 · Fluorohydride/ygopro-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Debug: update SetAIName, ShowHint #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Debug: update SetAIName, ShowHint #754

wants to merge 1 commit into from

Conversation

salix5
8000 Copy link
Collaborator
@salix5 salix5 commented May 20, 2025

According to single_mode.cpp
SetAIName
max length: 127 char

ShowHint
max length: 1023 char

@mercury233
@Wind2009-Louse

@salix5 salix5 requested a review from Copilot May 20, 2025 14:51
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the maximum allowed lengths for AI names and hints in the debug module. The changes ensure that the maximum length for AI names is now 127 characters and for hints is 1023 characters, with corresponding documentation updates in the message definitions.

  • Update debug_set_ai_name to use a max length of 127 characters.
  • Update debug_show_hint to use a max length of 1023 characters.
  • Revise the comments in common.h accordingly.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
libdebug.cpp Adjusted string length checks for AI names and hints.
common.h Updated message IDs comments to reflect the updated debug functions.

@purerosefallen
Copy link
Collaborator

I think copilot said well.

and single_mode.cpp should reference this constant.

@@ -167,8 +167,8 @@ int32_t scriptlib::debug_set_ai_name(lua_State *L) {
pduel->write_buffer8(MSG_AI_NAME);
const char* pstr = lua_tostring(L, 1);
int len = (int)std::strlen(pstr);
if(len > 100)
len = 100;
if(len > 127)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Isn't supported for name longer (>=) 20

Copy link
Collaborator Author
@salix5 salix5 May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The max length is 19 uft16 code units.
The length of utf8 bytes is unknown.

It should be <128 (the buffer size in single_mode.cpp)
Do you think we should keep the original value?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0