Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUGGESTION] New import format for ITL categories #25

Open
whi-tw opened this issue Aug 22, 2024 · 1 comment
Open

[SUGGESTION] New import format for ITL categories #25

whi-tw opened this issue Aug 22, 2024 · 1 comment

Comments

@whi-tw
Copy link

whi-tw commented Aug 22, 2024

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?

@Lardeck
Copy link
Owner

Lardeck commented Aug 23, 2024

I will take a look later, sounds easy enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants