Skip to content

feat: Migrate daily reward system to C++#742

Open
jprzimba wants to merge 4 commits into
mainfrom
daily-reward
Open

feat: Migrate daily reward system to C++#742
jprzimba wants to merge 4 commits into
mainfrom
daily-reward

Conversation

@jprzimba

@jprzimba jprzimba commented May 30, 2026

Copy link
Copy Markdown
Collaborator
  • Replace Lua-based daily reward system with a native C++ implementation.
  • Added XML config (data/XML/dailyrewards.xml).
  • Removed legacy Lua system files and bindings (libs/systems/daily_reward.lua, modules/scripts/daily_reward, shrine action, and related player helper methods in data/libs/functions/player.lua).
  • Updated system loader and modules.xml to stop loading the old modules, adjusted login and global server save hooks to use the new C++ API (Game.updateDailyRewardLastServerSave) and removed old Lua global storage helpers.
    Also includes related protocol/lua/C++ binding updates to integrate the new implementation.
  • Fixes icons and states for daily rewards

jprzimba and others added 4 commits May 30, 2026 14:56
Compute missedDays only when now > nextReward using integer division (avoids negative or over-counting from ceil), and restructure conditionals to run the missed-days handling inside a single branch. This ensures joker tokens are deducted correctly, streak is reset only when appropriate, and the "You just lost your daily reward streak." message isn't sent twice. Added explicit casts for time comparisons.
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