X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=e86854cea5addfe466f243cd0d628f4f337af8ac;hp=90b91cead33914e4accd08b868de26dd3fc64a8d;hb=d0237ebe9fa2aa6916b644766d97ff43ac4b945e;hpb=75ad669f06207b8e2813c7ae4f238d46dab25160 diff --git a/index.php b/index.php index 90b91ce..e86854c 100644 --- a/index.php +++ b/index.php @@ -3,19 +3,491 @@ "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
-no game in progress, please input 4 names and email addresses
+no game in progress, please input 4 names and email addresses, please make sure that the addresses are correct!
+ { /* load game status */ + parse_status(); +/* ** + * * * + * **** + * * * + * + * check if a player wants to accept a game + */ + if(isset($_REQUEST["a"])) + { + $a = $_REQUEST["a"]; + + if( ereg("[is]",$player[$a]["option"]) && $game["init"]<4) + { + echo "just wait for the game to start"; + } + else if( !ereg("[is]",$player[$a]["option"]) ) + { + ?> \n"; -} - /* yes? email him his hand, ask for solo, poverty, email every move or every card? */ -if(isset($_REQUEST["b"])) -{ - $b=$_REQUEST["b"]; - echo "hash is $byour 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
+ + echo "do you have poverty?"; + if(count_trump($player[$b]["cards"])<4) + { + echo " yes"; + echo " nojust 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 "