X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=99ff454fd9a84d6a539cb075915eddd8ff3cef2e;hp=c78482c1042dd8e409bb1cdccea8c481691fdb56;hb=1829c4b57884b84b5ef6cb54a031a62ce53005fa;hpb=34dca92fa9209df27921dcc58b9ea5bfb8f131f0 diff --git a/include/game.php b/include/game.php index c78482c..99ff454 100644 --- a/include/game.php +++ b/include/game.php @@ -183,12 +183,12 @@ if(myisset('call') && $_REQUEST['call'] == '0' && can_call(0,$me)) if( $gamestatus != 'gameover' && isset($_SESSION['id']) ) { /* game isn't over, only valid user can get here, so show menu */ - display_user_menu($myid); + display_user_menu($myid, $me); } else if( $mystatus == 'gameover' && isset($_SESSION['id']) ) { /* user is looking at someone else's game, show the menu for the correct user */ - display_user_menu($_SESSION['id']); + display_user_menu($_SESSION['id'],$me); } else { @@ -330,6 +330,104 @@ if($mystatus!='gameover') if(isset($_SESSION['id'])) DB_update_user_timestamp($_SESSION['id']); + +/****************************************************************************** + * Output menu for selecting tricks + ******************************************************************************/ + +switch($mystatus) + { + case 'start': + break; + case 'init': + case 'check': + /* output sickness of other playes, in case they already selected and are sitting in front of the current player */ + echo "\n\n"; /* end div trick, end li trick , end tricks*/ + /* end displaying sickness */ + break; + case 'poverty': + /* output pre-game trick in case user reloads, + * only needs to be done when a team has been formed */ + if($myparty=='re' || $myparty=='contra') + { + echo "\n\n\n"; /* end div trick, end li trick , end ul tricks */ + } + /* end output pre-game trick */ + break; + case 'play': + case 'gameover': + + echo "\n\n\n"; + + break; + default: + } + + /****************************************************************************** * Output tricks played, table, messages, and cards (depending on game status) ******************************************************************************/ @@ -338,7 +436,7 @@ if($mystatus!='gameover') echo "
\n"; /* display the table and the names */ -display_table(); +display_table_begin(); /* mystatus gets the player through the different stages of a game. * start: does the player want to play? @@ -361,6 +459,7 @@ $cards_status = CARDS_EMPTY; */ $messages = array(); + switch($mystatus) { case 'start': @@ -428,28 +527,6 @@ switch($mystatus) ***************************/ if(!myisset('solo','wedding','poverty','nines','lowtrump') ) { - /* output sickness of other playes, in case they already selected and are sitting in front of the current player */ - echo "\n\n"; /* end div trick, end li trick , end tricks*/ - /* end displaying sickness */ - $mycards = DB_get_hand($me); output_check_for_sickness($me,$mycards); @@ -546,28 +623,6 @@ switch($mystatus) * this can therefore only be handled once all players finished the last stage */ - /* output sickness of other playes, in case they already selected and are sitting in front of the current player */ - echo "\n\n"; /* end div trick, end li trick , end tricks*/ - /* end displaying sickness */ - $messages[] = _('Checking if someone else selected solo, nines, wedding or poverty.'); /* check if everyone has reached this stage */ @@ -879,24 +934,6 @@ switch($mystatus) }; } - /* output pre-game trick in case user reloads, - * only needs to be done when a team has been formed */ - if($myparty=='re' || $myparty=='contra') - { - echo "\n\n\n"; /* end div trick, end li trick , end ul tricks */ - } - /* end output pre-game trick */ - /* get hand */ $mycards = DB_get_hand($me); @@ -1270,7 +1307,7 @@ switch($mystatus) $pos = DB_get_startplayer_by_gameid($gameid)-1; $firstcard = ''; /* first card in a trick */ - echo "\n\n"; /* end ul tricks*/ + echo "\n"; /* end ul tricks*/ if($myturn && !myisset('card') && $mystatus=='play' ) { @@ -1987,6 +2018,9 @@ switch($mystatus) myerror("error in testing the status"); } /*end of output: tricks, table, messages, card */ +/* display the 2nd half of table and the names */ +display_table_end(); + /************** * show cards * **************/