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

Database Schema

Audience: Server operators, plugin authors, AI agents · Prereqs: The Database

Every CREATE TABLE statement in server-services/src/data_management/recordsManagement.js, extracted directly from source. This is the literal DDL LegacyShell runs on boot - for the editability tags (USER-EDITABLE / SYS-EDITABLE / SYS-READONLY) and what each table is for, see The Database instead; this page is the mechanical column-level reference.

users

Column definitionNote
account_id INTEGER PRIMARY KEY AUTOINCREMENT-
username TEXT UNIQUE-
password TEXT-
authToken TEXT-
kills INTEGER DEFAULT 0-
deaths INTEGER DEFAULT 0-
streak INTEGER DEFAULT 0-
currentBalance INTEGER DEFAULT 1000-
eggsSpent INTEGER DEFAULT 0-
ownedItemIds TEXT DEFAULT '[50001,50002,50003,50004,50005,50006,100001,100002,100003,100004,100005,100006,200000,300000,250000,350000,150000]'Will store as JSON string
loadout TEXT DEFAULT '{"primaryId":[200000,300000,250000,350000],"secondaryId":[150000,150000,150000,150000],"classIdx":0,"colorIdx":0,"hatId":null,"stampId":null}'Will store as JSON string
version INTEGER DEFAULT 1-
upgradeProductId INTEGER DEFAULT 0-
upgradeMultiplier INTEGER DEFAULT NULL-
upgradeAdFree BOOLEAN DEFAULT TRUE-
upgradeExpiryDate INTEGER DEFAULT 0-
maybeSchoolEmail INTEGER DEFAULT NULL-
adminRoles INTEGER DEFAULT 0-
dateCreated INTEGER DEFAULT (strftime('%s', 'now'))-
dateModified INTEGER DEFAULT (strftime('%s', 'now'))-

ip_requests

Column definitionNote
ip TEXT PRIMARY KEY-
sensitive_count INTEGER DEFAULT 0-
regular_count INTEGER DEFAULT 0-
last_sensitive_reset INTEGER DEFAULT (strftime('%s', 'now'))-
last_regular_reset INTEGER DEFAULT (strftime('%s', 'now'))-

sessions

Column definitionNote
session_id TEXT PRIMARY KEY-
user_id INTEGER UNIQUE-
ip_address TEXT-
dateCreated INTEGER DEFAULT (strftime('%s', 'now'))-
expires_at INTEGER-

items

Column definitionNote
id INTEGER PRIMARY KEY-
meta_id INTEGER-
name TEXT DEFAULT 'Unknown item'-
is_available BOOLEAN DEFAULT TRUE-
price INTEGER DEFAULT 0-
item_class TEXT DEFAULT 'Unknown class'-
item_type_id INTEGER DEFAULT 0-
item_type_name TEXT DEFAULT 0-
exclusive_for_class INTEGER-
item_data TEXT DEFAULT '{"class":Eggk47,"meshName":"gun_eggk47"}'-
dateCreated INTEGER DEFAULT (strftime('%s', 'now'))-
dateModified INTEGER DEFAULT (strftime('%s', 'now'))-

codes

Column definitionNote
key TEXT PRIMARY KEY DEFAULT (<random 12-character string, generated via 12 chained substr(...) calls - see source for the exact character set>)-
item_ids TEXT DEFAULT '[]'-
eggs_given INTEGER DEFAULT 0-
uses INTEGER DEFAULT 1-
used_by TEXT DEFAULT '[]'-
dateCreated INTEGER DEFAULT (strftime('%s', 'now'))-
dateModified INTEGER DEFAULT (strftime('%s', 'now'))-

maps

Column definitionNote
name TEXT PRIMARY KEY DEFAULT 'Unknown map'-
sun TEXT DEFAULT '{"direction":{"x":0.2,"y":1,"z":-0.3},"color":"#FFFFFF"}'-
ambient TEXT DEFAULT '#000000'NOT USED!
fog TEXT DEFAULT '{"density":0.1,"color":"#33334C"}'NOT USED!
data TEXT DEFAULT '{}'-
palette TEXT DEFAULT '[null,null,null,null,null,null,null,null,null,null]'-
render TEXT DEFAULT '{}'NOT USED!
width INTEGER DEFAULT -9999-
height INTEGER DEFAULT -9999-
depth INTEGER DEFAULT -9999-
surfaceArea INTEGER DEFAULT 0-
extents TEXT DEFAULT '{"x":{"max":0,"min":10000},"y":{"max":0,"min":10000},"z":{"max":0,"min":10000},"width":-9999,"height":-9999,"depth":-9999}'-
skybox TEXT DEFAULT ''-
modes TEXT DEFAULT '{"FFA":true,"Teams":true}'-
availability TEXT DEFAULT 'both'-
numPlayers INTEGER DEFAULT 18-
dateCreated INTEGER DEFAULT (strftime('%s', 'now'))-
dateModified INTEGER DEFAULT (strftime('%s', 'now'))-

game_servers

Column definitionNote
auth_key TEXT PRIMARY KEY DEFAULT (<random 32-character string, generated via 32 chained substr(...) calls - see source for the exact character set>)-
name TEXT DEFAULT 'Unnamed server'-
address TEXT DEFAULT 'localhost:13372'-
dateCreated INTEGER DEFAULT (strftime('%s', 'now'))-
dateModified INTEGER DEFAULT (strftime('%s', 'now'))-

flags

Column definitionNote
name TEXT PRIMARY KEY DEFAULT 'flag'-
value TEXT DEFAULT 'value'-

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
Enums & Lookup Tables
Next
Config Reference