@NachoCheese
Nice work! Is your job related to networking or IT by any chance?
The JSON "patreon, pledge, version" response is done by the NetworkHelper class -> SendStatusRequest(string id) method. Once the values are received the values are set in the registry and not used for anything else. So I'm 99% sure these values aren't related to deciding what content the user has unlocked.
So what are tokens used for? In the scripts.dll there is code for handling and I think creating tokens too, but it wasn't very clear what they were being used for.
Also if the user id is tied to a patreon account, you probably could change the code in the client to save to your personal patreon account user id but use a patron's user id to access the api. Not sure if multiple people using the same user id to access the api would screw with each other's games or not though.
Nice work! Is your job related to networking or IT by any chance?
I think that the UUID is decided/created by the client. So I think it should be possible to set a custom ID but I'm not really sure if that's useful for anything, I doubt it is.After all resources have been loaded, client issues a POST request for /api/status with the following keys:
The API responds with a JSON object with the following keys:
- id: a UUID. I'm assuming this is used to look up the user's information through the Patreon API.
- patron: 0 (Assuming boolean: if this user is a Patron or not)
- pledge: 0 (Assuming pledge value)
- version: 5 (Assuming minor version of the client)
The JSON "patreon, pledge, version" response is done by the NetworkHelper class -> SendStatusRequest(string id) method. Once the values are received the values are set in the registry and not used for anything else. So I'm 99% sure these values aren't related to deciding what content the user has unlocked.
I'm not sure where in the code the logic is for the first response in the quote above. I think it's related to the LoginResponse class -> Parse() method but I don't remember. If it is then I changed the patron and pledge amount as soon as the client received the response so the patron and pledge part aren't important.The API responds with a JSON object with the following keys:
The client issues a POST request for /api/start with the following keys:
- status: ok
- token: (a 164 byte string that appears to have several Base64 encoded segments separated by the '.' character)
- Segment 1: a 36 byte Base64 encoded JSON object with the following keys:
- alg: HS256
- typ: JWT
- Note:
You must be registered to see the links- Segment 2: an 83 byte Base64 encoded JSON object with the following keys:
- id: The previously seen UUID
- iat: The number of seconds since the UNIX epoch.
- Segment 3: a 43 byte string that appears to be random data. (this base64 decodes to 32 bytes, so this is quite likely)
- saves: an array (empty)
- patron: false (if the user is a patron or not)
- pledge: 0 (the pledge level of the patron)
When the user clicks on anything, the client issues a POST request for /api/update with the following keys:
- token: the previously seen token
The API responds with a JSON object with the same keys as seen above (to start)
- token: previously seen token
So what are tokens used for? In the scripts.dll there is code for handling and I think creating tokens too, but it wasn't very clear what they were being used for.
Also if the user id is tied to a patreon account, you probably could change the code in the client to save to your personal patreon account user id but use a patron's user id to access the api. Not sure if multiple people using the same user id to access the api would screw with each other's games or not though.