fix: MySQL reconnect, world save on shutdown, HTTPS flex read, player gameplay persistence#48
Open
Nabenns wants to merge 1 commit into
Open
fix: MySQL reconnect, world save on shutdown, HTTPS flex read, player gameplay persistence#48Nabenns wants to merge 1 commit into
Nabenns wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 19 |
| Duplication | 0 |
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().)
72f69fe to
ed15401
Compare
This was referenced Jun 29, 2026
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.
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).