Closed Dark-Dragon closed 10 months ago
Looking back on this, in hindsight you could remove the ADMIN_CHAT_MAXLENGTH server-side completely and keep it client-side only since it's really only relevant in the GUI, e.g.
This event is triggered in two places, command handler: https://github.com/multitheftauto/mtasa-resources/blob/c4bc73a2b088b98116ece27065cc7f5a1dced15b/%5Badmin%5D/admin/server/admin_server.lua#L1624-L1630
I believe the chat already has an upper limit of how many characters you can input so all we need to do is set this client-side to ensure the chat editbox doesn't exceed max limit here: https://github.com/multitheftauto/mtasa-resources/blob/c4bc73a2b088b98116ece27065cc7f5a1dced15b/%5Badmin%5D/admin/client/gui/admin_main.lua#L331
It should be all good for chat, but console input is a maximum of 255, which with a prior 'aAdminChat ' would still allow for 244 characters. So it unfortunately still surpasses the limit of 225 brought up in #440.
I have a fix for this in mind and will try to get it out this coming weekend.
Which resource(s) have this problem? admin
Describe the bug admin_definitions.lua is not in the meta.xml and is therefore never loaded. Now currently the admin resource seems to only have minor issues without it, but having the file around but not loading it causes confusion. For instance #440 didn't properly fix #373, because it assumed the file was loaded.
It should therefore be decided whether the file can be safely removed (I think it's only essential in the admin2 resource) or implemented properly. At the very least the ADMIN_CHAT_MAXLENGTH global variable needs to be set elsewhere if the file is deemed redundant.
To Reproduce
Version Client/Server 1.6 admin 1.5.9 (latest at the time of post despite version discrepancy)