From: Arun Persaud Date: Fri, 3 May 2013 04:38:53 +0000 (-0700) Subject: in some cases the user has to reload the page to get to the next pre-game phase.... X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=692b2c53acc3d0f8a0205b7aba84938580540df7;hp=d3841fcbcb98f5e2bbdeb7b89733b8757e848f20 in some cases the user has to reload the page to get to the next pre-game phase. Skip some of these go automatically to the next pre-games phase, iff possible. --- diff --git a/include/game.php b/include/game.php index 541c70a..a50b247 100644 --- a/include/game.php +++ b/include/game.php @@ -636,6 +636,11 @@ switch($mystatus) $messages[] = _('Checking if someone else selected solo, nines, wedding or poverty.'); + /* in case the user can go do the next stage, we want to skip the break statement at the + * end. We keep track of these cases using this variable + */ + $nobreak=0; + /* check if everyone has reached this stage */ $userids = DB_get_all_userid_by_gameid($gameid); $ok = 1; @@ -666,7 +671,7 @@ switch($mystatus) $messages[] = _('Ok, everyone is done... figuring out what kind of game we are playing.'); /* gametype for displaying it (hides hidden solo)*/ - $GT = get_display_gametype($gameid); + $GT = get_display_gametype($gameid); $startplayer = DB_get_startplayer_by_gameid($gameid); @@ -889,8 +894,11 @@ switch($mystatus) } } else - $messages[] = sprintf(_('Please, start the game.'),$INDEX."?action=game&me=$me"). - "
\n"; + { + $messages[] = sprintf(_('Please, start the game.'),$INDEX."?action=game&me=$me"). + "
\n"; + $nobreak=1; + } } else { @@ -900,8 +908,11 @@ switch($mystatus) $whoid = DB_get_userid('gameid-position',$gameid,$who); if($whoid==$myid) - $messages[] = sprintf(_('Please, start the game.'),$INDEX."?action=game&me=$me"). - "
start the game.'),$INDEX."?action=game&me=$me"). + "
continue here'),$INDEX."?action=game&me=$me"); + $nobreak = 1; } } - break; + if(!$nobreak) + break; case 'play': case 'gameover':