Can you provide a code implementation in Nim of rollback based netcode for a game, assuming a deterministic game simulation that allows using only inputs for synchronization (similar to GGPO). This implementation can assume some functions to be already provided elsewhere: a game state serialization function, a game state deserialization function, and a frame advancing function.