Skip to content

fix(server): keep the owner's online-mode and read server.properties like the game - #4

Merged
codebyant merged 3 commits into
developfrom
fix/keep-online-mode
Dec 3, 2026
Merged

codebyant merged 3 commits into
developfrom
fix/keep-online-mode

Conversation

@codebyant

@codebyant codebyant commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two fixes the launcher's new server.properties editor (codebyant/seijin-launcher#216) needs.

  1. Keep the owner's online-mode. server.update_settings rewrote server.properties with forceOnlineMode: true, so saving memory, port or start-on-boot turned cracked servers back to online mode. New servers still start with online-mode=true; after that update_settings keeps the existing line. enable-rcon=false and server-port are still forced.
  2. Read server.properties like the game. The launcher writes non-ASCII as \uXXXX (Java Properties escaping), and the agent read values raw, so Servidor do João showed literally in server.status (launcher, Discord embed). New src/server/properties-file.ts (parsePropertiesText, unescapePropertyValue) follows java.util.Properties: =/:/whitespace separators, #/! comments, line continuation, \uXXXX/\t/\n/\/\: escapes, and the last value of a repeated key (the game's rule; both readers used the first). Used by readMotdFromProperties (runtime) and readSleepProperties (sleep listener).

Impacted paths

  • src/server/properties-file.ts (+ test)
  • src/server/runtime.ts, src/server/runtime.test.ts
  • src/sleep/server-files.ts, src/sleep/server-files.test.ts

Validation

  • bun run lint, bun run typecheck, bun test (711 tests, 0 fail); CI green.
  • Installed on the test LXC as 1.2.1-alpha.1 (binary in reports/tegrad-server-properties/tegrad; previous one kept as /opt/tegrad/bin/tegrad.bak-1.2.0-alpha.1). Agent connected. On server aged (Fabric 1.21.1): wrote a file produced by the launcher's editor code (motd escaped, max-players=7, online-mode=false), woke it through the sleep listener with a whitelisted login, and the game reported MOTD "Servidor do João §aolá", 7 slots and offline mode. File restored afterwards.
  • Not tested against the real agent: update_settings keeping online-mode=false and the stopped-server MOTD in server.status, both need the vault password (covered by unit tests).

Manual test

Covered by the test script in codebyant/seijin-launcher#216.

@codebyant codebyant changed the title fix(server): keep the owner's online-mode when saving settings fix(server): keep the owner's online-mode and read server.properties like the game Dec 3, 2026
@codebyant
codebyant marked this pull request as ready for review December 3, 2026 22:02
@codebyant
codebyant merged commit 8e4f327 into develop Dec 3, 2026
2 checks passed
@codebyant
codebyant deleted the fix/keep-online-mode branch December 3, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant