How does WA encode weak table into compressed string?
yukozh opened this issue ยท 4 comments
Is your feature request related to a problem? Please describe.
Here is 3rd party website which want to allow users generate WA strings from website.
Describe the solution you'd like
I would be appreciate if you could provide the details how does WA encode the weak table.
Or if ok. Please provide an Web API to convert weak table into encoded WA String.
Describe alternatives you've considered
Additional context
@SpatenLa Sorry, our gov. blocked discord in our country.
Then you need to study our code, start in Transmission.lua at Private.DisplayToString.
Do note, that the format of compressed auras is not stable. We have changed how auras exported in the past, and will do so again.
Also note, that WeakAuras is under a GPLv2 license, you should be sure that you understand it before reading the source code.
Starting from the Lua table that WeakAuras generate:
- Serialize it with LibSerialize (https://github.com/rossnichols/LibSerialize)
- Compress it with LibDeflate (https://github.com/SafeteeWoW/LibDeflate)
- Encode it via LibDeflate which is basically base64
- Add !WA:2! at the start of the generated string
Wago.io which is a website that host some auras use the Lua library, as far as I know. It's source can be found here: https://github.com/oratory/wago.io