X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=689a8ceeb161c98c235ffea3221f58876c2f1b8f;hp=6208038dce9bfb09ddb3fef18139418394938b40;hb=51312acc9682902810edee454471aae1ce59d80c;hpb=320ebe96e21e08d5fad1a4ccbef241d5defd92bc diff --git a/index.php b/index.php index 6208038..689a8ce 100644 --- a/index.php +++ b/index.php @@ -37,6 +37,8 @@ -

Please add 4 names, please make sure that the names are correct!

-
- Name: - Name: - Name: - Name: - - -
-\n"; echo "perhaps the game has been cancled."; - exit(); + exit(); } DB_update_user_timestamp($myid); + + /* get some information from the DB */ + $gameid = DB_get_gameid_by_hash($me); $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) { @@ -190,7 +177,6 @@ else if(isset($_REQUEST["me"])) check_want_to_play($me); DB_set_hand_status_by_hash($me,'init'); break; - case 'init': if( !isset($_REQUEST["in"]) || !isset($_REQUEST["update"])) { @@ -201,8 +187,8 @@ else if(isset($_REQUEST["me"])) { if($_REQUEST["in"] == "no") { - echo "TODO: email everyone that the game has been canceld
"; - /*something like + echo "TODO: email everyone that the game has been canceled.
"; + /*something like need to modify for DB backend for($i=0;$i<4;$i++) { $message = "Hello ".$player[$hash[$i]]["name"].",\n\n". @@ -210,6 +196,7 @@ else if(isset($_REQUEST["me"])) mymail($player[$hash[$i]]["email"],"[DoKo-Debug] the game has been canceled",$message); } */ + /* delete everything from the dB */ DB_cancel_game($me); } else @@ -292,17 +279,17 @@ else if(isset($_REQUEST["me"])) break; case 'play': - case 'gameover': /* gameover and play, so that the tricks are visible for both */ + case 'gameover': /*both entries here, so that the tricks are visible for both in case of 'play' there is a break later that skips the last part*/ display_news(); display_status(); - $gamestatus =DB_get_game_status_by_gameid($gameid); + $gamestatus = DB_get_game_status_by_gameid($gameid); if($gamestatus == 'pre') { echo "you need to wait for the others...
"; break; } - /* get trick ids */ + /* get everythin relevant to display the tricks */ $result = mysql_query("SELECT Hand_Card.card_id as card,". " User.fullname as name,". " Hand.position as position,". @@ -325,17 +312,17 @@ else if(isset($_REQUEST["me"])) $lasttrick = DB_get_max_trickid($gameid); $play = array(); /* needed to calculate winner later */ - $seq=1; - $pos=0; + $seq = 1; + $pos = 0; echo "\n\n"; @@ -473,7 +461,14 @@ else if(isset($_REQUEST["me"])) } if($next==5) $next=1; - echo "TODO: email next player at pos $next
"; + /* email next player */ + $next_hash = DB_get_hash_from_game_and_pos($gameid,$next); + $email = DB_get_email_by_hash($next_hash); + + $message .= "It's your turn now.\n". + "Use this link to play a card: ".$host."?me=".$next_hash."\n\n" ; + mymail($email,"[DoKo-debug] a card has been played",$message); + if($debug) echo "DEBUG: next player
\n"; @@ -548,8 +543,10 @@ else if(isset($_REQUEST["me"])) } exit(); } +/* user status page */ else if(isset($_REQUEST["email"]) && isset($_REQUEST["password"])) { + /* test id and password, should really be done in one step */ $ok=1; $uid = DB_get_userid_by_email($_REQUEST["email"]); if(!$uid) @@ -591,6 +588,7 @@ else if(isset($_REQUEST["me"])) } exit(); } +/* page for registration */ else if(isset($_REQUEST["register"]) ) { echo "TODO: convert timezone into a menu
\n"; @@ -621,6 +619,7 @@ else if(isset($_REQUEST["register"]) )

If 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: +

Login - + - +
- -

+