flowchart LR
C["Photographer's gamestudio ped + camera"] -->|screenshot-basic| N["Studio NUIchroma key, crop, webp"]
N -->|latent event| S["server.jschecks, claims, history"]
S -->|signed PUT| R["Cloudflare R2"]
R --> CDN["Public CDN"]
CDN --> P["Players' UIsclothing, garages, admin"]
The client dresses a ped in an empty studio under the map, frames each item and grabs the frame. The studio page removes the background and turns it into a webp, then sends it to the server, which uploads it to R2. Players' menus load photos straight from the CDN, so nothing image-related is streamed with the resource.
Architecture notes#
| Area | Where | Notes |
|---|---|---|
| Studio | client/client.lua |
One routing bucket per photographer, so team members never appear in each other's photos. The world (weather, time, needs) is held still while in the studio. |
| Image processing | resources/build/glitch-process.js, server/imageworker.js |
Clothing is processed in the photographer's NUI and arrives as the finished thumb. Vehicles and objects go through a worker thread on the server, so the main thread never blocks on pixels. |
| Uploads | server/r2.js |
Signed S3 requests on keep-alive connections, a catalogue of what the bucket holds (cached to r2-catalog.cache.txt) and optional Cloudflare cache purges when a photo is replaced. |
| Team runs | server/server.js (jobs, claims) |
Work is split into blocks (10 drawables, one tattoo zone, one car). The server gives each block to one session; a block counts as done once its uploads have landed. When a member leaves, their blocks go back to the team, and the run ends when the last member leaves. |
| Sessions | server/server.js (sessions) |
Before a run overwrites a photo, the old one is kept in memory, so Discard can put it back. Session ids are unique and tied to the player who opened them. |
| Photo index | server/photoindex.js |
Maps each photo to its item's collection and a fingerprint of its stream files. Moved items are renamed and changed items offered for a retake. |
| Saved data | resource root | photo-index.json, photo-authors.json, photo-versions.json, run-history.json and clothing-*.json are written by the server, debounced and flushed when the resource stops. They hold your city's data and player names, so they are git-ignored. |
| Permissions | server/config_bridge.lua |
Copies Customize values to convars for server.js and registers the commands on the server, so the ace check sees runtime principals. |
Stuck on a step?Ask in the Discord →