/**************************************
* get some information from the DB
**************************************/
+start:
$gameid = DB_get_gameid_by_hash($me);
$myname = DB_get_name('hash',$me);
$mystatus = DB_get_status_by_hash($me);
break;
}
else
- {
- /* everything is ok, save what user said and proceed */
- $messages[] = _('Processing what you selected in the last step...');
+ { /* everything is ok, save what user said and proceed */
/* check if this sickness needs to be handled first */
$startplayer = DB_get_startplayer_by_gameid($gameid); /* need this to check which solo goes first */
* this can therefore only be handled once all players finished the last stage
*/
- $messages[] = _('Checking if someone else selected solo, nines, wedding or poverty.');
-
/* check if everyone has reached this stage */
$userids = DB_get_all_userid_by_gameid($gameid);
$ok = 1;
* are playing, in case there are any solos this already
* will have the correct information in it */
- $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);
$gametype = 'wedding';
};
/* now the gametype is set correctly in the database */
- $messages[] = _('Got it').' :)';
/* loop over all players, set re/contra if possible and start the game if possible */
$userids = DB_get_all_userid_by_gameid($gameid);
}
}
else
- $messages[] = sprintf(_('Please, <a href="%s">start</a> the game.'),$INDEX."?action=game&me=$me").
- "<br />\n";
+ {
+ $mystatus = 'play';
+ goto play;
+ }
}
else
{
$whoid = DB_get_userid('gameid-position',$gameid,$who);
if($whoid==$myid)
- $messages[] = sprintf(_('Please, <a href="%s">start</a> the game.'),$INDEX."?action=game&me=$me").
- "<br /\n";
+ {
+ $mystatus = 'poverty';
+ goto poverty;
+ }
else
{
$whohash = DB_get_hash_from_game_and_pos($gameid,$who);
break;
case 'poverty':
+ poverty:
/* user only gets here in a poverty game, several things have to be handled here:
* A) ask, if user wants to take trump
* yes-> take trump,
}
}
else
- $messages[]= sprintf(_('Please, <a href="%s">start</a> the game.'),$INDEX."?action=game&me=$me");
+ {
+ $mystatus = 'play';
+ goto play;
+ }
}
/* the following is part A) of what needs to be done */
case 'play':
case 'gameover':
+ play:
/* both entries here, so that the tricks are visible for both.
* in case of 'play' there is a break later that skips the last part
*/