Skip to content

fix: MySQL reconnect, world save on shutdown, HTTPS flex read, player gameplay persistence#48

Open
Nabenns wants to merge 1 commit into
gurotopia:masterfrom
Nabenns:feature/stability-fixes
Open

fix: MySQL reconnect, world save on shutdown, HTTPS flex read, player gameplay persistence#48
Nabenns wants to merge 1 commit into
gurotopia:masterfrom
Nabenns:feature/stability-fixes

Conversation

@Nabenns

@Nabenns Nabenns commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

4 fixes: MySQL auto-reconnect, world save at shutdown, HTTPS read-until-CRLF (works behind any proxy), player state persistence (gems/level/xp/clothing/inventory).

@codacy-production

codacy-production Bot commented Jun 29, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 19 complexity · 0 duplication

Metric Results
Complexity 19
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

3 stability improvements (independent of other PRs):

A. MySQL auto-reconnect: add MYSQL_OPT_RECONNECT after mysql_init() so
   the server survives MariaDB restarts without 'Server has gone away'.

C. HTTPS flexible read: read HTTP request byte-by-byte until the
   blank line instead of a hardcoded 213 bytes — works behind any
   reverse proxy (Caddy, nginx) with varying header sizes.

D. Player gameplay state persistence: save gems, level, xp, role,
   skin_color, hair_color, slot_size, clothing (CSV), and inventory
   (CSV id:count) to MariaDB. Loaded in mysql_select_all(), saved via
   peer::mysql_save() from quit.cpp on disconnect. Auto-migrates
   existing tables with ALTER TABLE ADD COLUMN IF NOT EXISTS.

(World-save-on-shutdown moved to the world-persistence PR since it
depends on world::mysql_save().)
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