[SUGGESTION] New import format for ITL categories
whi-tw opened this issue · 1 comments
Hullo,
I'm trying to create a tool to create a category export from Archon.gg's meta builds list.
Because of ITL's dependency on LibSerialize and LibDeflate, this is super difficult: these tools have no non-lua implementations.
I wondered, would it be possible to create a new import format using json and base64, which would allow the string to be created with standard non-wow tools?
My proposed structure:
{
"loadouts": [
{
"name": "Some Loadout",
"exportString": "abcd-1234"
}
...
],
"key": "some-category-key",
"name": "Some Category"
}
This could then be minified and exported as base64:
❯ echo -n '{"loadouts":[{"name":"Some Loadout","exportString":"abcd-1234"}],"key":"some-category-key","name":"Some Category"}' | base64
eyJsb2Fkb3V0cyI6W3sibmFtZSI6IlNvbWUgTG9hZG91dCIsImV4cG9ydFN0cmluZyI6ImFiY2QtMTIzNCJ9XSwia2V5Ijoic29tZS1jYXRlZ29yeS1rZXkiLCJuYW1lIjoiU29tZSBDYXRlZ29yeSJ9
and then imported into ITL as !PTL1!eyJsb2Fkb3V0cyI6W3sibmFtZSI6IlNvbWUgTG9hZG91dCIsImV4cG9ydFN0cmluZyI6ImFiY2QtMTIzNCJ9XSwia2V5Ijoic29tZS1jYXRlZ29yeS1rZXkiLCJuYW1lIjoiU29tZSBDYXRlZ29yeSJ9
If we worry about string length, it'd likely be possible to use a standard compression algo that's also available in lua (possibly zlib?) before base64'ing.
This could then be un-base64'd, (inflated?) and then converted into the standard table via the json library.
What would your thoughts be?