private void endGame() { gameEnded = true; if (player2 != null || singlePlayer) { game.EndTime = DateTime.Now; server.insertGameToDB(game); } }