X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=0350d9e4adf2287889960674f3cea520c78808c5;hp=8d59103707e20d9166ef976a9a0b084fcc046f70;hb=11429eb9238bb0ba7a10a783d293d9051b146795;hpb=47fc7e1eec3fc99633a9085c9292ddf1ad065efd diff --git a/include/game.php b/include/game.php index 8d59103..0350d9e 100644 --- a/include/game.php +++ b/include/game.php @@ -118,6 +118,18 @@ if( $mystatus!='gameover' ) }; output_user_notes($myid,$gameid,$mystatus); +/* handle calls */ +if(myisset("call") && $_REQUEST["call"] == "120" && can_call(120,$me)) + $result = DB_query("UPDATE Hand SET point_call='120' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "90" && can_call(90,$me)) + $result = DB_query("UPDATE Hand SET point_call='90' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "60" && can_call(60,$me)) + $result = DB_query("UPDATE Hand SET point_call='60' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "30" && can_call(30,$me)) + $result = DB_query("UPDATE Hand SET point_call='30' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "0" && can_call(0,$me)) + $result = DB_query("UPDATE Hand SET point_call='0' WHERE hash='$me' "); + /* output extra division in case this game is part of a session */ if($session) { @@ -1190,18 +1202,6 @@ switch($mystatus) /* update Game timestamp */ DB_update_game_timestamp($gameid); - /* check if a call was made, must do this before we set the card status to played */ - if(myisset("call") && $_REQUEST["call"] == "120" && can_call(120,$me)) - $result = DB_query("UPDATE Hand SET point_call='120' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "90" && can_call(90,$me)) - $result = DB_query("UPDATE Hand SET point_call='90' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "60" && can_call(60,$me)) - $result = DB_query("UPDATE Hand SET point_call='60' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "30" && can_call(30,$me)) - $result = DB_query("UPDATE Hand SET point_call='30' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "0" && can_call(0,$me)) - $result = DB_query("UPDATE Hand SET point_call='0' WHERE hash='$me' "); - /* mark card as played */ DB_query("UPDATE Hand_Card SET played='true' WHERE hand_id='$handid' AND card_id=". DB_quote_smart($card));