X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=de8dc1d309b7fe6501d30d01f0a4dadeccdffb60;hp=98420418669f997e73418c4c9d13d7cd8ad07202;hb=465e73265bc236531832686a8ae54894be928b81;hpb=87619b20d23599acf4132d2f36555ffeda35f775 diff --git a/index.php b/index.php index 9842041..de8dc1d 100644 --- a/index.php +++ b/index.php @@ -1,37 +1,60 @@ \n"; echo "perhaps the game has been cancled, check by login in here."; + output_footer(); + DB_close(); exit(); } DB_update_user_timestamp($myid); - + /* get some information from the DB */ $gameid = DB_get_gameid_by_hash($me); $myname = DB_get_name_by_hash($me); - $mystatus = DB_get_status_by_hash($me); - $mypos = DB_get_pos_by_hash($me); - echo "
\n"; - - - - if(myisset("cancle")) - echo "canceling a game is not implemented at the moment, but will be soon...
your cards are:
\n";
- foreach($mycards as $card)
- display_card($card);
- echo "
Game ".DB_format_gameid($gameid)." has been cancled.
You need to wait longer before you can cancle a game...
\n"; + } +/* handle request from one specific player for one game, + * (the hash is set on a per game base) */ +else if(myisset("me")) + { + $me = $_REQUEST["me"]; + + /* test for valid ID */ + $myid = DB_get_userid_by_hash($me); + if(!$myid) + { + echo "Can't find you in the database, please check the url.Session:
\n";
+ echo " p = pre-game phase ";
+ echo "P = game in progess ";
+ echo "F = game finished
";
+ echo "
\n"; + while( $r = mysql_fetch_array($result,MYSQL_NUM)) + { + $game = DB_format_gameid($r[1]); + $gamenr = (int) $game; + if($gamenrold < $gamenr) + { + if($gamenrold!=-1) + echo " | |||
$gamenr: | "; + else + echo "$gamenr: | "; + $gamenrold = $gamenr; + } + if($r[4]=='pre') + { + echo "\n p "; + + } + else if ($r[4]=='gameover') + echo "\n F "; + else + { + echo "\n P "; + } + if($r[4] != 'gameover') + { + echo " | \n "; + if($r[3]) + { + if($r[3]==$myid) + echo "(it's your turn)\n"; + else + { + $name = DB_get_name_by_userid($r[3]); + echo "(it's $name's turn)\n"; + }; + } + if(time()-strtotime($r[2]) > 60*60*24*30) + echo " The game has been running for over a month.". + " Do you want to cancel it? yes". + " (clicking here is final and can't be restored)"; + + } + } + echo " |
\n"; + echo implode(", ",$names)."\n"; + echo "
\n"; + } + } + else + { + echo "Sorry email and password don't match. Please try again.