X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=d931e6edaedf561cd2682e57cccbc720ebf25ef1;hp=6ab8f2e2fe65e2df05228022039f8a42751c2f5a;hb=4debc08c04fc66d59a04eab5fb10bbdb31ddece0;hpb=2ca8cc3e3c95c7be49ba76054180af2750ce1ba5 diff --git a/index.php b/index.php index 6ab8f2e..d931e6e 100644 --- a/index.php +++ b/index.php @@ -1,519 +1,105 @@ - - -
-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 "
$name | ".date("Y-m-d H:i:s")." |
no game in progress, please input 4 names and email addresses, please make sure that the addresses are correct!
- -"; + + DB_update_user_timestamp($uid); + + echo "these are the games you are playing in:
\n";
+ $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.mod_date from Hand".
+ " LEFT JOIN Game On Hand.game_id=Game.id".
+ " WHERE Hand.user_id='$uid' AND Game.status<>'gameover'" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
{
- echo "just wait for the game to start";
+ echo "game #".$r[1]." ";
+ 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";
+ echo "
";
}
- else if( !ereg("[is]",$player[$a]["option"]) )
- {
- ?>
-
your cards are:
\n";
- foreach($mycards as $card)
- display_card($card);
- echo "
aehm... at the moment poverty is not implented. so I guess you need to play a normal game, even if you have less than 3 trump :(...sorry
- - \n"; - } - } - } + echo "\n"; - if(isset($_REQUEST["c"])) - { - $c = $_REQUEST["c"]; - - if( ereg("s",$player[$c]["option"]) && $game["init"]<4 ) - { /* the player already filled out everything */ - echo "just wait for the game to start
\n"; - } - else if(!isset($_REQUEST["solo"]) || - !isset($_REQUEST["wedding"]) || - !isset($_REQUEST["poverty"]) || - !isset($_REQUEST["nines"]) ) - {/* player still needs to fill out the form */ - echo "go back to "; - echo " here and fill out the formThe game can start now, it's your turn, please use this link to play a card.
\n"; - } - else if($game["init"]==4) - { - $message = "The game can start now, it's your turn, please use this link to play a card:\n". - $host."?me=".$hash[$game["startplayer"]]."\n"; - mymail($player[$hash[$game["startplayer"]]]["email"],"[DoKo-debug] let's go",$message); - echo "The game has started. An email has been sent out to the first player.
\n"; - } - else - { - echo "You're in. Once everyone has filled out the form, ". - "the game will start and you'll get an eamil on your turn.
\n"; - } - } - } - /* END SETUP */ - - /* the game */ - if($game["init"]==4) - { - /* check for sickness, only would need to do this on the first trick really...*/ - /***** someone has 5 nines and no one is playing solo => cancel game */ - if($game["nines"]>=0 && $game["solo-who"]<0) - { - $message = $player[$hash[$game["poverty"]]]["nines"]." has more than 4 nines. Game aborted!\n"; - for($i=0;$i<4;$i++) - mymail($player[$hash[$i]]["email"],"[DoKo-debug] the game has been canceled",$message); - - $output = fopen("status.txt","w"); - if($output) - fclose($output); - else - echo "problem opening file"; - }; - - /* who is requesting this*/ - if(!isset($_REQUEST["me"])) - { - if(!isset($_REQUEST["recovery"])) - { - echo "A game is in progress and kibitzing is not allowed. Sorry!.An email with the game information has been sent.
\n"; - } - else - { - echo "can't find this email address, sorry.
\n"; - }; - } /* end recovery */ - } - else - { /* $me is set */ - $me = $_REQUEST["me"]; - - /* show history */ - /* old tricks as list */ - echo "and these are your games that are already done:
\n";
+ $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
+ echo "game #".$r[1]."
";
+ echo "
registered players:
\n";
+ foreach ($names as $name)
+ echo "$name
\n";
+ echo "
Want to start a new game? remember 4 names from the list above and visit ". + "this page.
"; + } + else + { + echo "sorry email and password don't match