X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=a53a23c3b163d789c08df73474303527911f82ae;hp=05dc42f0cc655f716ecac06b230223ddbde3930d;hb=96706fe586fb9aa2739d6387e84116df2b7edefa;hpb=ff0bce79b7a8d040afc336fa3cde2bff97630c07 diff --git a/index.php b/index.php index 05dc42f..a53a23c 100644 --- a/index.php +++ b/index.php @@ -3,29 +3,329 @@ "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
-If you find bugs, please list them in the wiki
\n"; + +echo "Cards that have a green background have a comment, which you can access by hovering over the card with your mouse ;)
\n"; + $history=array(); /* check for status file and read it, if possible */ @@ -86,7 +413,7 @@ if( isset($_REQUEST["PlayerA"]) && isset($_REQUEST["EmailA"]) && isset($_REQUEST["EmailB"]) && isset($_REQUEST["EmailC"]) && - isset($_REQUEST["EmailD"]) ) + isset($_REQUEST["EmailD"]) && sizeof($lines<2)) { $PlayerA = $_REQUEST["PlayerA"]; $PlayerB = $_REQUEST["PlayerB"]; @@ -97,13 +424,29 @@ if( isset($_REQUEST["PlayerA"]) && $EmailC = $_REQUEST["EmailC"] ; $EmailD = $_REQUEST["EmailD"] ; + $hashA = md5("AGameOfDoko".$PlayerA.$EmailA); + $hashB = md5("AGameOfDoko".$PlayerB.$EmailB); + $hashC = md5("AGameOfDoko".$PlayerC.$EmailC); + $hashD = md5("AGameOfDoko".$PlayerD.$EmailD); + /* send out email, check for error with email */ - echo "send out emails to everyone, asking if they want to join"; - echo "use linkno 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!
@@ -171,59 +519,7 @@ if(sizeof($lines)<2) } else { /* load game status */ - $game["init"]=0; - - $tmp = explode( ":",$lines[0]); - $hash[0] = $tmp[0]; - $player[$tmp[0]]["number"] = 0; - $player[$tmp[0]]["hash"] = $tmp[0]; - $player[$tmp[0]]["name"] = $tmp[1]; - $player[$tmp[0]]["email"] = $tmp[2]; - $player[$tmp[0]]["option"] = $tmp[3]; - $player[$tmp[0]]["cards"] = $tmp[4]; - if(ereg("s",$tmp[3])) $game["init"]++; - - $tmp = explode( ":",$lines[1]); - $hash[1] = $tmp[0]; - $player[$tmp[0]]["number"] = 1; - $player[$tmp[0]]["hash"] = $tmp[0]; - $player[$tmp[0]]["name"] = $tmp[1]; - $player[$tmp[0]]["email"] = $tmp[2]; - $player[$tmp[0]]["option"] = $tmp[3]; - $player[$tmp[0]]["cards"] = $tmp[4]; - if(ereg("s",$tmp[3])) $game["init"]++; - - $tmp = explode( ":",$lines[2]); - $hash[2] = $tmp[0]; - $player[$tmp[0]]["number"] = 2; - $player[$tmp[0]]["hash"] = $tmp[0]; - $player[$tmp[0]]["name"] = $tmp[1]; - $player[$tmp[0]]["email"] = $tmp[2]; - $player[$tmp[0]]["option"] = $tmp[3]; - $player[$tmp[0]]["cards"] = $tmp[4]; - if(ereg("s",$tmp[3])) $game["init"]++; - - $tmp = explode( ":",$lines[3]); - $hash[3] = $tmp[0]; - $player[$tmp[0]]["number"] = 3; - $player[$tmp[0]]["hash"] = $tmp[0]; - $player[$tmp[0]]["name"] = $tmp[1]; - $player[$tmp[0]]["email"] = $tmp[2]; - $player[$tmp[0]]["option"] = $tmp[3]; - $player[$tmp[0]]["cards"] = $tmp[4]; - if(ereg("s",$tmp[3])) $game["init"]++; - - /* save the game history */ - for($i=4;$iaehm... at the moment poverty is not implented. so I guess you need to play a normal game, even if you have less than 3 turmp :(...sorry
\n"; + echo "do you have too many nines?"; + if(count_nines($player[$b]["cards"])>4) + { + echo " yes"; + echo " no\n";
+ /* is it our turn? */
+ if($hash[$next]==$me && !isset($_REQUEST["card"]) && !isset($_REQUEST["win"]))
+ {
+ echo "ITS YOUR TURN
\n";
+ echo "your cards are:
\n";
foreach($mycards as $card)
{
display_link_card($card,$me);
}
- echo "
\n";
}
- echo "
";
-
+ else
+ { /* not our turn, just show the hand */
+ echo "your cards are:
\n";
+ foreach($mycards as $card)
+ {
+ display_card($card);
+ }
+ }
+ echo "