8000 lbs: read the minimum flycast version from the master data (m_server_setting) by inada-s · Pull Request #443 · inada-s/gdxsv · GitHub
[go: up one dir, main page]

Skip to content

lbs: read the minimum flycast version from the master data (m_server_setting) - #443

Merged
inada-s merged 1 commit into
masterfrom
ai/min-flycast-version-db
Oct 25, 2026
Merged

inada-s merged 1 commit into
masterfrom
ai/min-flycast-version-db

Conversation

@inada-s
@inada-s inada-s commented Oct 25, 2026
Copy link
Copy Markdown
Owner

The minimum flycast version was compiled in (requiredFlycastVersion = "v1.6.2" in main.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

  • New master table m_server_setting (key, value): for server settings, apart from m_string, which holds the strings shown to players.
    • It is created by the schema (CREATE TABLE IF NOT EXISTS), like m_patch, so the existing production DB gets it at the next start. Migrate keeps it.
  • Key min_flycast_version: the value may be v1.10.3 or the client's own spelling gdxsv-1.10.3.
  • No row, or a value that is not a version: requiredFlycastVersion as before, and a warning is logged for an invalid value. Test servers built with -X main.requiredFlycastVersion= keep working with an empty table.
  • Login checks: the three checks (login types 0, 2, 3) share flycastNeedsUpdate. Banned versions (bannedFlycastVersions) are unchanged.

To raise the minimum in production:

INSERT OR REPLACE INTO m_server_setting (key, value) VALUES ('min_flycast_version', 'v1.10.3');

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 after Init and its rows survive Migrate.
  • go test ./... passes.

🤖 Generated with Claude Code

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>
@inada-s
inada-s merged commit 0d8c749 into master Oct 25, 2026
2 checks passed
@inada-s
inada-s deleted the ai/min-flycast-version-db branch October 25, 2026 12:05
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

0