five-on-it / apps/server/src/notoriety
apps/server/src/notoriety
Notoriety (GAME_DESIGN §12, §14): a room's record of how far each player pushed the police. NotorietyTracker watches every player's Wanted stars tick by tick (the room feeds it @foi/ai's wantedView) and keeps, per player, the most stars they reached and their longest stretch at MAX_STARS: a stretch starts on the tick they reach ten and ends when the stars drop, when the police bust them or when they leave the room. It tells the platform (report) when either record grows: the most stars as they are reached, a stretch at ten once it ends. A player with no account (a room nobody signed into) is tracked and never reported.
notorietyReporter is how a game server tells the platform: a POST of @foi/protocol's NotorietyReport to the API's POST /notoriety (FOI_NOTORIETY_URL) with the room secret as the bearer, sent and forgotten (a failure is logged; the platform keeps the best of each report, so a lost one is made good by the next).