openvibers/source.openvibe.games PROJECT_INDEX.md
PROJECT_INDEX.md
| 1 | # OpenVibe: Source Project Index |
| 2 | |
| 3 | ## Identity |
| 4 | |
| 5 | - Game title: **OpenVibe: Source** |
| 6 | - Public domain: **OpenVibe.Games** |
| 7 | - Source mod folder: `game/openvibe.games` |
| 8 | - Repository root: `~/src/openvibe-source` |
| 9 | |
| 10 | ## Repository Map |
| 11 | |
| 12 | ```text |
| 13 | openvibe-source/ |
| 14 | ├── README.md Main overview and run instructions |
| 15 | ├── DEPLOYMENT_STATUS.md Current local/production status |
| 16 | ├── QUICK_REFERENCE.md Short command reference |
| 17 | ├── LINUX_SETUP.md Linux-first setup notes |
| 18 | ├── backend/ OpenVibe.Games API |
| 19 | ├── docs/ Architecture and implementation notes |
| 20 | ├── engine/ Ignored local Valve SDK checkout |
| 21 | ├── game/openvibe.games/ Source mod content |
| 22 | ├── hammer/vmf/ Editable Hammer maps |
| 23 | ├── infra/ Compose, Swarm, Kubernetes, CDN config |
| 24 | ├── launcher/ Desktop launcher shell |
| 25 | ├── sdk/openvibe/ Tracked C++ GameDLL patch sources |
| 26 | └── tools/ Build/run/smoke/map tooling |
| 27 | ``` |
| 28 | |
| 29 | ## Implemented Systems |
| 30 | |
| 31 | | Area | Status | Key files | |
| 32 | | --- | --- | --- | |
| 33 | | Backend API | Implemented | `backend/src/app.ts`, `backend/src/repository-pg.ts`, `backend/src/sessions.ts` | |
| 34 | | Backend tests | Passing | `backend/src/app.test.ts` | |
| 35 | | Steam auth route | Implemented | `POST /v1/auth/steam`; requires production Steam env vars | |
| 36 | | Session verification | Implemented | `GET /v1/auth/session` — Bearer-token validation with Redis | |
| 37 | | In-game Steam auth GUI | Implemented | `client/index.html` — embedded web UI served at `/client/`; `openvibe://auth/steam` + `openvibe://ready` bridge handlers | |
| 38 | | Redis sessions | Implemented | `backend/src/sessions.ts` | |
| 39 | | CDN asset manifest | Implemented | `GET /v1/assets/manifest` | |
| 40 | | C++ client travel | Implemented | `sdk/openvibe/client/hl2mp/openvibe_client.cpp` | |
| 41 | | C++ main menu | Implemented | `sdk/openvibe/client/hl2mp/vgui_openvibe_menu.cpp`, `game/openvibe.games/resource/GameMenu.res` | |
| 42 | | C++ server validation | Implemented | `sdk/openvibe/server/hl2mp/openvibe_server.cpp` | |
| 43 | | Prop Hunt disguise | Implemented | `ov_prophunt_disguise`, `ov_prophunt_reset_disguise` | |
| 44 | | Fort Wars placement | Implemented | `ov_fortwars_spawn` | |
| 45 | | VScript game modes | Implemented prototypes | `game/openvibe.games/scripts/vscripts/ov_*.nut` | |
| 46 | | GModJS framework | Implemented | `game/openvibe.games/js/core/*` — hook/net/entity/ents/player/team/file/concommand/loader (GMod API shapes in JS); design in `docs/GMODJS_ARCHITECTURE.md`, guide in `docs/OPENVIBE_JS_SCRIPTING.md` | |
| 47 | | net library (JS) | Implemented | `js/core/net.js` — full GMod surface, pooling, chunked transport, per-player rate limits | |
| 48 | | Entity system (JS + native) | Implemented | `js/core/entity.js`, `js/core/ents.js`, `sdk/openvibe/shared/ov_js_entity.cpp` (`OV.entCreate`/`OV.entCall`); scripted entities in `js/entities/` | |
| 49 | | Client realm runtime | Implemented | `engine/openvibe-js-runtime/ov-runtime.js --realm client` + `sdk/openvibe/client/hl2mp/openvibe_js_client.cpp` | |
| 50 | | Script exec commands | Implemented | `js_run`, `js_openscript`, `js_run_cl`, `js_openscript_cl` (gated by `sv_allowcsjs`), `ov_npm` | |
| 51 | | AddCSJSFile + client sync | Implemented | `js/core/file.js` — manifest + net-based download into `js/ov_downloads/` | |
| 52 | | npm hotloading | Implemented | runtime control server `POST /npm`, `ov_npm`, fs.watch reload; `js/package.json` + `js/vendor/` | |
| 53 | | Unified GUI (launcher + in-game) | Implemented | `client/index.html` + `client/ui-sync.js` served to Electron (5173), backend (3000), and the CEF panel; routes incl. `console`, `options`, `hud` | |
| 54 | | In-game console + options GUI | Implemented | Console route (SSE logs, js_run/exec/npm), Options route (`openvibe://convar` bridge), HUD overlay (`OV_HudState`) | |
| 55 | | Script packages API | Implemented | `GET /v1/scripts/packages`, `GET /v1/scripts/packages/:id`, `GET /v1/scripts/packages/:id/files`, admin upsert/enable/disable routes | |
| 56 | | JS round system | Implemented | Base round state machine; Prop Hunt, Deathrun, Fort Wars, Traitor Town each with teams, timers, win conditions | |
| 57 | | Batch match rewards | Implemented | `POST /v1/matches/end/batch` — rewards multiple players in one idempotent call | |
| 58 | | C++ RoundStart/RoundEnd | Implemented | `OpenVibeJS_Server_RoundStart/End`, `ov_round_start`, `ov_round_end` ConCommands | |
| 59 | | Maps | Compiled | `game/openvibe.games/maps/*.bsp` | |
| 60 | | Production infra | Scaffolded | `infra/docker-compose.yml`, `infra/production/docker-stack.yml`, `infra/kubernetes/openvibe.yaml` | |
| 61 | |
| 62 | ## Game Modes |
| 63 | |
| 64 | | Mode | Map | Local target | Authenticated command | |
| 65 | | --- | --- | --- | --- | |
| 66 | | Hub | `ov_hub` | `127.0.0.1:27015` | `ov_join hub` | |
| 67 | | Prop Hunt | `ph_openvibe_dev` | `127.0.0.2:27016` | `ov_join prophunt` | |
| 68 | | Deathrun | `dr_openvibe_dev` | `127.0.0.3:27017` | `ov_join deathrun` | |
| 69 | | Fort Wars | `fw_openvibe_dev` | `127.0.0.4:27018` | `ov_join fortwars` | |
| 70 | | Traitor Town | `tt_openvibe_dev` | `127.0.0.5:27019` | `ov_join traitortown` | |
| 71 | |
| 72 | ## Build And Test |
| 73 | |
| 74 | Backend: |
| 75 | |
| 76 | ```bash |
| 77 | cd ~/src/openvibe-source/backend |
| 78 | npm run build |
| 79 | npm test |
| 80 | ``` |
| 81 | |
| 82 | Source SDK: |
| 83 | |
| 84 | ```bash |
| 85 | cd ~/src/openvibe-source |
| 86 | tools/build-sdk-linux.sh |
| 87 | tools/setup-openvibe-bin.sh |
| 88 | ``` |
| 89 | |
| 90 | SRCDS: |
| 91 | |
| 92 | ```bash |
| 93 | cd ~/src/openvibe-source |
| 94 | OPENVIBE_SRCDS_MAP_DELAY=3 OPENVIBE_SRCDS_SMOKE_TIMEOUT=45 tools/smoke-srcds.sh |
| 95 | ``` |
| 96 | |
| 97 | Full stack: |
| 98 | |
| 99 | ```bash |
| 100 | cd ~/src/openvibe-source |
| 101 | OPENVIBE_SRCDS_MAP_DELAY=3 tools/dev-up.sh |
| 102 | node tools/smoke-api.mjs |
| 103 | tools/dev-down.sh |
| 104 | ``` |
| 105 | |
| 106 | GModJS framework (no C++ build needed): |
| 107 | |
| 108 | ```bash |
| 109 | cd ~/src/openvibe-source |
| 110 | node tools/test-gmodjs.mjs # 131-check suite: hooks/net/entities/players/files/gamemodes |
| 111 | node tools/smoke-js-core-node.mjs |
| 112 | node tools/smoke-js-gamemodes.mjs |
| 113 | node tools/smoke-runtime-ipc.mjs # both Node runtimes over real TCP IPC |
| 114 | node tools/smoke-ui.mjs # unified GUI serving + route markers |
| 115 | ``` |
| 116 | |
| 117 | ## Verified On July 2, 2026 |
| 118 | |
| 119 | - Backend TypeScript build passed; Vitest suite passed: 14 tests. |
| 120 | - Source SDK 2013 Linux64 build passed with the OpenVibe C++ patch incl. the |
| 121 | GModJS additions (`ov_js_entity.cpp`, `js_run`/`js_openscript`/`ov_npm`, |
| 122 | client runtime events, `openvibe://cmd|convar` bridge, console spew tap). |
| 123 | - SRCDS smoke passed for all five maps with the rebuilt server.so; the |
| 124 | embedded QuickJS boots the full GModJS core (net/entity/player/team/file/ |
| 125 | concommand/loader + addons + npm require). |
| 126 | - Live SRCDS console test: `js_run` evaluated in-engine, `js_openscript` |
| 127 | ran a script from `js/`, `ents.Create("ov_bouncy_crate")` spawned and was |
| 128 | queryable via `ents.FindByClass`. |
| 129 | - GModJS suite: 131/131 checks; runtime IPC smoke and UI smoke passed. |
| 130 | - npm hotloading verified live: `POST /npm install is-odd` into the running |
| 131 | runtime, then `require("is-odd")(7)` returned true without a restart. |
| 132 | |
| 133 | ## Production Readiness |
| 134 | |
| 135 | The local MVP foundation is operational. Public deployment still needs: |
| 136 | |
| 137 | - real Steam app credentials |
| 138 | - hosted CDN storage for player models/trails |
| 139 | - production PostgreSQL/Redis with backups |
| 140 | - deployment secrets management |
| 141 | - metrics/logging/alerts |
| 142 | - expanded game mode content and moderation tools |
| 143 |