X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Ffunctions.php;h=d09408cd43094b0c0e4ca00b5b460b2442297fbb;hp=9f58f51f969fb610a024637213c5ff9cdd726d5a;hb=567f0d615194566c629887a315cd864bbe84fde9;hpb=671da1a387eb879aec526ea9b7614ff9381e7c0f
diff --git a/include/functions.php b/include/functions.php
index 9f58f51..d09408c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -177,14 +177,27 @@ function compare_cards($a,$b,$game)
return 1;
if($b == 19 || $b == 20 )
return 0;
- };
- if($RULES['schweinchen']=='second' && $GAME['schweinchen-second'])
+ }
+ else if($RULES['schweinchen']=='second' && $GAME['schweinchen-second'])
{
if($a == 19 || $a == 20 )
return 1;
if($b == 19 || $b == 20 )
return 0;
- };
+ }
+ else if($RULES['schweinchen']=='secondaftercall' && $GAME['schweinchen-who'] && $GAME['schweinchen-second'] )
+ {
+ /* check if a call was made either by the player or his partner. If so activate Schweinchen rule. */
+ if(DB_get_call_by_hash($GAME['schweinchen-who']) || DB_get_partner_call_by_hash($GAME['schweinchen-who']) )
+ {
+ if($a == 19 || $a == 20 )
+ return 1;
+ if($b == 19 || $b == 20 )
+ return 0;
+ }
+ /* if not, do nothing and the foxes are just handeled as normal trump */
+ }
+ ;
case "heart":
case "spade":
case "club":
@@ -734,7 +747,7 @@ function display_table ()
if(!$debug)
echo " $name \n";
else
- echo " $name\n";
+ echo " $name\n";
/* add hints for poverty, wedding, solo, etc */
if( $gametype != "solo")
@@ -846,25 +859,32 @@ function display_table ()
function display_user_menu()
{
- global $WIKI,$myid,$INDEX;
+ global $WIKI,$INDEX;
+
+ /* get the id we are looking for */
+ if(isset($_SESSION['id']))
+ $myid = $_SESSION['id'];
+ else
+ return;
$result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand".
" LEFT JOIN Game On Hand.game_id=Game.id".
" WHERE Hand.user_id='$myid'".
- " AND Game.player='$myid'".
+ " AND ( Game.player='$myid' OR ISNULL(Game.player) )".
" AND Game.status<>'gameover'".
" ORDER BY Game.session" );
- if(DB_num_rows($result))
- echo "It's your turn in these games:
\n";
$i=0;
while( $r = DB_fetch_array($result))
{
if($i==0)
- echo "