Please add 4 names, please make sure that the names are correct!
-
-\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 +140,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 +150,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 +159,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 +242,43 @@ else if(isset($_REQUEST["me"]))
break;
case 'play':
- case 'gameover': /* gameover and play, so that the tricks are visible for both */
- display_news();
+ 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 local time */
+ echo "
\n"; /* end div table, end li table */
}
}
- if($seq!=4)
+
+ if($seq!=4 && $trickNR>1)
echo " \n \n"; /* end div table, end li table */
echo "
\n";
@@ -473,7 +450,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";
@@ -533,7 +517,7 @@ else if(isset($_REQUEST["me"]))
$names = DB_get_all_names_by_gameid($gameid);
echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
- echo "
-
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:
-