From 11429eb9238bb0ba7a10a783d293d9051b146795 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 8 Jun 2008 11:13:14 -0700 Subject: BUGFIX: if a call is made the icon will show up right away check at the beginning if a call was made, so that the information is up to date when the output for the table is generated. Signed-off-by: Arun Persaud --- include/game.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'include/game.php') 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)); -- cgit v1.2.3-18-g5258 From 27cbc14d28d072c37474ac1e96d677b88dde27ba Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 15 Jun 2008 23:43:19 -0700 Subject: NEW FEATURE: login button added a login button to the top right, in case you were not logged in. output_status can now be called in only one place, ie index.php and all pages will get the menu... Signed-off-by: Arun Persaud --- include/game.php | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'include/game.php') diff --git a/include/game.php b/include/game.php index 0350d9e..25e2b2f 100644 --- a/include/game.php +++ b/include/game.php @@ -9,9 +9,7 @@ if(!isset($HOST)) if(!myisset("me")) { echo "Hmm, you really shouldn't mess with the urls.
\n"; - output_footer(); - DB_close(); - exit(); + return; } $me = $_REQUEST["me"]; @@ -21,17 +19,11 @@ if(!$myid) { echo "Can't find you in the database, please check the url.
\n"; echo "perhaps the game has been canceled, check by login in here."; - output_footer(); - DB_close(); - exit(); + return; } global $GAME,$RULES,$CARDS; -/* user might get here by clicking on the link in an email, so session might not be set */ -if(isset($_SESSION["name"])) - output_status($_SESSION["name"]); - /* the user has done something, update the timestamp */ DB_update_user_timestamp($myid); @@ -501,9 +493,7 @@ switch($mystatus) echo "The game has been canceled because ".DB_get_name('userid',$nines). " has five or more nines and nobody is playing solo.\n"; - output_footer(); - DB_close(); - exit(); + return; } else if($poverty==1) /* one person has poverty */ { @@ -832,9 +822,7 @@ switch($mystatus) DB_cancel_game($me); echo "

Game ".DB_format_gameid($gameid)." has been canceled.

"; - output_footer(); - DB_close(); - exit(); + return; } else { @@ -1894,8 +1882,4 @@ switch($mystatus) output_ask_for_new_game($names[1],$names[2],$names[3],$names[0],$gameid); } } - - output_footer(); - DB_close(); - exit(); ?> \ No newline at end of file -- cgit v1.2.3-18-g5258