Skip to content

feat: daily login bonus — +500 gems per day#52

Open
Nabenns wants to merge 2 commits into
gurotopia:masterfrom
Nabenns:feature/daily-bonus
Open

feat: daily login bonus — +500 gems per day#52
Nabenns wants to merge 2 commits into
gurotopia:masterfrom
Nabenns:feature/daily-bonus

Conversation

@Nabenns

@Nabenns Nabenns commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Award 500 gems on first login each calendar day. Tracked via last_daily TIMESTAMP column. Compared by year/month/day for proper day boundary detection. Gems added in-memory + saved on disconnect.

@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 24 complexity · 0 duplication

Metric Results
Complexity 24
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.

Nabenns added 2 commits June 30, 2026 03:12
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().)
Award 500 gems on first login of each calendar day. Tracked
via last_daily TIMESTAMP column in peer table. Compared by
year/month/day for proper day boundary detection even across
timezone changes. Gems added in-memory, saved on disconnect.
@Nabenns Nabenns force-pushed the feature/daily-bonus branch from b4d9a84 to bf78483 Compare June 29, 2026 20:39
@Nabenns

Nabenns commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Note on merge order: this builds on #48 (player persistence) since the daily bonus uses the gems column and adds last_daily alongside the gameplay-state schema. Once #48 merges, this rebases cleanly onto master.

@leeendl leeendl self-requested a review June 30, 2026 18:09
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