multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 438 forks source link

Trigger error messages should be improved #340

Open CrosRoad95 opened 6 years ago

CrosRoad95 commented 6 years ago

Is your feature request related to a problem? Please describe. error that appear while event isn't added should contain source from where was triggered. Now i see only that random event was triggered, nothing else. If server have a lot of events, search can take forever.

Describe the solution you'd like Add information about source of error ( resource, file, line ).

Describe alternatives you've considered add event onEvent which first argument is event name and rest of arguments are from trigger.

Additional context https://github.com/multitheftauto/mtasa-blue/blob/0cffa9215f4601e42b2dfbc254040aeda3caa8f0/Server/mods/deathmatch/logic/CGame.cpp#L2437

Einheit-101 commented 6 years ago

This debug message is completely unnecessary for the client anyway. It gets also triggered when the server tries to trigger a client side event when the client has not even started its resources, it is not even harmful. I would like to get rid of it entirely without creating hackfixes in Lua for it.

botder commented 5 years ago

I would like to keep the debug message. It might not be harmful, but clearly shows the issue with a script/resource and non-familiar scripters don't have to research why their resource doesn't work correctly.

I could push the referenced commit if this issue is a real problem. The images below show the added "in resource \": image image

qaisjp commented 5 years ago

The debug messages are useful indeed.

Crosroad suggested that setDevelopmentMode could be used to enable more specific error messages that might be a bit heavy for events. Do you think this is worth investigating?

botder commented 5 years ago

Yes, I could try that.