summaryrefslogtreecommitdiffstats
path: root/include/game.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2013-05-02 21:38:53 -0700
committerArun Persaud <arun@nubati.net>2013-05-02 21:38:53 -0700
commit692b2c53acc3d0f8a0205b7aba84938580540df7 (patch)
treeb59218d8833c9eaca9d7ab0f1c3a56dbab277973 /include/game.php
parentd3841fcbcb98f5e2bbdeb7b89733b8757e848f20 (diff)
downloade-DoKo-692b2c53acc3d0f8a0205b7aba84938580540df7.tar.gz
e-DoKo-692b2c53acc3d0f8a0205b7aba84938580540df7.tar.bz2
e-DoKo-692b2c53acc3d0f8a0205b7aba84938580540df7.zip
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.
Diffstat (limited to 'include/game.php')
-rw-r--r--include/game.php33
1 files changed, 26 insertions, 7 deletions
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, <a href="%s">start</a> the game.'),$INDEX."?action=game&amp;me=$me").
- "<br />\n";
+ {
+ $messages[] = sprintf(_('Please, <a href="%s">start</a> the game.'),$INDEX."?action=game&amp;me=$me").
+ "<br />\n";
+ $nobreak=1;
+ }
}
else
{
@@ -900,8 +908,11 @@ switch($mystatus)
$whoid = DB_get_userid('gameid-position',$gameid,$who);
if($whoid==$myid)
- $messages[] = sprintf(_('Please, <a href="%s">start</a> the game.'),$INDEX."?action=game&amp;me=$me").
- "<br /\n";
+ {
+ $messages[] = sprintf(_('Please, <a href="%s">start</a> the game.'),$INDEX."?action=game&amp;me=$me").
+ "<br /\n";
+ $nobreak=1;
+ }
else
{
$whohash = DB_get_hash_from_game_and_pos($gameid,$who);
@@ -919,7 +930,8 @@ switch($mystatus)
}
}
}
- break;
+ if(!$nobreak)
+ break;
case 'poverty':
/* user only gets here in a poverty game, several things have to be handled here:
@@ -938,6 +950,11 @@ switch($mystatus)
* it is easier to check B) first
*/
+ /* 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;
+
set_gametype($gametype); /* this sets the $CARDS variable */
$myparty = DB_get_party_by_hash($me);
@@ -1190,9 +1207,11 @@ switch($mystatus)
}
}
$messages[] = sprintf(_('Please, <a href="%s">continue</a> here'),$INDEX."?action=game&amp;me=$me");
+ $nobreak = 1;
}
}
- break;
+ if(!$nobreak)
+ break;
case 'play':
case 'gameover':