X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=605a94b42963030fbf6dfc1932e05b51c938aaff;hp=f4e323ef320399200e767b22d88399af922c4baf;hb=88aaf2c34d0b3cc7eff994955a144a8d27b67c7a;hpb=ec0c90f663240dcc2568741a1c3af0acc716bf25;ds=sidebyside diff --git a/index.php b/index.php index f4e323e..605a94b 100644 --- a/index.php +++ b/index.php @@ -1,448 +1,96 @@ - - -
-(please hit shift-reload:))
",$message); - echo "If you find bugs, please list them in the wiki.
\n"; - -echo "Names that are underlined have a comment, which you can access by hovering over the name with your mouse ;)
\n"; -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) - { /* 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 "
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
- - \n"; - } - } - } - - if(isset($_REQUEST["c"])) - { - $c = $_REQUEST["c"]; - - - if( ereg("s",$player[$c]["option"]) && $game["init"]<4 ) - { /* the player already filled out everything */ - echo "just wait for the game to start
\n"; - } - else if(!isset($_REQUEST["solo"]) || - !isset($_REQUEST["wedding"]) || - !isset($_REQUEST["poverty"]) || - !isset($_REQUEST["nines"]) ) - {/* player still needs to fill out the form */ - echo "go back to "; - echo " here and fill out the formThe game can start now, it's your turn, please use this link to play a card.
\n"; - } - else if($game["init"]==4) - { - $message = "The game can start now, it's your turn, please use this link to play a card:\n". - $host."?me=".$hash[$game["startplayer"]]."\n"; - mymail($player[$hash[$game["startplayer"]]]["email"],"[DoKo-debug] let's go",$message); - echo "The game has started. An email has been sent out to the first player.
\n"; - } - else - { - echo "You're in. Once everyone has filled out the form, ". - "the game will start and you'll get an eamil on your turn.
\n"; - } - } - } - /* END SETUP */ - - /* the game */ - if($game["init"]==4) - { - /* check for sickness, only would need to do this on the first trick really...*/ - /***** someone has 5 nines and no one is playing solo => cancel game */ - if($game["nines"]>=0 && $game["solo-who"]<0) - { - $message = $player[$hash[$game["poverty"]]]["nines"]." has more than 4 nines. Game aborted!\n"; - for($i=0;$i<4;$i++) - mymail($player[$hash[$i]]["email"],"[DoKo-debug] the game has been canceled",$message); - - $output = fopen("status.txt","w"); - if($output) - fclose($output); - else - echo "problem opening file"; - }; - - /* who is requesting this*/ - if(!isset($_REQUEST["me"])) - { - if(!isset($_REQUEST["recovery"])) - { - echo "A game is in progress and kibitzing is not allowed. Sorry!.An email with the game information has been sent.
\n"; - } - else - { - echo "can't find this email address, sorry.
\n"; - }; - } /* end recovery */ + { + $message = "Hello ".$player[$hash[$i]]["name"].",\n\n". + "the game has been canceled due to the request of one of the players.\n"; + mymail($player[$hash[$i]]["email"],"[DoKo-Debug] the game has been canceled",$message); + } + */ + /* delete everything from the dB */ + DB_cancel_game($me); + } + else + { + echo "thanks for joining the game... please scroll down"; + echo "TODO: make this page niceryour cards are:
\n";
+ foreach($mycards as $card)
+ display_card($card);
+ echo "
$name | ".date("Y-m-d H:i:s")." |
\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 "
these are the games you are playing in:
\n";
+ $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status<>'gameover'" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
+ echo "game #".$r[1]."
";
+ echo "
and these are your games that are already done:
\n";
+ $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
+ echo "game #".$r[1]."
";
+ 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 "sorry email and password don't match