All work

Backend

Player offers and marketing opt-outs

A Java gRPC service for Rocket that tracks which offers CubeCraft players see, when each can show again, and the marketing they've opted out of.

Ziax · CubeCraft and Rocket · 2026

The problem

CubeCraft prompts players with offers. Without one place keeping track, nothing stopped the same player seeing the same prompt over and over, and there was no single place to honor someone saying “don’t send me this kind of thing.”

What I built

  1. Game or webwants to show offer X
  2. GraphQL edgeasks the offers service
  3. Opted out?by category
  4. Cooldown passed?next-show time
  5. Show itrecord the event and the next time

Deciding whether to show an offer

A sketch of the idea, not the production code.

fn can_show(player, offer) -> bool:
    if opt_outs.contains(player, offer.category):
        return false
    last = prompts.last(player, offer.id)
    if last != null and now() < last.next_eligible_at:
        return false
    return true

fn record_prompt(player, offer):
    prompts.save(player, offer.id,
                 shown_at = now(),
                 next_eligible_at = now() + offer.cooldown)
    events.emit("offer.prompted", player, offer.id)

Why it matters

Respecting a player’s choices shouldn’t depend on every feature remembering to check. With it in one service, the check happens the same way for everyone who asks.

Stack