Cloud code to end game.