LegacyShell WikiLegacyShell Wiki
Back to LegacyShell
Home
Wiki
Plugins
Docs
Back to LegacyShell
Home
Wiki
Plugins
Docs
  • Documentation

    • Getting Started

      • What is LegacyShell?
      • Speed Setup
      • Requirements
      • Installation
      • First Run
      • Config Files
      • Making an Account
      • Troubleshooting (Getting Started)
    • Running a Server

      • Architecture Overview
      • The Database
      • Users and Ranks
      • Adding Game Servers
      • Client Mirrors
      • Perpetual
      • Backups
      • Rate Limiting
      • Moderation
      • Closed Mode
      • Deployment
      • Troubleshooting (Running a Server)
      • Hosting for Someone Else's Instance
    • Content Creation

      • Maps
      • Dealing with Babylon Models
      • Map Blocks
      • Items and Skins
      • Hats and Stamps
      • Sounds
      • Gamemodes
      • Seasonal Events
    • Plugin Development

      • Quickstart
      • I Want To...
      • Anatomy of a Plugin
      • Lifecycle
      • Dependencies
      • Events (Concept)
      • Event Reference

        • services: events
        • game: events — shared logic (src/shell/)
        • game: events — main-thread server process
        • game: events — per-connection client object
        • game: events — room lifecycle & tick loop
        • game: events — in-browser gameplay
        • client: events — client server & build pipeline
      • Commands
      • Client-Side Code
      • Static Assets
      • Content Packs
      • Networking
      • Workers and State
      • Prediction and Authority
      • Recipes

        • Recipe: Killstreaks
        • Recipe: New Pickup Item
        • Recipe: New Gamemode
        • Recipe: Custom Weapon
        • Recipe: UI Modification
        • Recipe: Discord Integration
        • Recipe: Replacing Core Behaviour
        • Recipe: Persistent Plugin Storage
        • Recipe: Rewarding Players with Currency
        • Recipe: Custom Per-Player Data
        • Recipe: Custom Theme
      • Publishing
      • Pitfalls
      • Modifiers
      • Sound and Apollo
    • Codebase Reference

      • Repo Layout
      • Shared Shell Layer
      • Server-Only Markers
      • The ss Object
      • Build Pipeline
      • Stamps and Babylons
      • Game Loop
      • Rooms and Workers
      • Wire Protocol
      • Generated

        • Wire Protocol Opcodes
        • Enums & Lookup Tables
        • Database Schema
        • Config Reference
        • Slash Command Reference
      • Services Internals
      • Catalog and Items
      • Permissions Internals
      • Physics and Collision
      • Known Quirks
      • Codebase Anecdotes
      • Development Timeline
    • Contributing

      • Documentation Style Guide
      • Generators
      • For AI Agents

game: events — main-thread server process

Audience: Plugin authors and AI agents · Prereqs: Events (concept)

Every plugins.emit(...) call site found in the files below, extracted directly from source - not hand-maintained. Unprefixed at the call site; PluginManager.emit adds game: before checking for listeners, so e.g. the first row below actually fires as game:onLoad.

EventLocationPayloadFires when
onLoadserver-game/start-game.js:39{ ss }Game process finished its own init, before connecting the outbound socket to services.
connectWebSocketMessageserver-game/start-game.js:170{ this: this, ss, msg }Any message received on the outbound services websocket.
requestConfigReceivedserver-game/start-game.js:178{msg}Specifically a requestConfig response (maps/items/servers/config sync) was received from services.
servicesCommandserver-game/start-game.js:249{ msg }Services routed an admin-style command to THIS specific instance (see services/registry.js's adminRouteToServer, which targets by our own auth_key) down our existing persistent connection. msg.payload carries the actual command; a listener replies via a fresh one-off #wsrequest call wrapped as adminRouteToServerResponse, not back down this connection.
beforeJoinRoomserver-game/src/roomManager.js:306{ room, msg, ws, ip }Right before a join is accepted, before the existing bootedIps/uuid/session/locked checks — set plugins.cancel = true to reject it (closes with Comm.Close.booted), e.g. legacyadmin's global ban-list check (game/banCache.js).
sendGameInfoserver-game/src/roomManager.js:423{gameInfo}Before the aggregated per-room player/room-count snapshot is pushed to services.

This page was drafted with AI assistance and reviewed for accuracy. If something looks wrong, please open a PR or flag it.

Edit this page on GitHub
Prev
game: events — shared logic (src/shell/)
Next
game: events — per-connection client object