Spielerando

Players get the reward for watching an ad two or three times

The ad ends, the reward callback fires, and coins arrive twice because the screen reopened or the phone retried. Worse, an old reward can be claimed again after a restart. This entry makes a reward payable once, and keeps its memory small.

Why this works

Giving each reward an own id and remembering used ids makes paying idempotent: the second attempt does nothing. Remembering an id only as long as the reward could be valid keeps the list short.

When not to use it

Skip the ledger if the reward is not currency, such as a free retry that can safely be granted twice. A simple flag is enough then.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 31 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Players get the reward for watching an ad two or three times" (read_entry reward-after-ad-paid-more-than-once) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP