X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=e86854cea5addfe466f243cd0d628f4f337af8ac;hp=05dc42f0cc655f716ecac06b230223ddbde3930d;hb=d0237ebe9fa2aa6916b644766d97ff43ac4b945e;hpb=ff0bce79b7a8d040afc336fa3cde2bff97630c07 diff --git a/index.php b/index.php index 05dc42f..e86854c 100644 --- a/index.php +++ b/index.php @@ -3,29 +3,415 @@ "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!
\n"; } } - /* *** * * * * *** @@ -269,241 +646,555 @@ if(sizeof($lines)<2) */ if(isset($_REQUEST["b"])) { - $b=$_REQUEST["b"]; + $b = $_REQUEST["b"]; if( ereg("s",$player[$b]["option"]) && $game["init"]<4) - { + { /* the player already filled out everything */ echo "just wait for the game to start"; } - else if(!isset($_REQUEST["in"])|| !isset($_REQUEST["update"]) ) - { + else if( (!isset($_REQUEST["in"])|| !isset($_REQUEST["update"])) && !ereg("i",$player[$b]["option"])) + { /* the player didn't fill out the form at "a" correctly */ echo "go back to "; - echo " here and fill out the formyour 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 "do you have poverty?"; + if(count_trump($player[$b]["cards"])<4) + { + echo " yes"; + echo " nojust wait for the game to start
\n"; } - else if( ereg("s",$player[$c]["option"]) && $game["init"]<4 ) - { - echo "just wait for the game to start"; + 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"])) - echo "a game is in progress, but you are not playing"; + { + 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"]; - - echo "game in progress and you are in it