From: arun Date: Sat, 18 Nov 2006 13:24:16 +0000 (+0000) Subject: started to work on the solo, etc stuff X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=141a47a3f1a6ffa0eb48c6664c3d17eb0abaf1ad started to work on the solo, etc stuff --- diff --git a/index.php b/index.php index d1dad1b..99ef805 100644 --- a/index.php +++ b/index.php @@ -204,6 +204,7 @@ function save_status() { foreach($hash as $key) { + /* sorting the options, not sure why I do that actually */ $tmp=""; if( ereg("i",$player[$key]["option"]) ) $tmp.="i"; @@ -213,8 +214,29 @@ function save_status() $tmp.="t"; if( ereg("c",$player[$key]["option"]) ) $tmp.="c"; + if( ereg("N",$player[$key]["option"]) ) + $tmp.="N"; + if( ereg("W",$player[$key]["option"]) ) + $tmp.="W"; + if( ereg("P",$player[$key]["option"]) ) + $tmp.="P"; + if( ereg("O",$player[$key]["option"]) ) + $tmp.="O"; + if( ereg("S",$player[$key]["option"]) ) + $tmp.="S"; + if( ereg("Q",$player[$key]["option"]) ) + $tmp.="Q"; + if( ereg("J",$player[$key]["option"]) ) + $tmp.="J"; + if( ereg("C",$player[$key]["option"]) ) + $tmp.="C"; + if( ereg("A",$player[$key]["option"]) ) + $tmp.="A"; + if( ereg("H",$player[$key]["option"]) ) + $tmp.="H"; $player[$key]["option"]=$tmp; + /* saving the player stats */ fwrite($output,"".$player[$key]["hash"].":" ); fwrite($output,"".$player[$key]["name"].":" ); fwrite($output,"".$player[$key]["email"].":" ); @@ -353,6 +375,11 @@ if(sizeof($lines)<2) else { /* load game status */ $game["init"]=0; + $game["solo-who"]=-1; + $game["solo-what"]=""; + $game["wedding"]=0; + $game["poverty"]=0; + $game["nines"]=0; $tmp = explode( ":",$lines[0]); $hash[0] = $tmp[0]; @@ -504,9 +531,18 @@ if(sizeof($lines)<2)

aehm... at the moment please just answer everything with no, still need to implement this

- do you want to play solo? - yes - no
+ do you want to play solo? + +
do you have a wedding? yes @@ -515,6 +551,10 @@ if(sizeof($lines)<2) do you have poverty? yes no
+ + do too many nines? + yes + no
\n"; @@ -528,7 +568,7 @@ if(sizeof($lines)<2) { $c=$_REQUEST["c"]; - if(!isset($_REQUEST["solo"])|| !isset($_REQUEST["wedding"])|| !isset($_REQUEST["poverty"]) ) + if(!isset($_REQUEST["solo"])|| !isset($_REQUEST["wedding"])|| !isset($_REQUEST["poverty"]) || !isset($_REQUEST["nines"]) ) { echo "go back to "; echo " here and fill out the form
"; @@ -540,7 +580,48 @@ if(sizeof($lines)<2) else if($game["init"]<4) { echo "handle krankheit
"; - + if( $_REQUEST["solo"]!="No") + { + switch($_REQUEST["solo"]) + { + case "No trump": + $player[$c]["option"].="O"; + break; + case "Normal solo": + $player[$c]["option"].="S"; + break; + case "Queen solo": + $player[$c]["option"].="Q"; + break; + case "Jack solo": + $player[$c]["option"].="J"; + break; + case "Club solo": + $player[$c]["option"].="C"; + break; + case "Spade solo": + $player[$c]["option"].="A"; + break; + case "Hear solo": + $player[$c]["option"].="H"; + break; + } + } + else if($_REQUEST["wedding"] == "yes") + { + echo "wedding was chosen
"; + $player[$c]["option"].="W"; + } + else if($_REQUEST["poverty"] == "yes") + { + echo "poverty was chosen
"; + $player[$c]["option"].="P"; + } + else if($_REQUEST["nines"] == "yes") + { + echo "nines was chosen
"; + $player[$c]["option"].="N"; + } $message = "you're in. once everyone has filled out the form,". "the game will start and you'll get an eamil on your turn\n"; mymail($player[$c]["email"],"[DoKo] the game will start soon",$message);