Repository navigation
lbs: read the minimum flycast version from the master data (m_server_setting) - #443
Merged
Merged
Conversation
The minimum flycast version was compiled in (requiredFlycastVersion, overridable only by -ldflags), so raising it needed a server build and deploy. It is now read from the new master table m_server_setting (key, value), key min_flycast_version, at each login check, so a change in the DB applies at once. - The value may be "v1.10.3" or the client's own "gdxsv-1.10.3". - No row, or a value that is not a version: requiredFlycastVersion as before. Test servers built with -X main.requiredFlycastVersion= keep working with an empty table. - The three login checks share flycastNeedsUpdate. Banned versions are unchanged. - m_server_setting is created by the schema (CREATE TABLE IF NOT EXISTS), as m_patch; Migrate keeps it. Tests: Test_minFlycastVersion (no row, both spellings, an invalid value, banned versions); TestMigrateIdempotent covers the new table. go test ./... passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The minimum flycast version was compiled in (
requiredFlycastVersion = "v1.6.2"inmain.go, overridable only by-ldflags), so raising it needed a server build and a deploy. It is now read from the master data, at each login check, so a change in the DB applies at once.Change
m_server_setting(key,value): for server settings, apart fromm_string, which holds the strings shown to players.CREATE TABLE IF NOT EXISTS), likem_patch, so the existing production DB gets it at the next start.Migratekeeps it.min_flycast_version: the value may bev1.10.3or the client's own spellinggdxsv-1.10.3.requiredFlycastVersionas before, and a warning is logged for an invalid value. Test servers built with-X main.requiredFlycastVersion=keep working with an empty table.flycastNeedsUpdate. Banned versions (bannedFlycastVersions) are unchanged.To raise the minimum in production:
Tests
Test_minFlycastVersion: no row gives the built-in default; both spellings; dev builds of the minimum are old; an invalid value falls back; banned versions stay banned.TestMigrateIdempotent: the new table exists afterInitand its rows surviveMigrate.go test ./...passes.🤖 Generated with Claude Code