Skip to content

For developers

Ashen edited this page Dec 6, 2026 · 1 revision

For developers

← Home · Español

  • Code, comments, logs and console messages are in English (players' texts are translated in launcher/i18n.py and in the plugin).
  • 4_launcher.bat: opens the launcher with Python, without building.
  • plugin/: source of the optional BepInEx plugin and its compiled .dll. It's built against the assemblies BepInEx 6 (IL2CPP) generates in BepInEx\interop on the first game start; no game files are included.
  • build_exe.bat: builds dist\CrimeSightRevival.exe (development build, does not update itself).
  • CHANGELOG.md: what's new in each version. Its first block is what the launcher shows when it offers an update, if the file changes in the push; otherwise it shows the commit message.
  • Every push to main makes GitHub Actions build the .exe on Windows and publish a release (.github/workflows/release.yml). Installed launchers download it, check its SHA-256 hash and replace themselves.
  • tests/: automated tests (points, profile merging, whole matches, the launcher's texts in every language). Every pull request runs them, and checks that all the Python code compiles (.github/workflows/checks.yml). To run them yourself: python -m unittest discover -s tests -v.
  • Scripts without the launcher: 1_setup.bat (dependencies, keys and redirect), 2_server.bat and 3_restore_original_game.bat.

How it works inside

Unity 2020.3 with IL2CPP. The server address (https://cott-game.cs.konami.net) is changed in global-metadata.dat. Traffic is encrypted with AES-256-CBC; the keys are in the game's own resources.assets. The API is POST /cott/api/index.php and matches run over WebSocket with WAMP v2: the server drives the turn phases, hands out items and decides hazards and murders; the visual simulation runs on the client. Community server extras: POST /revival/sync (profiles), GET /revival/info, GET /revival/mods (the room's mod pack) and GET/POST /revival/discord (linking Discord for async pings).

Mods (server/modpack.py, server/modimage.py, launcher/modinject.py):

  • Stamps are StampData objects in resources.assets; the free ones are in StampSet 0. The game identifies them by type | face and sends their position in the list over the network (setIndex, dataIndex), so every player in the room needs the same list in the same order. Each new stamp gets a type from 1000 to 4095 (the game uses 0-38) computed from the mod folder and the file name, so it's stable and the order (the game sorts by type) comes out the same on every PC.
  • Avatars are CursorAvatarData objects in sharedassets3.assets, listed by the CursorAvatarSets of the level3 (menu) and level4 (match) scenes; over the network they travel by name (Icon_CSR_<hash>).
  • Without BepInEx, modinject.py rebuilds those files with UnityPy, always starting from the originals (*.original): it clones a template StampData/CursorAvatarData, adds an embedded RGBA32 texture and a 4-vertex sprite, and appends them to the lists. Messages are added to the game's text (ctg_name, in all 11 languages). If the saved wheel or avatar (PlayerPrefs) points to a mod that's gone, they're replaced with one of the game's.
  • With BepInEx, the game files stay original: the launcher writes the room's set to BepInEx\csr_live\live.json (in the game folder) and the plugin (plugin/CrimeSightRevivalMods.cs) creates the objects in memory (Texture2D + Sprite.Create + ScriptableObject.CreateInstance), adds them to the game's lists and adds the texts to TextManager.LangText. It checks every second and reapplies after every scene change.
  • Over the network, an internal zip carries the already adjusted and validated images (size, names, format): players never have to compress anything.

Clone this wiki locally