Module 13 · In Studio · challenge 2 of 2 in this lesson

consume refills tokens by elapsed time * refillRate clamped to capacity, and never leaves tokens negative

A test in Studio grades it and prints a pass code.

Open

Level 3, Professional

Challenge

Complete challenges/work/security_guard.luau so the shared remote wrapper, cross-server strike merger and Device Trust policy pass every check. Run game.ServerScriptService.RunGameTests:Invoke("security-at-scale", "security-at-scale-guard") in Studio (or test in the pure Luau runner). Written solution: challenges/solutions/security-at-scale.md.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("security-at-scale", "security-at-scale-guard") in the server command bar. Copy the pass code from Output.

Done means

  • consume refills tokens by elapsed time * refillRate clamped to capacity, and never leaves tokens negative
  • newDispatcher enforces RemoteGuard's order: unknown remote, per-player token bucket, schema validate, kill switch disabled, optional authorize
  • mergeStrikes unions two server lists, deduplicates by id, drops out-of-window and future timestamps, and sorts ascending by at (tie-break id)
  • allowFeature allows all levels for play, Unknown/Standard/Full for trade, and Standard/Full for ranked
  • challenges/security-at-scale.luau prints TEST PASS for all 15 checks

The Course Runner prints this code when the test passes.