-
Notifications
You must be signed in to change notification settings - Fork 23
theater architecture
Shadowsun™ edited this page Sep 20, 2026
·
1 revision
This page describes how the core theater objects fit together. Useful for developers who want to extend queue logic, networking, or the HTML player.
| Object | Module | Role |
|---|---|---|
Location |
modules/location |
Spatial areas + “is player inside theater X?” |
THEATER |
modules/theater/sh_theater.lua |
One theater instance (queue, current video, owner, flags) |
VIDEO |
modules/theater/sh_video.lua |
One queued / playing media item |
SERVICE |
modules/theater/services/* |
URL → metadata → embed player |
| Scoreboard UI | modules/scoreboard |
Queue list, request panel, owner/admin controls |
- Map loads → location file registers boxes (some with a
Theatertable). - For each theater location the gamemode creates a
THEATERobject. - Players enter/leave →
PlayerChangeLocation→ theater adds/removes the player. - A player requests a URL → matching
SERVICEresolves metadata →VIDEOis created and pushed onto the theater queue. - When the current video finishes (or is skipped) the next
VIDEOis started. - Clients receive net messages and open the corresponding HTML provider on their screen panel.
Identity & geometry
-
Id– location index -
Name(),GetFlags(),GetPos(),GetAngles(),GetSize() -
IsPrivate(),IsPrivileged()
Playback
- Current video, playlist / queue, skip votes
-
RequestVideo,SkipVideo,Seek,SetPaused,Reset,PlayDefault - Queue lock (owner can prevent new requests)
Ownership (private theaters)
- Owner player / SteamID
- Integrated with the rent module when renting is enabled
Thumbnails
- Optional thumbnail entity outside the room that mirrors the current video
| Field | Meaning |
|---|---|
Type() |
Service class name (youtube, dailymotion, …) |
Data() |
Service-specific ID string |
Title(), Duration(), Thumbnail()
|
Display metadata |
StartTime() |
Server CurTime() when playback started (used for sync) |
| Owner nick / SteamID | Who requested it |
| Votes | Up-votes when queue mode = 1 |
- Theater state (current video, queue snapshot, pause, lock) is networked to players inside that theater.
- Request / vote / seek / pause commands are sent from client → server, validated (location, privileges, rate limits), then applied.
- The rent module adds its own net messages for rent / refund / filter lists.
Exact message names live in the sv_*.lua / cl_*.lua files of the theater and rent modules; prefer extending existing helpers over adding raw net.Receive calls.
- Client theater panel is a DHTML surface.
-
SERVICE:LoadProvideropens an embed URL or injects HTML. - JavaScript must set
window.cinema_controllerand callexTheater.controllerReady(). - The injected
window.theater(CinemaPlayer) bridges volume, seek, play, pause and soft-sync.
Base URL for hosted HTML helpers:
theater.GetCinemaURL("youtube.html") -- etc.Controlled by the ConVar cinema_url (do not change unless you host your own copy of the player pages).
| Goal | Where to look |
|---|---|
| New media platform | New file in services/ – see Custom Video Service
|
| Extra owner power | Extend THEATER methods + scoreboard owner panel |
| Different queue rules |
cinema_queue_mode + queue helpers in theater module |
| Currency for renting | modules/rent/sh_currency.lua |
| New chair models | modules/seats/sh_seats.lua |
| New language |
i18n/languages/*.lua – see Translations
|