NextPlayer: A Node.js module for managing player turnsDistributed Systems with Node.js, O'Reilly 2020, has been published!
Ever have the need to keep track of players in a Node.js based game? Maybe you were building a turn-based game and you had a few servers running and you needed some distributed and atomic solution backed with Redis? Well, if this teeny tiny subset of developer need overlaps with yours then today is your lucky day!
NextPlayer lets you track players, add and remove players dynamically, and cycle through a turn counter. Players can be added in batch (e.g. at the start of a match) or one at a time. Players can be removed one at a time as they die or lose connection or simply rage quit.