Making server end when game ends.