From 692b2c53acc3d0f8a0205b7aba84938580540df7 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Thu, 2 May 2013 21:38:53 -0700 Subject: 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. --- include/game.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'include/game.php') 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': -- cgit v1.2.3-18-g5258