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.41k stars 437 forks source link

Add compress/decompress functions natively #3373

Open ffsPLASMA opened 6 months ago

ffsPLASMA commented 6 months ago

Is your feature request related to a problem? Please describe.

Add zip/archive compress and decompress functions to native level callable by lua. Benefit of this is client can download zip/archive files from server and then extract/decompress locally. That way you can save bandwith, especially with large files and recent IMG archive container support.

Describe the solution you'd like

callable from lua client (server as well if really needed) compress(string filename, string compressMethod, table with additional info like format, level, dict/word size) decompress(string filename) both return true on success, false otherwise

Describe alternatives you've considered

Theres no real alternative unless doing it on lua itself which is very very slow and likely abort due to infinite running script.

Additional context

This would benefit large files initiated manually via downloadFile as we could significantly reduce bandwith usage.

Security Policy

TracerDS commented 6 months ago

Its best to replace current zip implementation with more... friendly and performant implementation. From there exposing relevant functions is not that hard (#3057 was my attempt but there are few zip libraries that could be easily implemented into mta)

Git-RubyCommunity commented 6 months ago

I think it is not bad to add the ability to put a password to the arguments