official-antistasi-community / A3-Antistasi

Antistasi Community Version - work in progress - Discord https://discord.com/invite/TYDwCRKnKX
https://antistasi.de
Other
226 stars 156 forks source link

customHint remoteExecs send structured text over network #3106

Open Tiny-DM opened 8 months ago

Tiny-DM commented 8 months ago

Whenever the localize "STR_A3A_fn_XXX" call is made, the key is immediately localized in the scope and environment of the executed script. This works well for locally executed scripts, since the structured text is sent from script to script. When localization calls are made from the server or another client however, the text is localized in the environment of the caller and sent over the network to the receiver, resulting in (relative) performance issues, (relatively) high network usage, and the wrong language for server remoteExecs.

Potential solutions:

Regardless of how it's done, the keys (probably the full keys; abbreviations or a hashmap arent really neccesary) needs to be sent over the network as short strings which can then be localized locally.

jaj22 commented 8 months ago

Not sure what the second option would look like. The main complication of the first option is that the second localization key would often need to be fed into a format, and so the function would need to take parameters.