Rough Protocol Documentation: Glamour v0.5.
Note: These notes are based on a client that had already been bootstrapped, and with no Patreon account. Subsequent runs were intended to determine differences between authenticated and non-authenticated operation, but it doesn't look like much will change.
Client communicates with API endpoint at http:// sandlustgames.com /
Upon startup, client issues a GET request for /resources/game-data
API responds with a JSON object representing key-value pairs of filenames and what appear to be MD5 hashes of those filenames:
Code:
{
"scripts.dll": "27b58bc01180293c88f72855c96616e8",
"content": "b2e176d524e644cf511b415468b2df35",
"scenes": "84dd8df8994c2b44c935b149ea76dd5a"
}
Client issues a GET request for /resources
API responds with a JSON object representing key-value pairs of filenames and what appear to be file sizes (number of bytes) of each file:
Code:
{
...
"wardrobe/casual-3-big":1220652,
"wardrobe/casual-3":22633,
"wardrobe/evening-1-big":1019972,
"wardrobe/evening-1":13460,
"wardrobe/evening-2-big":1052070,
...
}
For missing (or presumably the wrong size) files, the client issues a GET request for the resource (ie: GET /images/backgrounds/cafe-hall)
The API responds with the resource (interestingly enough, still passed from Express, and not as a static resource from nginx)
After all resources have been loaded, client issues a POST request for /api/status with the following keys:
- id: a UUID. I'm assuming this is used to look up the user's information through the Patreon API.
The API responds with a JSON object with the following keys:
- 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 client issues a POST request for /api/login with the following keys:
- id: a UUID, same as the one previously seen.
- lang: en the language mode in which the client should operate.
The API responds with a JSON object 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:
- 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)
The client issues a POST request for /api/start with the following keys:
- token: the previously seen token
The API responds with a JSON object with the following keys:
- state: event
- simpleText: A JSON object with the following keys:
- x: 890 (x offset in pixels)
- y: 267 (y offset in pixels)
- width: 700 (width value in pixels)
- color: #f8dcab (HTML color code)
- text: <size=34><color=#ffffff>Hi!</color></size>\nMy name is Kate, what's yours? Wait, don't tell me. I'm not supposed to know about you... (Literal HTML)
- sprites: Array containing one or more JSON objects with asset names and x,y offsets
- buttons: Array containing one or more JSON objects with asset names and x,y offsets
- leftButtons: Array containing one or more JSON objects with asset names and x,y offsets
- continue: boolean
When the user clicks on anything, the client issues a POST request for /api/update with the following keys:
- token: previously seen token
- action: doAction, dialogueAction (named method on the server?)
- parameter: next, dialogue:intro-doubt, dialogue:intro-principal-2, sign, intro-after-college, event:intro-12, (additional parameters to pass to that method?)
The API responds with a JSON object with the same keys as seen above (to start)
At some point along the line, the API responds to POST requests for /api/update with the following keys:
- state: location
- day: 1 (or 0?)
- datetime: 14:00 SA 29 (literal string representing the date and time)
- location: background image name
- locationDescription: LIVING ROOM (literal name of the location)
- money: 0 (money on the character)
- energy: 81 (energy of the character)
- hunger: 81 (hunger of the character)
- arousal: 5 (arousal of the character)
- items: array containing JSON objects with the following keys
- id: name of object
- visible: true
- state: string value (seen: :closed, )
- movements: array containing JSON objects representing where the character can move to (left location menu)
- places: array containing JSON objects representing sub spaces within the current area (right location menu)
- characters: array containing JSON objects representing characters who are present I'm assuming?
- sprites: array containing JSON objects representing sprites and where/how to display them on the screen.
- activeAreas: array containing JSON objects representing active areas and where/how to display them.