More fixes. Using player name as base for game name now. Removing games which have no players left. Check collision of all player names on connect (kind of slow, but name needs to be unique).

This commit is contained in:
lotodore
2007-08-21 17:27:13 +00:00
parent 3e4b134faa
commit 3a2f3255af
10 changed files with 120 additions and 15 deletions
+7 -3
View File
@@ -655,9 +655,13 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
if (curGame.getCurrentHand()->getPlayerArray()[i]->getMyCash() > 0)
playersPositiveCashCounter++;
}
// TODO: this is not an assert - terminate game if true.
assert(playersPositiveCashCounter);
if (playersPositiveCashCounter == 1)
if (!playersPositiveCashCounter)
{
// No more players left - restart.
server.SetState(SERVER_INITIAL_STATE::Instance());
retVal = MSG_NET_GAME_SERVER_END;
}
else if (playersPositiveCashCounter == 1)
{
// View a dialog for a new game - delayed.
server.SetState(ServerGameStateNextGameDelay::Instance());