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 — per-connection client object

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:clientStartUp.

EventLocationPayloadFires when
clientStartUpserver-game/src/client.js:22{ }Module load, once, in the game server's main thread.
clientInitserver-game/src/client.js:41{ this: this, room, info }A ClientConstructor is being built for a newly joining player or bot.
clientGameJoinedExtraInfosserver-game/src/client.js:94{this:this, room: room, extraInfo: extraInfo}Extra join-time params (e.g. a custom join payload) are being processed for this client.
clientInitEndserver-game/src/client.js:110{ this: this, room, info }End of client construction.
clientUpdateLoadoutserver-game/src/client.js:119{ this: this, classIdx, primary_item_id, secondary_item_id, colorIdx, hatId, stampId }Before a loadout change (class/weapons/color/hat/stamp) is applied to this client.
clientUpdateLoadoutEndserver-game/src/client.js:131{ this: this, classIdx, primary_item_id, secondary_item_id, colorIdx, hatId, stampId }After a loadout change has been applied to this client.
clientApplyLoadoutserver-game/src/client.js:135{ this: this }The loadout is being applied to the live Player instance.
clientInstantiatePlayerserver-game/src/client.js:148{ this: this }Before the Player object is constructed for this client.
clientInstantiatePlayerEndserver-game/src/client.js:196{ this: this }After the Player object has been constructed for this client.
requestRespawnserver-game/src/client.js:262{this: this, player: this.player, spawnPoint}A respawn request from this client is being processed.
CommCodeSyncEndserver-game/src/client.js:327{this: this, player: this.player, adjustment: this.adjustment, stateIdx, startIdx, i}End of processing an incoming input-sync packet from this client — a natural hook for anti-cheat heuristics that inspect aim-angle jitter between synced states.
beforeChatserver-game/src/client.js:345{ this: this, text }Right before a sent chat message is processed at all (before the chatLineCap/censor/mention handling) - set plugins.cancel = true to silently drop it, e.g. legacyadmin's mute enforcement (game/muteCache.js).
clientPackSyncserver-game/src/client.js:588{ this: this, output }Building this client's outbound sync packet — fires once per sync, before the per-state loop below.
clientPackSyncLoopserver-game/src/client.js:607{ this: this, output, state }Building this client's outbound sync packet — fires once per buffered state entry being packed.

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 — main-thread server process
Next
game: events — room lifecycle & tick loop