X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=8385576502c82c412843606ce9a0e4f96c3e067c;hp=4863b29ed95c92e5197e30623db5513c9318ea03;hb=f0bbdae184fed051df8ae0e93a41e88c9442a7db;hpb=2d91a24aa681266bff36810746de016e2804989a diff --git a/index.php b/index.php index 4863b29..8385576 100644 --- a/index.php +++ b/index.php @@ -6,431 +6,133 @@
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"])) + { +?> +Please add 4 names, please make sure that the names are correct!
+ +\n"; + echo "perhaps the game has been cancled."; + exit(); + } + + DB_update_user_timestamp($myid); + $myname = DB_get_name_by_hash($me); + $mystatus = DB_get_status_by_hash($me); + + /* get game id */ + $gameid = DB_get_gameid_by_hash($me); + + switch($mystatus) + { + case 'start': + check_want_to_play($me); + DB_set_hand_status_by_hash($me,'init'); + break; + + 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 "
registered players:
\n";
+ foreach ($names as $name)
+ echo "$name
\n";
+ echo "
Want to start a new game? remember 4 names from the list above and visit ". + "this page.
"; } else - echo "can't open file for writing"; - }; - -/* test if a game is running, else output everything for a new game */ -if(sizeof($lines)<2) + { + echo "sorry email and password don't matchno 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 "