         readOnlyState: gameStateDocument.readOnlyState
         events: gameStateDocument.events
 
+  @_updateGameTime: (gameStateDocument, gameTime) ->
+    console.log "Pushing game time forward.", gameTime, gameStateDocument?._id if LOI.debug
+    
+    LOI.GameState.documents.update gameStateDocument._id,
+      $set:
+        'state.gameTime': gameTime
+        'readOnlyState.simulatedGametime': gameTime
+        stateLastUpdatedAt: new Date()
+
 # Initialize on startup.
 Document.startup ->
   # Simulate game state every 10 minutes.

    
    # What would be the game time now if we simulated for this duration?
    simulationEndGameTime = gameStateDocument.state.gameTime + elapsedGameTime
    
    # Keep processing events that happen before the end time.
    eventsProcessedCount = 0


  @simulateGameState: (gameStateDocument) ->
    console.log "Simulating game state", gameStateDocument?._id if LOI.debug

    # Calculate how much time has passed since game state was updated.
    elapsedRealTime = Date.now() - gameStateDocument.stateLastUpdatedAt.getTime()
    
