-
Notifications
You must be signed in to change notification settings - Fork 209
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
Lua PlayerSendChatMessage() #275
Comments
Try this maybe: PlayerSendChatMessage(1, 0, "Text") I had a tough time with this because i was using the arguments like "SendChatMessage" |
I think you misunderstand me. I was correcting in the wiki the type values for SendChatMessage() And I create a new page for PlayerSendChatMessage() I tested several type values from here: Some are working only for NPC, some only for player, some I havn't tested. But I have tested -1 (CHAT_MSG_ADDON ) and 17 (CHAT_MSG_CHANNEL ) and the results are crashes. However this values may are not applicable nor make logical sense they should be checked by the core to prevent crashes either on server side or client side. Sidenote (joke) BTW: |
CHAT_MSG_CHANNEL triggers an assert which is not a crash, it's an assertion failed. Still, a Lua script shouldn't trigger any assert. |
A little example about what happens when -1 is converted into an unsigned int32: int i = -1;
UInt32 u = (UInt32) i;
Console.WriteLine("int: " + i + "\nuint32: " + u);
17 triggers an assert. CHAT_MSG_CHANNEL = 17;
...
ARCEMU_ASSERT(type != CHAT_MSG_CHANNEL); Assertion is that the message type isn't 17. PS: |
@Magnifikator Could you please provide me some Lua scripts to test this? |
That's my standard script to test Lua code.
|
If you do check, -1 is an addon message and i tried my own script on the server and it simply crashed the client. Some reason no crash file was created for me to look at. Will post more information about this as i get more! |
Hello there, |
While I was writing a new artikel in wiki for PlayerSendChatMessage() I was trying several parameters.
I have discovered that with some wrong values you can crash either client or server:
May to make a check before accept some values ?
The text was updated successfully, but these errors were encountered: