From 9565efa60f907791fa4d6833f43cbabbfe8f4278 Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Sun, 16 Aug 2026 18:27:44 -0500 Subject: [PATCH 1/4] Removes old things that are giving me problems now --- tools/LinuxOneShot/README.md | 74 ------- tools/LinuxOneShot/SetupProgram/Dockerfile | 8 - tools/LinuxOneShot/SetupProgram/PreCompile.sh | 92 -------- tools/LinuxOneShot/SetupProgram/Program.cs | 208 ------------------ .../SetupProgram/SetupProgram.csproj | 12 - tools/LinuxOneShot/docker-compose.yml | 49 ----- tools/tgs4_scripts/PreCompile.bat | 15 -- tools/tgs4_scripts/PreCompile.sh | 88 -------- tools/tgs4_scripts/PreSynchronize.bat | 3 - tools/tgs4_scripts/PreSynchronize.ps1 | 31 --- tools/tgs4_scripts/PreSynchronize.sh | 37 ---- tools/tgs4_scripts/WatchdogLaunch.sh | 41 ---- 12 files changed, 658 deletions(-) delete mode 100644 tools/LinuxOneShot/README.md delete mode 100644 tools/LinuxOneShot/SetupProgram/Dockerfile delete mode 100644 tools/LinuxOneShot/SetupProgram/PreCompile.sh delete mode 100644 tools/LinuxOneShot/SetupProgram/Program.cs delete mode 100644 tools/LinuxOneShot/SetupProgram/SetupProgram.csproj delete mode 100644 tools/LinuxOneShot/docker-compose.yml delete mode 100644 tools/tgs4_scripts/PreCompile.bat delete mode 100644 tools/tgs4_scripts/PreCompile.sh delete mode 100644 tools/tgs4_scripts/PreSynchronize.bat delete mode 100644 tools/tgs4_scripts/PreSynchronize.ps1 delete mode 100644 tools/tgs4_scripts/PreSynchronize.sh delete mode 100644 tools/tgs4_scripts/WatchdogLaunch.sh diff --git a/tools/LinuxOneShot/README.md b/tools/LinuxOneShot/README.md deleted file mode 100644 index 50bd49028cc1..000000000000 --- a/tools/LinuxOneShot/README.md +++ /dev/null @@ -1,74 +0,0 @@ -This is @Cyberboss rage code - -The goal is a one stop solution for hosting /tg/station on linux via Docker. Will not work with Docker on Windows. - -This requires Docker with the `docker-compose` command to be installed on your system. See ubuntu instructions [here](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository). If you fail to find the `docker-ce` package refer to [this StackOverflow answer](https://unix.stackexchange.com/a/363058). - -Some basic configuration options in `docker-compose.yml` before starting: -- Change TGS_ADMIN_CKEY to your ckey so you may have initial control over the server. -- Change TGS_SCHEMA_MAJOR_VERSION to your repo's latest schema major version. -- Change TGS_SCHEMA_MINOR_VERSION to your repo's latest schema minor version. -- If you want to change the MariaDB password, there are three locations in the file it must be changed from its default value of `ChangeThisInBothMariaDBAndTgsConnectionString`. -- Change TGS_BYOND to set the initial BYOND version. -- Ports are mapped in the form `:` NEVER change the internal port. If you want to prevent a service from being exposed, delete/comment out the entire line. - - The first (3306) is the exposed mariadb port. Do not expose this over the internet without changing the password. In general it's a bad idea. - - The second (1337) is the exposed DreamDaemon port - - The third (5000) is the exposed TGS API port. Do not expose this over the internet. Setup an HTTPS reverse proxy instead. -- Change TGS_REPO to set the repository used. Note, this must be a /tg/ derivative from at least 2019 that implements the latest TGS [DreamMaker API](https://github.com/tgstation/tgstation-server#integrating). Repositories that follow tgstation/tgstation will have this automatically. It also must contain a prefixed SQL schema setup file. - -To launch, change to this directory and run `docker-compose up`. The initial setup will take a long time. If that fails, Ctrl+C out, run `docker-compose down`, remove `./TGS_Instances` and `./Database`, and try again. Once setup is complete, you can either leave the terminal running, or `Ctrl+C` out (this will stop DreamDaemon) and run `docker-compose -d` to run it in the background. - -What it does: - -- Starts mariadb with the data files in `./Database` on port 3306 -- Installs and starts Tgs4 (using latest stable docker tag, no HTTPS) on port 5000. Configuration in `./TGS_Config`, logs in `./TGS_Logs`. -- Configures a TGS instance for tgstation in `./TGS_Instances` (SetupProgram) - - The instance is configured to autostart - - Repo is cloned from the origin specified in the `docker-compose.yml` - - BYOND version is set to the latest one specified in the `docker-compose.yml` - - A script will be run to setup dependencies. This does the following every time the game is built: - - Reads dependency information from `dependencies.sh` in the root of the repository - - Installs the following necessary packages into the TGS image - - Rust/cargo - - git - - cmake - - grep - - g++-6 - - g++-6-multilib - - mysql-client - - libmariadb-dev:i386 - - libssl-dev:i386 - - Builds rust-g in `./TGS_Instances/main/Configuration/EventScripts/rust-g` and copies the artifact to the game directory. - - Builds BSQL in `./TGS_Instances/main/Configuration/EventScripts/BSQL` and copies the artifact to the game directory. - - Sets up `./TGS_Instances/main/Configuration/GameStaticFiles/config` with the initial repository config. - - Sets up `./TGS_Instances/main/Configuration/GameStaticFiles/data`. - - If it doesn't exist, create the `ss13_db` database on the mariadb server and populate it with the repository's. - - Start DreamDaemon and configure it to autostart and keep it running via TGS. - - Updates will be pulled from the default repository branch and deployed every hour - -What it DOESN'T do: - -- Configure sane MariaDB security -- TGS Test merging -- TGS Chat bots -- Handle updating BYOND versions -- Handle updating the database schema -- Manage TGS users, permissions, or change the default admin password -- Provide HTTPS for TGS -- Expose the DB to the internet UNLESS you have port 3306 forwarded for some ungodly reason -- Port forward or setup firewall rules for DreamDaemon or TGS -- Notify you of TGS errors past initial setup -- Keep MariaDB logs -- Backup ANYTHING -- Pretend like it's a long term solution - -This is enough to host a production level server !!!IN THEORY!!! This script guarantees nothing and comes with no warranty - -You can change the TGS_BYOND and TGS_REPO variables when setting up the first time. But further configuration must be done with TGS itself. - -You can connect to TGS with [Tgstation.Server.ControlPanel](https://github.com/tgstation/Tgstation.Server.ControlPanel/releases) (Binaries provided for windows, must be compiled manually on Linux). -- Connect to `http://localhost:5000`. Be sure to `Use Plain HTTP` and `Default Credentials` - -You should learn how to manually setup TGS if you truly want control over what your server does. - -You have been warned. diff --git a/tools/LinuxOneShot/SetupProgram/Dockerfile b/tools/LinuxOneShot/SetupProgram/Dockerfile deleted file mode 100644 index 9e187ff162cd..000000000000 --- a/tools/LinuxOneShot/SetupProgram/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. - -# THIS SHOULD NOT BE USED TO CREATE THE PRODUCTION BUILD IT'S FOR DEBUGGING ONLY - -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 -WORKDIR /app -COPY . . -ENTRYPOINT ["dotnet", "run"] diff --git a/tools/LinuxOneShot/SetupProgram/PreCompile.sh b/tools/LinuxOneShot/SetupProgram/PreCompile.sh deleted file mode 100644 index ed2feb4f1a34..000000000000 --- a/tools/LinuxOneShot/SetupProgram/PreCompile.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -# REPO MAINTAINERS: KEEP CHANGES TO THIS IN SYNC WITH /tools/tgs4_scripts/PreCompile.sh - -set -e -set -x - -#load dep exports -#need to switch to game dir for Dockerfile weirdness -original_dir=$PWD -cd "$1" -. dependencies.sh -cd "$original_dir" - -#find out what we have (+e is important for this) -set +e -has_git="$(command -v git)" -has_cargo="$(command -v ~/.cargo/bin/cargo)" -has_sudo="$(command -v sudo)" -has_grep="$(command -v grep)" -DATABASE_EXISTS="$(mysqlshow --host mariadb --port 3306 --user=root --password=$MYSQL_ROOT_PASSWORD ss13_db| grep -v Wildcard | grep -o ss13_db)" -set -e - -# install cargo if needful -if ! [ -x "$has_cargo" ]; then - echo "Installing rust..." - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-host i686-unknown-linux-gnu - . ~/.profile -fi - -# apt packages, libssl needed by rust-g but not included in TGS barebones install -if ! { [ -x "$has_git" ] && [ -x "$has_grep" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] && [ -f "/usr/bin/mysql" ] && [ -d "/usr/include/mysql" ]; }; then - echo "Installing apt dependencies..." - if ! [ -x "$has_sudo" ]; then - dpkg --add-architecture i386 - apt-get update - apt-get install -y git libssl-dev:i386 grep mysql-client lib32z1 pkg-config libssl-dev - rm -rf /var/lib/apt/lists/* - else - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install -y git libssl-dev:i386 grep mysql-client lib32z1 pkg-config libssl-dev - sudo rm -rf /var/lib/apt/lists/* - fi -fi - -#update rust-g -if [ ! -d "rust-g" ]; then - echo "Cloning rust-g..." - git clone https://github.com/tgstation/rust-g -else - echo "Fetching rust-g..." - cd rust-g - git fetch - cd .. -fi - -echo "Deploying rust-g..." -cd rust-g -git checkout "$RUST_G_VERSION" -env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu -mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so" -cd .. - -# compile tgui -echo "Compiling tgui..." -cd "$1" -chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 -env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 CBT_BUILD_MODE="TGS" tools/bootstrap/node tools/build/build.js -cd "$original_dir" - -if [ ! -d "../GameStaticFiles/config" ]; then - echo "Creating initial config..." - cp -r "$1/config" "../GameStaticFiles/config" - echo -e "SQL_ENABLED\nFEEDBACK_TABLEPREFIX SS13_\nADDRESS mariadb\nPORT 3306\nFEEDBACK_DATABASE ss13_db\nFEEDBACK_LOGIN root\nFEEDBACK_PASSWORD $MYSQL_ROOT_PASSWORD\nASYNC_QUERY_TIMEOUT 10\nBLOCKING_QUERY_TIMEOUT 5\nBSQL_THREAD_LIMIT 50" > "../GameStaticFiles/config/dbconfig.txt" - echo "$TGS_ADMIN_CKEY = Host" > "../GameStaticFiles/config/admins.txt" -fi - -if [ "$DATABASE_EXISTS" != "ss13_db" ]; then - echo "Creating initial SS13 database..." - mysql -u root --password=$MYSQL_ROOT_PASSWORD -h mariadb -P 3306 -e 'CREATE DATABASE IF NOT EXISTS ss13_db;' - cat "$1/$TGS_PREFIXED_SCHEMA_FILE" - mysql -u root --password=$MYSQL_ROOT_PASSWORD -h mariadb -P 3306 ss13_db < "$1/$TGS_PREFIXED_SCHEMA_FILE" - mysql -u root --password=$MYSQL_ROOT_PASSWORD -h mariadb -P 3306 ss13_db -e "INSERT INTO \`SS13_schema_revision\` (\`major\`, \`minor\`) VALUES ($TGS_SCHEMA_MAJOR_VERSION, $TGS_SCHEMA_MINOR_VERSION)" -fi - -# compile tgui -echo "Compiling tgui..." -cd "$1" -chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 -chmod +x tgui/bin/tgui -env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 CBT_BUILD_MODE="TGS" tools/bootstrap/node tools/build/build.js diff --git a/tools/LinuxOneShot/SetupProgram/Program.cs b/tools/LinuxOneShot/SetupProgram/Program.cs deleted file mode 100644 index 6fa9b1a08226..000000000000 --- a/tools/LinuxOneShot/SetupProgram/Program.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Tgstation.Server.Api.Models; -using Tgstation.Server.Client; -using Tgstation.Server.Client.Components; - -namespace SetupProgram -{ - class Program - { - public static async Task Main() - { - var repo = Environment.GetEnvironmentVariable("TGS_REPO")?.Trim(); - if (String.IsNullOrWhiteSpace(repo)) - { - Console.WriteLine("ERROR: Environment variable TGS_REPO not set to a git url!"); - return 1; - } - - var byondStr = Environment.GetEnvironmentVariable("TGS_BYOND")?.Trim(); - if (String.IsNullOrWhiteSpace(byondStr) || !Version.TryParse(byondStr, out Version byond) || byond.Build != -1) - { - Console.WriteLine("ERROR: Environment variable TGS_BYOND not set to a valid BYOND version!"); - return 2; - } - - var clientFactory = new ServerClientFactory(new ProductHeaderValue("LinuxOneShot", "1.0.0")); - - IServerClient serverClient = null; - Instance instance = null; - IInstanceClient instanceClient; - void CreateInstanceClient() => instanceClient = serverClient.Instances.CreateClient(instance); - - async Task CreateAdminClient() - { - Console.WriteLine("Attempting to reestablish connection to TGS (120s max wait)..."); - var giveUpAt = DateTimeOffset.Now.AddSeconds(60); - do - { - try - { - serverClient = await clientFactory.CreateServerClient(new Uri("http://tgs:80"), User.AdminName, User.DefaultAdminPassword, default, default); - if (instance != null) - CreateInstanceClient(); - break; - } - catch (HttpRequestException) - { - //migrating, to be expected - if (DateTimeOffset.Now > giveUpAt) - throw; - await Task.Delay(TimeSpan.FromSeconds(1)); - } - catch (ServiceUnavailableException) - { - // migrating, to be expected - if (DateTimeOffset.Now > giveUpAt) - throw; - await Task.Delay(TimeSpan.FromSeconds(1)); - } - } while (true); - } - - async Task WaitForJob(Job originalJob, CancellationToken cancellationToken) - { - var job = originalJob; - int? lastProgress = null; - do - { - try - { - await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false); - job = await instanceClient.Jobs.GetId(job, cancellationToken).ConfigureAwait(false); - if (job.Progress != lastProgress) - { - Console.WriteLine($"Progress: {job.Progress}"); - lastProgress = job.Progress; - } - } - catch (UnauthorizedException) - { - await CreateAdminClient(); - } - } - while (!job.StoppedAt.HasValue); - - if (job.ExceptionDetails != null) - { - Console.WriteLine(job.ExceptionDetails); - Environment.Exit(3); - } - } - - await CreateAdminClient(); - - Console.WriteLine("Listing instances..."); - var instances = await serverClient.Instances.List(default); - if (instances.Any()) - { - Console.WriteLine("One or more instances already exist, aborting!"); - return 3; - } - - Console.WriteLine("Creating instance..."); - instance = await serverClient.Instances.CreateOrAttach(new Instance - { - ConfigurationType = ConfigurationType.HostWrite, - Name = "AutoInstance", - Path = "/tgs4_instances/main" - }, default); - - Console.WriteLine("Onlining instance..."); - instance.Online = true; - instance = await serverClient.Instances.Update(instance, default); - - CreateInstanceClient(); - - Console.WriteLine("Starting repo clone..."); - var cloneJobTask = instanceClient.Repository.Clone(new Repository - { - Origin = repo - }, default); - - Console.WriteLine($"Starting BYOND install {byond}..."); - var byondInstallTask = instanceClient.Byond.SetActiveVersion(new Byond - { - Version = byond - }, default); - - Console.WriteLine("Setting DD Settings to Ultrasafe|Startup Timeout=120|AutoStart=true|HeartbeatSeconds=120..."); - var ddUpdateTask = instanceClient.DreamDaemon.Update(new DreamDaemon - { - AutoStart = true, - SecurityLevel = DreamDaemonSecurity.Ultrasafe, - HeartbeatSeconds = 120, - StartupTimeout = 120 - }, default); - - Console.WriteLine("Setting API validation security level to trusted..."); - var dmUpdateTask = instanceClient.DreamMaker.Update(new DreamMaker - { - ApiValidationSecurityLevel = DreamDaemonSecurity.Trusted - }, default); - - Console.WriteLine("Uploading EventScripts/PreCompile.sh..."); - var configurationTask = instanceClient.Configuration.Write(new ConfigurationFile - { - Path = "/EventScripts/PreCompile.sh", - Content = File.ReadAllBytes("PreCompile.sh") - }, default); - - Console.WriteLine("Creating GameStaticFiles/data..."); - var configTask2 = instanceClient.Configuration.CreateDirectory(new ConfigurationFile - { - IsDirectory = true, - Path = "/GameStaticFiles/data" - }, default); - - Console.WriteLine("Waiting for previous requests..."); - - await Task.WhenAll( - cloneJobTask, - byondInstallTask, - ddUpdateTask, - dmUpdateTask, - configurationTask, - configTask2); - - Console.WriteLine("Waiting for BYOND install..."); - - var installJob = await byondInstallTask; - await WaitForJob(installJob.InstallJob, default); - - Console.WriteLine("Waiting for Repo clone..."); - - var cloneJob = await cloneJobTask; - await WaitForJob(cloneJob.ActiveJob, default); - - await CreateAdminClient(); - - Console.WriteLine("Starting deployment..."); - var deployJobTask = instanceClient.DreamMaker.Compile(default); - - Console.WriteLine("Enabling auto updates every hour..."); - instance.AutoUpdateInterval = 60; - await serverClient.Instances.Update(instance, default); - - Console.WriteLine("Waiting for deployment job..."); - var deployJob = await deployJobTask; - await WaitForJob(deployJob, default); - - await CreateAdminClient(); - - Console.WriteLine("Launching watchdog..."); - var launchJob = await instanceClient.DreamDaemon.Start(default); - await WaitForJob(launchJob, default); - - Console.WriteLine("Complete!"); - return 0; - } - } -} diff --git a/tools/LinuxOneShot/SetupProgram/SetupProgram.csproj b/tools/LinuxOneShot/SetupProgram/SetupProgram.csproj deleted file mode 100644 index 294d40cb17f7..000000000000 --- a/tools/LinuxOneShot/SetupProgram/SetupProgram.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp3.1 - - - - - - - diff --git a/tools/LinuxOneShot/docker-compose.yml b/tools/LinuxOneShot/docker-compose.yml deleted file mode 100644 index 594ccc59f4c7..000000000000 --- a/tools/LinuxOneShot/docker-compose.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: '3.7' -services: - mariadb: - image: mariadb - restart: always - ports: - - "3306:3306" - volumes: - - "./Database:/var/lib/mysql" - logging: - driver: none - environment: - MYSQL_INITDB_SKIP_TZINFO: 1 - MYSQL_ROOT_PASSWORD: ChangeThisInBothMariaDBAndTgsConnectionString - tgs: - environment: - MYSQL_ROOT_PASSWORD: ChangeThisInBothMariaDBAndTgsConnectionString - Database__ConnectionString: "Password=ChangeThisInBothMariaDBAndTgsConnectionString;Server=mariadb;User Id=root;Database=tgs4" - TGS_ADMIN_CKEY: - TGS_PREFIXED_SCHEMA_FILE: SQL/tgstation_schema_prefixed.sql - TGS_SCHEMA_MAJOR_VERSION: 5 - TGS_SCHEMA_MINOR_VERSION: 9 - cap_add: - - SYS_NICE - image: "tgstation/server:latest" - depends_on: - - mariadb - ports: - - "1337:1337" - - "5000:80" - restart: always - init: true - volumes: - - "./TGS_Logs:/tgs_logs" - - "./TGS_Config:/config_data" - - "./TGS_Instances:/tgs4_instances" - logging: - driver: none - setup: - environment: - TGS_BYOND: 514.1554 - TGS_REPO: https://github.com/tgstation/tgstation - build: - context: ./SetupProgram - dockerfile: Dockerfile - depends_on: - - tgs - - mariadb - restart: "no" diff --git a/tools/tgs4_scripts/PreCompile.bat b/tools/tgs4_scripts/PreCompile.bat deleted file mode 100644 index 92f156a27d83..000000000000 --- a/tools/tgs4_scripts/PreCompile.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -cd /D "%~dp0" -set TG_BOOTSTRAP_CACHE=%cd% -IF NOT %1 == "" ( - rem TGS4: we are passed the game directory on the command line - cd %1 -) ELSE IF EXIST "..\Game\B\maplestation.dmb" ( - rem TGS3: Game/B/tgstation.dmb exists, so build in Game/A - cd ..\Game\A -) ELSE ( - rem TGS3: Otherwise build in Game/B - cd ..\Game\B -) -set CBT_BUILD_MODE=TGS -tools\build\build diff --git a/tools/tgs4_scripts/PreCompile.sh b/tools/tgs4_scripts/PreCompile.sh deleted file mode 100644 index 69a6f35cf641..000000000000 --- a/tools/tgs4_scripts/PreCompile.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -# REPO MAINTAINERS: KEEP CHANGES TO THIS IN SYNC WITH /tools/LinuxOneShot/SetupProgram/PreCompile.sh -# No ~mso -set -e -set -x - -#load dep exports -#need to switch to game dir for Dockerfile weirdness -original_dir=$PWD -cd "$1" -. dependencies.sh -cd "$original_dir" - -#find out what we have (+e is important for this) -set +e -has_git="$(command -v git)" -has_cargo="$(command -v ~/.cargo/bin/cargo)" -has_sudo="$(command -v sudo)" -has_grep="$(command -v grep)" -has_youtubedl="$(command -v youtube-dl)" -has_pip3="$(command -v pip3)" -set -e - -# install cargo if needed -if ! [ -x "$has_cargo" ]; then - echo "Installing rust..." - curl https://sh.rustup.rs -sSf | sh -s -- -y - . ~/.profile -fi - -# apt packages, libssl needed by rust-g but not included in TGS barebones install -if ! ( [ -x "$has_git" ] && [ -x "$has_grep" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then - echo "Installing apt dependencies..." - if ! [ -x "$has_sudo" ]; then - dpkg --add-architecture i386 - apt-get update - apt-get install -y git libssl-dev:i386 - rm -rf /var/lib/apt/lists/* - else - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install -y git libssl-dev:i386 - sudo rm -rf /var/lib/apt/lists/* - fi -fi -dpkg --add-architecture i386 -apt-get update -apt-get install -y lib32z1 pkg-config libssl-dev:i386 libssl-dev libssl1.1:i386 -# update rust-g -if [ ! -d "rust-g" ]; then - echo "Cloning rust-g..." - git clone https://github.com/tgstation/rust-g - cd rust-g - ~/.cargo/bin/rustup target add i686-unknown-linux-gnu -else - echo "Fetching rust-g..." - cd rust-g - git fetch - ~/.cargo/bin/rustup target add i686-unknown-linux-gnu -fi - -echo "Deploying rust-g..." -git checkout "$RUST_G_VERSION" -env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu -mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so" -cd .. - -# install or update youtube-dl when not present, or if it is present with pip3, -# which we assume was used to install it -if ! [ -x "$has_youtubedl" ]; then - echo "Installing youtube-dl with pip3..." - if ! [ -x "$has_sudo" ]; then - apt-get install -y python3 python3-pip - else - sudo apt-get install -y python3 python3-pip - fi - pip3 install youtube-dl -elif [ -x "$has_pip3" ]; then - echo "Ensuring youtube-dl is up-to-date with pip3..." - pip3 install youtube-dl -U -fi - -# compile tgui -echo "Compiling tgui..." -cd "$1" -chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 -env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 CBT_BUILD_MODE="TGS" tools/bootstrap/node tools/build/build.js diff --git a/tools/tgs4_scripts/PreSynchronize.bat b/tools/tgs4_scripts/PreSynchronize.bat deleted file mode 100644 index d2016e21ae2d..000000000000 --- a/tools/tgs4_scripts/PreSynchronize.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -powershell -NoProfile -ExecutionPolicy Bypass -File PreSynchronize.ps1 -game_path %1 diff --git a/tools/tgs4_scripts/PreSynchronize.ps1 b/tools/tgs4_scripts/PreSynchronize.ps1 deleted file mode 100644 index db8f0a304305..000000000000 --- a/tools/tgs4_scripts/PreSynchronize.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -param( - $game_path -) - -cd $game_path - -Write-Host "Installing pip dependencies..." -pip3 install PyYaml beautifulsoup4 -if(!$?){ - Write-Host "pip3 returned non-zero!" - exit $LASTEXITCODE -} - -Write-Host "Running changelog script..." -python3 tools/ss13_genchangelog.py html/changelogs -if(!$?){ - Write-Host "python3 returned non-zero!" - exit $LASTEXITCODE -} - -Write-Host "Committing changes..." -git add html - -if(!$?){ - Write-Host "`git add` returned non-zero!" - exit $LASTEXITCODE -} - -#we now don't care about failures -git commit -m "Automatic changelog compile, [ci skip]" -exit 0 diff --git a/tools/tgs4_scripts/PreSynchronize.sh b/tools/tgs4_scripts/PreSynchronize.sh deleted file mode 100644 index 63091bf4b30b..000000000000 --- a/tools/tgs4_scripts/PreSynchronize.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -has_python="$(command -v python3)" -has_git="$(command -v git)" -has_sudo="$(command -v sudo)" -has_pip="$(command -v pip3)" - -set -e - -if ! { [ -x "$has_python" ] && [ -x "$has_pip" ] && [ -x "$has_git" ]; }; then - echo "Installing apt dependencies..." - if ! [ -x "$has_sudo" ]; then - apt update - apt install -y python3 python3-pip git - rm -rf /var/lib/apt/lists/* - else - sudo apt update - sudo apt install -y python3 python3-pip git - sudo rm -rf /var/lib/apt/lists/* - fi -fi - -echo "Installing pip dependencies..." -pip3 install PyYaml beautifulsoup4 - -cd $1 - -echo "Running changelog script..." -python3 tools/ss13_genchangelog.py html/changelogs - -echo "Committing changes..." -git add html - -#we now don't care about failures -set +e -git commit -m "Automatic changelog compile, [ci skip]" -exit 0 diff --git a/tools/tgs4_scripts/WatchdogLaunch.sh b/tools/tgs4_scripts/WatchdogLaunch.sh deleted file mode 100644 index 7e184a6ce86d..000000000000 --- a/tools/tgs4_scripts/WatchdogLaunch.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# Special file to ensure all dependencies still exist between server lanuches. -# Mainly for use by people who abuse docker by modifying the container's system. -set -e -set -x - -#find out what we have (+e is important for this) -set +e -has_git="$(command -v git)" -has_cargo="$(command -v ~/.cargo/bin/cargo)" -has_sudo="$(command -v sudo)" -has_grep="$(command -v grep)" -has_youtubedl="$(command -v youtube-dl)" -has_pip3="$(command -v pip3)" -set -e - -# install cargo if needed -if ! [ -x "$has_cargo" ]; then - echo "Installing rust..." - curl https://sh.rustup.rs -sSf | sh -s -- -y - . ~/.profile -fi - -# apt packages, libssl needed by rust-g but not included in TGS barebones install -if ! ( [ -x "$has_git" ] && [ -x "$has_grep" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then - dpkg --add-architecture i386 - apt-get update - apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev libssl1.1:i386 -fi - -# install youtube-dl when not present -if ! [ -x "$has_youtubedl" ]; then - echo "Installing youtube-dl with pip3..." - if ! [ -x "$has_sudo" ]; then - apt-get install -y python3 python3-pip - else - sudo apt-get install -y python3 python3-pip - fi - pip3 install youtube-dl -fi From 7af36960d43a005ad492dc087968a69e8db40d46 Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Sun, 16 Aug 2026 18:35:12 -0500 Subject: [PATCH 2/4] Build flags --- .vscode/extensions.json | 3 +- .vscode/launch.json | 14 +- .vscode/settings.json | 5 +- .vscode/tasks.json | 100 +++++------ _maps/_basemap.dm | 35 ++-- code/_compile_options.dm | 3 - code/controllers/subsystem/mapping.dm | 4 +- code/controllers/subsystem/ticker.dm | 4 + tools/build/build.ts | 2 +- tools/build/build_flags.json | 235 ++++++++++++++++++++++++++ 10 files changed, 312 insertions(+), 93 deletions(-) create mode 100644 tools/build/build_flags.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4f751c350b95..5b1e54a988ff 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -7,6 +7,7 @@ "Donkie.vscode-tgstation-test-adapter", "anturk.dmi-editor", "esbenp.prettier-vscode", - "biomejs.biome" + "biomejs.biome", + "ss13.ss13buildflags" ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 294ea401d020..353b7c254fb5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,7 +4,7 @@ { "type": "byond", "request": "launch", - "name": "Launch DreamSeeker", + "name": "Launch DreamSeeker (With selected flags)", "preLaunchTask": "Build All", "dmb": "${workspaceFolder}/${command:CurrentDMB}" }, @@ -39,7 +39,7 @@ { "type": "byond", "request": "launch", - "name": "Launch DreamDaemon", + "name": "Launch DreamDaemon (With selected flags)", "preLaunchTask": "Build All", "dmb": "${workspaceFolder}/${command:CurrentDMB}", "dreamDaemon": true @@ -82,10 +82,7 @@ "request": "launch", "program": "${command:dreammaker.returnDreamDaemonPath}", "cwd": "${workspaceRoot}", - "args": [ - "${command:dreammaker.getFilenameDmb}", - "-trusted" - ], + "args": ["${command:dreammaker.getFilenameDmb}", "-trusted"], "preLaunchTask": "Build All" }, { @@ -94,10 +91,7 @@ "request": "launch", "program": "${command:dreammaker.returnDreamDaemonPath}", "cwd": "${workspaceRoot}", - "args": [ - "${command:dreammaker.getFilenameDmb}", - "-trusted" - ], + "args": ["${command:dreammaker.getFilenameDmb}", "-trusted"], "preLaunchTask": "Build All (low memory mode)" } ] diff --git a/.vscode/settings.json b/.vscode/settings.json index 757d9dd84c8b..8a51fb1c757b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -26,5 +26,8 @@ "**/node_modules": true }, "Lua.diagnostics.enable": false, - "tgstationTestExplorer.project.DMEName": "maplestation.dme" + "tgstationTestExplorer.project.DMEName": "maplestation.dme", + "ss13BuildFlags.baseTask": "Build All", + "ss13BuildFlags.configPath": "tools/build/build_flags.json", + "ss13BuildFlags.injectionMode": "cli-args" } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 475954f3dd7c..d418c61bb775 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,42 +12,42 @@ "DM_EXE": "${config:dreammaker.byondPath}" } }, - "problemMatcher": [ - "$dreammaker", - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$dreammaker", "$tsc", "$eslint-stylish"], "group": { "kind": "build", "isDefault": true }, - "dependsOn": "dm: reparse", + "dependsOn": ["dm: reparse", "Compile BT Trees"], "label": "Build All" }, { "type": "process", "command": "tools/build/build.sh", - "args": ["-DLOWMEMORYMODE"], + "args": [ + "-DSKIP_LAVALAND", + "-DSKIP_SPACE_LEVELS", + "-DFORCE_MAP=\"runtimestation\"" + ], "windows": { "command": ".\\tools\\build\\build.bat", - "args": ["-DLOWMEMORYMODE"] + "args": [ + "-DSKIP_LAVALAND", + "-DSKIP_SPACE_LEVELS", + "-DFORCE_MAP=\"runtimestation\"" + ] }, "options": { "env": { "DM_EXE": "${config:dreammaker.byondPath}" } }, - "problemMatcher": [ - "$dreammaker", - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$dreammaker", "$tsc", "$eslint-stylish"], "group": { "kind": "build" }, "dependsOn": "dm: reparse", "label": "Build All (low memory mode)" - }, + } { "type": "process", "command": "tools/build/build.sh", @@ -59,18 +59,19 @@ ], "windows": { "command": ".\\tools\\build\\build.bat", - "args": ["-DTESTING","-DREAGENTS_TESTING","-DTIMER_DEBUG","-DREFERENCE_DOING_IT_LIVE"] + "args": [ + "-DTESTING", + "-DREAGENTS_TESTING", + "-DTIMER_DEBUG", + "-DREFERENCE_DOING_IT_LIVE" + ] }, "options": { "env": { "DM_EXE": "${config:dreammaker.byondPath}" } }, - "problemMatcher": [ - "$dreammaker", - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$dreammaker", "$tsc", "$eslint-stylish"], "group": { "kind": "build" }, @@ -81,26 +82,32 @@ "type": "process", "command": "tools/build/build.sh", "args": [ - "-DLOWMEMORYMODE", + "-DSKIP_LAVALAND", + "-DSKIP_SPACE_LEVELS", "-DTESTING", "-DREAGENTS_TESTING", "-DTIMER_DEBUG", - "-DREFERENCE_DOING_IT_LIVE" + "-DREFERENCE_DOING_IT_LIVE", + "-DFORCE_MAP=\"runtimestation\"" ], "windows": { "command": ".\\tools\\build\\build.bat", - "args": ["-DLOWMEMORYMODE","-DTESTING","-DREAGENTS_TESTING","-DTIMER_DEBUG","-DREFERENCE_DOING_IT_LIVE"] + "args": [ + "-DSKIP_LAVALAND", + "-DSKIP_SPACE_LEVELS", + "-DTESTING", + "-DREAGENTS_TESTING", + "-DTIMER_DEBUG", + "-DREFERENCE_DOING_IT_LIVE", + "-DFORCE_MAP=\"runtimestation\"" + ] }, "options": { "env": { "DM_EXE": "${config:dreammaker.byondPath}" } }, - "problemMatcher": [ - "$dreammaker", - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$dreammaker", "$tsc", "$eslint-stylish"], "group": { "kind": "build" }, @@ -113,18 +120,14 @@ "args": ["-DTESTING", "-DMAP_TEST"], "windows": { "command": ".\\tools\\build\\build.bat", - "args": ["-DTESTING","-DMAP_TEST"] + "args": ["-DTESTING", "-DMAP_TEST"] }, "options": { "env": { "DM_EXE": "${config:dreammaker.byondPath}" } }, - "problemMatcher": [ - "$dreammaker", - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$dreammaker", "$tsc", "$eslint-stylish"], "group": { "kind": "build" }, @@ -134,9 +137,7 @@ { "type": "dreammaker", "dme": "tgstation.dme", - "problemMatcher": [ - "$dreammaker" - ], + "problemMatcher": ["$dreammaker"], "group": "build", "label": "dm: build - tgstation.dme" }, @@ -151,10 +152,7 @@ "windows": { "command": ".\\bin\\tgui-build.cmd" }, - "problemMatcher": [ - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$tsc", "$eslint-stylish"], "group": "build", "label": "tgui: build" }, @@ -164,10 +162,7 @@ "windows": { "command": ".\\bin\\tgui-dev.cmd" }, - "problemMatcher": [ - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$tsc", "$eslint-stylish"], "group": "build", "label": "tgui: dev server" }, @@ -177,10 +172,7 @@ "windows": { "command": ".\\bin\\tgui-bench.cmd" }, - "problemMatcher": [ - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$tsc", "$eslint-stylish"], "group": "build", "label": "tgui: bench" }, @@ -190,10 +182,7 @@ "windows": { "command": ".\\bin\\tgui-sonar.cmd" }, - "problemMatcher": [ - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$tsc", "$eslint-stylish"], "group": "build", "label": "tgui: sonar" }, @@ -203,10 +192,7 @@ "windows": { "command": ".\\bin\\tgfont.cmd" }, - "problemMatcher": [ - "$tsc", - "$eslint-stylish" - ], + "problemMatcher": ["$tsc", "$eslint-stylish"], "group": "build", "label": "tgui: rebuild tgfont" } diff --git a/_maps/_basemap.dm b/_maps/_basemap.dm index 24c5ec2b5597..0ac2fa2f1d69 100644 --- a/_maps/_basemap.dm +++ b/_maps/_basemap.dm @@ -2,22 +2,21 @@ #include "map_files\generic\CentCom.dmm" -#ifndef LOWMEMORYMODE - #ifdef ALL_MAPS - #include "map_files\debug\multiz.dmm" - #include "map_files\debug\runtimestation.dmm" - #include "map_files\Deltastation\DeltaStation2.dmm" - #include "map_files\IceBoxStation\IceBoxStation.dmm" - #include "map_files\KiloStation\KiloStation.dmm" - #include "map_files\Limastation\limastation.dmm" - #include "map_files\MetaStation\MetaStation.dmm" - #include "map_files\Mining\Lavaland.dmm" - #include "map_files\NebulaStation\NebulaStation.dmm" - #include "map_files\NorthStar\north_star.dmm" - #include "map_files\PubbyStation\PubbyStation.dmm" - #include "map_files\tramstation\tramstation.dmm" - #endif - #ifdef ALL_TEMPLATES - #include "templates.dm" - #endif +#ifdef ALL_MAPS + #include "map_files\debug\multiz.dmm" + #include "map_files\debug\runtimestation.dmm" + #include "map_files\Deltastation\DeltaStation2.dmm" + #include "map_files\IceBoxStation\IceBoxStation.dmm" + #include "map_files\KiloStation\KiloStation.dmm" + #include "map_files\Limastation\limastation.dmm" + #include "map_files\MetaStation\MetaStation.dmm" + #include "map_files\Mining\Lavaland.dmm" + #include "map_files\NebulaStation\NebulaStation.dmm" + #include "map_files\NorthStar\north_star.dmm" + #include "map_files\OmegaStation\OmegaStation.dmm" + #include "map_files\PubbyStation\PubbyStation.dmm" + #include "map_files\tramstation\tramstation.dmm" +#endif +#ifdef ALL_TEMPLATES + #include "templates.dm" #endif diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 4d59022dfcab..98e3bcfaa666 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -122,10 +122,7 @@ #endif // 1 to use the default behaviour; // 2 for preloading absolutely everything; -#ifdef LOWMEMORYMODE -#define FORCE_MAP "runtimestation" #define FORCE_MAP_DIRECTORY "_maps" -#endif //Additional code for the above flags. #ifdef TESTING diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 6e702d6864d9..39bbe6cb6d2b 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -136,7 +136,7 @@ SUBSYSTEM_DEF(mapping) var/start_time -#ifndef LOWMEMORYMODE +#ifndef SKIP_SPACE_LEVELS start_time = REALTIMEOFDAY SStitle.add_init_text("Empty Space", "> Space", "LOADING...") // Create space ruin levels @@ -456,7 +456,7 @@ Used by the AI doomsday and the self-destruct nuke. query_round_map_name.Execute() qdel(query_round_map_name) -#ifndef LOWMEMORYMODE +#ifndef SKIP_LAVALAND if(config.minetype == "lavaland") LoadGroup(FailedZs, "Lavaland", "map_files/Mining", "Lavaland.dmm", default_traits = ZTRAITS_LAVALAND) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 896153e0d099..4ac794d507b3 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -14,7 +14,11 @@ SUBSYSTEM_DEF(ticker) /// or a "round-ending" event, like summoning Nar'Sie, a blob victory, the nuke going off, etc. ([FORCE_END_ROUND]) var/force_ending = END_ROUND_AS_NORMAL /// If TRUE, there is no lobby phase, the game starts immediately. + #ifdef AUTOSTART_GAME + var/start_immediately = TRUE + #else var/start_immediately = FALSE + #endif /// Boolean to track and check if our subsystem setup is done. var/setup_done = FALSE diff --git a/tools/build/build.ts b/tools/build/build.ts index 6573f4dfdbbd..78047fb98c86 100644 --- a/tools/build/build.ts +++ b/tools/build/build.ts @@ -177,7 +177,7 @@ export const DmTarget = new Juke.Target({ NamedVersionFile, ], outputs: ({ get }) => { - if (get(DmVersionParameter)) { + if (get(DmVersionParameter) || get(DefineParameter).length > 0) { return []; // Always rebuild when dm version is provided } return [ diff --git a/tools/build/build_flags.json b/tools/build/build_flags.json new file mode 100644 index 000000000000..4a31048fd08c --- /dev/null +++ b/tools/build/build_flags.json @@ -0,0 +1,235 @@ +{ + "$comment": "Single source of truth for build/debug flags and presets. Edit flags and presets HERE. Consumed by the build-flags picker extension and by tools/build/generate_flag_configs (which regenerates the static fallback launch configs). Every flag should have a fitting define", + "version": 1, + "categories": ["Map", "Testing", "Debugging", "Performance", "Misc"], + "flags": [ + { + "id": "AUTOSTART_GAME", + "define": "AUTOSTART_GAME", + "label": "Auto Start", + "category": "Testing", + "description": "Start the game as soon as initializations finish." + }, + { + "id": "TESTING", + "define": "TESTING", + "label": "Testing", + "category": "Testing", + "description": "Enables testing() debug messages. Also turns on DATUMVAR_DEBUGGING_MODE, atmos/lighting update visualisers and max-share tracking." + }, + + { + "id": "REAGENTS_TESTING", + "define": "REAGENTS_TESTING", + "label": "Reagents testing", + "category": "Testineg", + "description": "Debug messages for every reaction step (very spammy). Requires TESTING.", + "requires": ["TESTING"] + }, + { + "id": "FORCE_MAP", + "define": "FORCE_MAP", + "label": "Force map", + "category": "Map", + "type": "select", + "valueFormat": "quoted", + "description": "Overrides the map loaded at round start.", + "options": [ + { "value": "", "label": "default" }, + { "value": "deltastation", "label": "Delta Station" }, + { "value": "icebox", "label": "Ice Box Station" }, + { "value": "metastation", "label": "MetaStation" }, + { "value": "tramstation", "label": "Tramstation" }, + { "value": "nebulastation", "label": "NebulaStation" }, + { "value": "kilostation", "label": "Kilostation" }, + { "value": "catwalkstation", "label": "Catwalk Station" }, + { "value": "gateway_test", "label": "Gateway Test (test)" }, + { "value": "multiz_debug", "label": "MultiZ Debug (test)" }, + { "value": "runtimestation", "label": "Runtime Station (low memory)" }, + { + "value": "runtimestation_minimal", + "label": "Minimal Runtime Station. Only works with minimal CentCom.", + "requires": ["MINIMAL_CENTCOM", "SKIP_LAVALAND", "SKIP_SPACE_LEVELS"] + } + ] + }, + { + "id": "MAP_TEST", + "define": "MAP_TEST", + "label": "Map test mode", + "category": "Map", + "description": "Disables common annoyances (rat spawns, random light breakage) so mappers can test without shenanigans." + }, + { + "id": "SKIP_LAVALAND", + "define": "SKIP_LAVALAND", + "label": "No Lavaland", + "category": "Map", + "description": "Prevents Lavaland from loading in." + }, + { + "id": "SKIP_SPACE_LEVELS", + "define": "SKIP_SPACE_LEVELS", + "label": "No space ruins", + "category": "Map", + "description": "Makes no space levels load in." + }, + { + "id": "TIMER_DEBUG", + "define": "TIMER_DEBUG", + "label": "Timer debug", + "category": "Debugging", + "description": "Compiles full timer debug info. Warning: increases timer creation cost ~5x." + }, + { + "id": "REFERENCE_DOING_IT_LIVE", + "define": "REFERENCE_DOING_IT_LIVE", + "label": "Reference tracking (live)", + "category": "Debugging", + "description": "Sets up the ref tracker for a live environment, logging hard-deletes to harddels.log. Uses fast reftracking but less accurate." + }, + { + "id": "REFERENCE_TRACKING_STANDARD", + "define": "REFERENCE_TRACKING_STANDARD", + "label": "Reference tracking (standard)", + "category": "Debugging", + "description": "Local hard-deletion hunting. Spends all its time searching (slower but thorough), logging to harddels.log.", + "conflictsWith": ["REFERENCE_DOING_IT_LIVE"] + }, + { + "id": "DATUMVAR_DEBUGGING_MODE", + "define": "DATUMVAR_DEBUGGING_MODE", + "label": "Datum var debugging", + "category": "Debugging", + "description": "Caches datum vars so you can retrieve them later to see which vars changed. Implied by TESTING." + }, + { + "id": "UNIT_TESTS", + "define": "UNIT_TESTS", + "label": "Unit tests", + "category": "Testing", + "description": "Runs all unit tests, then shuts down." + }, + { + "id": "USE_BYOND_TRACY", + "define": "USE_BYOND_TRACY", + "label": "byond-tracy profiler", + "category": "Performance", + "description": "Attempts to load prof.dll/libprof.so on boot for Tracy profiling. You must build byond-tracy yourself look at the guide for info." + }, + { + "id": "MC_TAB_TRACY_INFO", + "define": "MC_TAB_TRACY_INFO", + "label": "byond-tracy MC tab info", + "category": "Performance", + "description": "Displays byond-tracy's status in the MC tab." + }, + { + "id": "PERFORMANCE_TESTS", + "define": "PERFORMANCE_TESTS", + "label": "Performance tests", + "category": "Performance", + "description": "Boots, runs world.run_performance_tests(), then shuts down the server." + }, + { + "id": "DO_NOT_DEFER_ASSETS", + "define": "DO_NOT_DEFER_ASSETS", + "label": "Do not defer assets", + "category": "Performance", + "description": "Generates all assets up front during initialize instead of deferring them when needed." + }, + { + "id": "PROFILE_MAPLOAD_INIT_ATOM", + "define": "PROFILE_MAPLOAD_INIT_ATOM", + "label": "Profile mapload init atom", + "category": "Performance", + "description": "Profiles atom initialization during map load." + }, + { + "id": "DISABLE_DREAMLUAU", + "define": "DISABLE_DREAMLUAU", + "label": "Disable Dreamluau", + "category": "Misc", + "description": "Fully disables Dreamluau." + }, + { + "id": "VERB_STRESS_TEST", + "define": "VERB_STRESS_TEST", + "label": "Verb stress test", + "category": "Performance", + "description": "Forces verb processing into just the 2% of a tick we normally reserve for it, for simulating highpop." + }, + { + "id": "FORCE_VERB_OVERTIME", + "define": "FORCE_VERB_OVERTIME", + "label": "Force verb overtime", + "category": "Performance", + "description": "Forces all verbs to run into overtime all of the time, negating the reserve 2%.", + "requires": ["VERB_STRESS_TEST"] + }, + { + "id": "ALL_TEMPLATES", + "define": "ALL_TEMPLATES", + "label": "All templates", + "category": "Map", + "description": "Includes all map templates in the build (needed for some map/ruin testing)." + }, + { + "id": "ALL_MAPS", + "define": "ALL_MAPS", + "label": "All maps", + "category": "Map", + "description": "Includes every station map in the compiled build instead of just the ones referenced dynamically." + }, + { + "id": "MAPLESTATION_STORY_CONTENT", + "define": "MAPLESTATION_STORY_CONTENT", + "label": "Story Content", + "category": "Misc", + "description": "Enables story related content." + }, + { + "id": "HEALTH_DEBUG", + "define": "HEALTH_DEBUG", + "label": "Health Debug", + "category": "Debugging", + "description": "Enables debug messages for health system." + } + ], + "presets": [ + { + "id": "LOW_MEMORY", + "label": "Low memory mode", + "flags": ["SKIP_LAVALAND", "SKIP_SPACE_LEVELS"], + "values": { "force_map": "runtimestation" } + }, + { + "id": "TESTING", + "label": "Testing", + "flags": [ + "TESTING", + "REAGENTS_TESTING", + "TIMER_DEBUG", + "REFERENCE_DOING_IT_LIVE" + ] + }, + { + "id": "TESTING_LOW_MEMORY", + "label": "Testing + low memory mode", + "flags": [ + "SKIP_LAVALAND", + "SKIP_SPACE_LEVELS", + "TESTING", + "REAGENTS_TESTING", + "TIMER_DEBUG", + "REFERENCE_DOING_IT_LIVE" + ], + "values": { "force_map": "runtimestation" } + }, + { + "id": "MAP_TESTING", + "label": "Map testing", + "flags": ["TESTING", "MAP_TEST"] + } + ] +} From c3e71670c88ff09596cf35e377c4bcdf5789f0a2 Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Sun, 16 Aug 2026 18:36:23 -0500 Subject: [PATCH 3/4] Doc --- tools/build/build.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/build/build.ts b/tools/build/build.ts index 78047fb98c86..1dd7342621fe 100644 --- a/tools/build/build.ts +++ b/tools/build/build.ts @@ -178,7 +178,8 @@ export const DmTarget = new Juke.Target({ ], outputs: ({ get }) => { if (get(DmVersionParameter) || get(DefineParameter).length > 0) { - return []; // Always rebuild when dm version is provided + // Always rebuild when a dm version or explicit CLI defines are provided to ensure juke re-runs + return []; } return [ `${DME_NAME}.dmb`, From fc3e846a4c7d0a30b47da5fff6fb34646a13f55f Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Sun, 16 Aug 2026 22:08:39 -0500 Subject: [PATCH 4/4] Oops --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d418c61bb775..42409de17880 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -47,7 +47,7 @@ }, "dependsOn": "dm: reparse", "label": "Build All (low memory mode)" - } + }, { "type": "process", "command": "tools/build/build.sh",