Repository navigation
fix(server): keep the owner's online-mode and read server.properties like the game - #4
Merged
Merged
Conversation
codebyant
marked this pull request as ready for review
December 3, 2026 22:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes the launcher's new server.properties editor (codebyant/seijin-launcher#216) needs.
online-mode.server.update_settingsrewroteserver.propertieswithforceOnlineMode: true, so saving memory, port or start-on-boot turned cracked servers back to online mode. New servers still start withonline-mode=true; after thatupdate_settingskeeps the existing line.enable-rcon=falseandserver-portare still forced.server.propertieslike the game. The launcher writes non-ASCII as\uXXXX(Java Properties escaping), and the agent read values raw, soServidor do Joãoshowed literally inserver.status(launcher, Discord embed). Newsrc/server/properties-file.ts(parsePropertiesText,unescapePropertyValue) followsjava.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 byreadMotdFromProperties(runtime) andreadSleepProperties(sleep listener).Impacted paths
src/server/properties-file.ts(+ test)src/server/runtime.ts,src/server/runtime.test.tssrc/sleep/server-files.ts,src/sleep/server-files.test.tsValidation
bun run lint,bun run typecheck,bun test(711 tests, 0 fail); CI green.1.2.1-alpha.1(binary inreports/tegrad-server-properties/tegrad; previous one kept as/opt/tegrad/bin/tegrad.bak-1.2.0-alpha.1). Agent connected. On serveraged(Fabric 1.21.1): wrote a file produced by the launcher's editor code (motdescaped,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.update_settingskeepingonline-mode=falseand the stopped-server MOTD inserver.status, both need the vault password (covered by unit tests).Manual test
Covered by the test script in codebyant/seijin-launcher#216.