X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=d13e3bbbdab3a29e2ab519128a200159d1b78f5e;hp=a53a23c3b163d789c08df73474303527911f82ae;hb=c997188d74716ef29f82da903435b95eec736d79;hpb=6ea17e122f89f4175a6be53f6573c9957926376f diff --git a/index.php b/index.php index a53a23c..d13e3bb 100644 --- a/index.php +++ b/index.php @@ -6,431 +6,130 @@
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"; +/* end header */ -$history=array(); +/***************** M A I N **************************/ -/* check for status file and read it, if possible */ +/* check if we want to start a new game */ +if(isset($_REQUEST["new"])) + { +?> +no game in progress, please input 4 names and email addresses, please make sure that the addresses are correct!
+ +\n"; + echo "perhaps the game has been cancled."; + exit(); + } + + $myname = DB_get_name_by_hash($me); + $mystatus = DB_get_status_by_hash($me); - /* write initial status into file */ - $output = fopen("status.txt","w"); - if ($output) + switch($mystatus) { - fwrite($output, "$hashA:$PlayerA:$EmailA:::" ); - for($i=0;$i<11;$i++) - fwrite($output,"$randomNR[$i];" ); - fwrite($output,"$randomNR[11]:" ); $i++; - fwrite($output,"\n"); + case 'start': + check_want_to_play($me); + DB_set_hand_status_by_hash($me,'init'); + break; - fwrite($output, "$hashB:$PlayerB:$EmailB:::" ); - for(;$i<23;$i++) - fwrite($output,"$randomNR[$i];" ); - fwrite($output,"$randomNR[23]:" ); $i++; - fwrite($output,"\n"); + case 'init': + if( !isset($_REQUEST["in"]) || !isset($_REQUEST["update"])) + { + DB_set_hand_status_by_hash($me,'start'); + echo "you need to answer both question"; + } + else + { + if($_REQUEST["in"] == "no") + { + echo "TODO: email everyone that the game has been canceldyour cards are:
\n";
+ foreach($mycards as $card)
+ display_card($card);
+ echo "
no game in progress, please input 4 names and email addresses, please make sure that the addresses are correct!
- + - \n"; - } - } - -/* *** - * * * - * *** - * * * - * *** - * yes? email him his hand, ask for solo, poverty, email every move or every card? - */ - if(isset($_REQUEST["b"])) - { - $b=$_REQUEST["b"]; - - if( ereg("s",$player[$b]["option"]) && $game["init"]<4) - { - echo "just wait for the game to start"; - } - else if( (!isset($_REQUEST["in"])|| !isset($_REQUEST["update"])) && !ereg("i",$player[$b]["option"])) - { - echo "go back to "; - echo " here and fill out the formaehm... 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"; - } - } - } - if(isset($_REQUEST["c"])) - { - $c=$_REQUEST["c"]; - - if(!isset($_REQUEST["solo"])|| !isset($_REQUEST["wedding"])|| !isset($_REQUEST["poverty"]) || !isset($_REQUEST["nines"]) ) - { - echo "go back to "; - echo " here and fill out the formIf you want to play a game of Doppelkopf, you found the right place ;)
+ Please register, in case you haven't done yet
+ or login with you email-address or name and password here:
+
\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);
- }
- }
- else
- { /* not our turn, just show the hand */
- echo "your cards are:
\n";
- foreach($mycards as $card)
- {
- display_card($card);
- }
- }
- echo "