• Discuss all the things!

    172 Topics
    647 Posts

    Yes, your current design matches the recommended pattern: Redemption Code is a one-way gate for “has this user consumed this shared code?”, while your claim entity is the authoritative state machine for fulfillment, retries, and audit (Redeeming → Redeemed → Granting → Granted / GrantFailed), with Granted as the idempotency guard for duplicate grants. The main thing to watch is call ordering: it’s preferable to write the claim to Redeeming first as an intent record, then call redeemCode(), so any Redeeming with no further progress is detectable and recoverable by your server without depending on the Redemption Code record.

    Consolidating the brainCloud-side claim init + redemption into a single CloudCode script is a good fit, provided the script is strictly idempotent and fulfillment stays in your server pipeline. The script should read the claim state, upsert to Redeeming if needed, call redeemCode() (skipping if already Redeemed or beyond), update the claim to Redeemed, and return rich state (claimState, claimId, rewardDataId) so your server can then perform fulfillment and issue a final Granted / GrantFailed update. This gives you a clean two-call pattern from the server to brainCloud on the happy path, while the script’s state checks make retries safe even though CloudCode itself is not transactional.

  • Suggestions for improvements, new features, etc.

    44 Topics
    154 Posts

    @Ali-Raza could you let me know your Team ID and the AppIDs you would like this increase for? thanks

  • Questions specific to particular APIs, libraries, etc.

    64 Topics
    267 Posts

    Added the additional details to 13660

  • General cloud code discussions...

    35 Topics
    149 Posts

    Q1: The removed player is completely excluded from reward calculation, so if the deletion happens before the job runs, that player is never iterated over and receives no rank or rewards.
    Q2: Yes, the modified score will be used. The job always reads live state. Note that whether the score actually gets modified depends on the leaderboard type (e.g., for the LOW_VALUE type, only updates if the new score is less than the existing)
    Q3: No backfilling, the next joiner goes to the latest instance, not the freed spot in ^2. No loop over earlier instances (^1, ^2) ever happens. The next joiner goes to ^3 (or ^4 if ^3 is full). The freed spot in ^2 stays empty permanently.

  • brainCloud's online learning tutorials and examples.

    3 Topics
    3 Posts

    brainCloud developers have just release several playable builds of our famous examples! See our cool features in action. Find them at https://getbraincloud.com/demos for Windows, Mac, online and mobile.

brainCloud 5 is alive!

brainCloud 5 features Portal-X (our next-gen portal), Integrated Forums (you found them), our new Bootcamp training videos, and more!

Join the discussion here!

brainCloud Bootcamp!
brainCloud's new video learning portal is now online! Go check out brainCloud BootCamp!

Need to report a defect?
Use the chat widget from the Design Portal - or send an email to support at getbraincloud.com. Thanks!