Skip to content
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

onPlayerPrivateMessage returns bad "message" argument #2135

Closed
FileEX opened this issue Mar 19, 2021 · 4 comments · Fixed by #3382
Closed

onPlayerPrivateMessage returns bad "message" argument #2135

FileEX opened this issue Mar 19, 2021 · 4 comments · Fixed by #3382
Labels
bug Something isn't working

Comments

@FileEX
Copy link
Contributor

FileEX commented Mar 19, 2021

Describe the bug
onPlayerPrivateMessage event returns recipient nick + message as "message" event

To reproduce

addEventHandler('onPlayerPrivateMessage', root, function(msg, rec)
    print(msg, getPlayerName(rec))
    cancelEvent();
    return;
end);

i executed command "/msg Adams e"

Result:
image

Expected behaviour
message argument should be only message without recipient name

Screenshots

Version
1.5.8

Additional context

@FileEX FileEX added the bug Something isn't working label Mar 19, 2021
@Unde-R
Copy link
Contributor

Unde-R commented Mar 19, 2021

CLogger::LogPrintf("MSG: %s to %s: %s\n", szNick, pPlayer->GetNick(), szMessage);

Arguments.PushString(szArguments);

shouldn't be szMessage instead of szArguments?

@PlatinMTA
Copy link
Contributor

PlatinMTA commented Mar 19, 2021

shouldn't be szMessage instead of szArguments?

Probably. Can't test it with console tho it doesn't seem to be triggering the event.

@Pirulax
Copy link
Contributor

Pirulax commented Mar 21, 2021

I think changing this would break backwards compatibility tho. Perhaps we could rename message to fullMessage, and add a new argument content or something?

@FileEX
Copy link
Contributor Author

FileEX commented Mar 21, 2021

I think changing this would break backwards compatibility tho. Perhaps we could rename message to fullMessage, and add a new argument content or something?

Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants