X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=e86854cea5addfe466f243cd0d628f4f337af8ac;hp=a2366ed6fda7c54d88a8cdd1538bfa7f01fc46e4;hb=d0237ebe9fa2aa6916b644766d97ff43ac4b945e;hpb=9197d1d5144a1d281db321fbaa523172c88da07e diff --git a/index.php b/index.php index a2366ed..e86854c 100644 --- a/index.php +++ b/index.php @@ -3,26 +3,58 @@ "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
-If you find bugs, please list them in the wiki
\n"; - +/***************** M A I N **************************/ + $history=array(); /* check for status file and read it, if possible */ if(file_exists("status.txt")) $lines = file("status.txt"); - else - die("no file"); +else + die("no file"); /* check if we want to start a new game */ if( isset($_REQUEST["PlayerA"]) && @@ -424,10 +527,10 @@ if( isset($_REQUEST["PlayerA"]) && "If you want to join this game, please follow this link:\n\n". " ".$host."?a="; - mymail($EmailA,"Invite for a game of DoKo","Hello $PlayerA,\n".$message.$hashA); - mymail($EmailB,"Invite for a game of DoKo","Hello $PlayerB,\n".$message.$hashB); - mymail($EmailC,"Invite for a game of DoKo","Hello $PlayerC,\n".$message.$hashC); - mymail($EmailD,"Invite for a game of DoKo","Hello $PlayerD,\n".$message.$hashD); + mymail($EmailA,"You are invited to a game of DoKo","Hello $PlayerA,\n".$message.$hashA); + mymail($EmailB,"You are invited to a game of DoKo","Hello $PlayerB,\n".$message.$hashB); + mymail($EmailC,"You are invited to a game of DoKo","Hello $PlayerC,\n".$message.$hashC); + mymail($EmailD,"You are invited to a game of DoKo","Hello $PlayerD,\n".$message.$hashD); /* read in random.txt */ if(file_exists("random.txt")) @@ -435,7 +538,7 @@ if( isset($_REQUEST["PlayerA"]) && else die("no random file"); - $randomNR = explode( ":", $random[1] ); + $randomNR = explode( ":", $random[4] ); /* write initial status into file */ $output = fopen("status.txt","w"); @@ -470,6 +573,11 @@ if( isset($_REQUEST["PlayerA"]) && else echo "can't open file for writing"; }; +/* reread file */ +if(file_exists("status.txt")) + $lines = file("status.txt"); + else + die("no file"); /* test if a game is running, else output everything for a new game */ if(sizeof($lines)<2) @@ -493,9 +601,9 @@ if(sizeof($lines)<2) \n"; } } - /* *** * * * * *** @@ -541,56 +646,59 @@ 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"])) && !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 "
\n";
+ display_card($card);
+ echo "
aehm... at the moment please just answer everything with no, still need to implement this
+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
+