TheLegendofPiratesOnline / documentation

TLOPO Documentation
https://tlopo.com/
Other
4 stars 1 forks source link

Download Documentation/API Implementation #5

Closed BartGunshot closed 4 years ago

BartGunshot commented 4 years ago

The API documentation does not provide any information on downloads, yet provides information on logging in which seems to be an oversight/omission. It seems that download requests are done through download.tlopo.com rather than through the API. I'm unsure if there were plans to include API requests for downloading through the API as well, if so maybe that's the reason for the omission.

Regardless, including the relevant download documentation for downloading/updating the game in the API docs would be beneficial.

mfwass commented 4 years ago

Hi there,

Yes, this was an oversight; there is no intentional reason why the download API is not documented. We are a bit busy this week with 12 Days of Celebration, so I am unable to write proper documentation and put it in, but here's the gist of it:

Download API URL: https://download.tlopo.com/win32/patcher.json https://download.tlopo.com/linux2/patcher.json https://download.tlopo.com/mac/patcher.json

The patch JSON describes the topology of the client's installation. It specifies files, their location expected location, a series of patches between versions, and the file hash that file is for versioning.

        "file": {
            "path": "libs", 
            "hash": "4e75e3b", 
            "patches": []
        }, 

The hash is the first 7 chars of its SHA1 (I think) hash. Patches are rather difficult to implement, and would take more time than I can allocate right now to explain.

To find a file on the download server, you must navigate to the location in path + the filename + .bz2

Example:

        "cg.dll": {
            "path": "",
            "hash": "124c758",
            "patches": []
        },

URL: http://download.tlopo.com/win32/cg.dll.bz2

BartGunshot commented 4 years ago

Resolved #6