X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=8b91b69c1623cc0faaaa87c5e5a402e452a20a1c;hp=687f15dc5b58d86a6ee218cb4f720b2b1c1135f8;hb=223b9a88ef79e40f039f215e0a0ef51c1023d9b5;hpb=a7119a6c9ee1ecbc43edb4164b03b1d8a97fd107
diff --git a/index.php b/index.php
index 687f15d..8b91b69 100644
--- a/index.php
+++ b/index.php
@@ -33,6 +33,7 @@ if(DB_open()<0)
exit();
}
+/* done major error checking, output header of HTML page */
output_header();
/* check if we want to start a new game */
@@ -61,6 +62,7 @@ if(myisset("new"))
{
echo "couldn't find one of the names, please start a new game";
output_footer();
+ DB_close();
exit();
}
@@ -79,6 +81,7 @@ if(myisset("new"))
{
echo "Error defining ruleset: $ruleset";
output_footer();
+ DB_close();
exit();
};
@@ -171,6 +174,7 @@ else if(myisset("cancle","me"))
echo "Can't find you in the database, please check the url.
\n";
echo "perhaps the game has been cancled, check by login in here.";
output_footer();
+ DB_close();
exit();
}
@@ -192,7 +196,7 @@ else if(myisset("cancle","me"))
foreach($userids as $user)
{
$To = DB_get_email_by_userid($user);
- mymail($To,$EmailName."game cancled (timed out)",$message);
+ mymail($To,$EmailName."game $gameid cancled (timed out)",$message);
}
/* delete everything from the dB */
@@ -216,6 +220,7 @@ else if(myisset("me"))
echo "Can't find you in the database, please check the url.
\n";
echo "perhaps the game has been cancled, check by login in here.";
output_footer();
+ DB_close();
exit();
}
@@ -230,18 +235,8 @@ else if(myisset("me"))
$myhand = DB_get_handid_by_hash($me);
/* get prefs and save them */
- $result = mysql_query("SELECT value from User_Prefs".
- " WHERE user_id='$myid' AND pref_key='cardset'" );
- $r = mysql_fetch_array($result,MYSQL_NUM);
- if($r)
- {
- if($r[0]=="germancards" && (time()-strtotime( "2009-12-31 23:59:59")<0) ) /* licence only valid until then */
- $PREF["cardset"]="altenburg";
- else
- $PREF["cardset"]="english";
- }
- else
- $PREF["cardset"]="english";
+ DB_get_PREF($myid);
+ /* end set pref */
/* get rule set for this game */
@@ -252,7 +247,9 @@ else if(myisset("me"))
$RULES["dullen"] = $r[2];
$RULES["schweinchen"] = $r[3];
-
+ $RULES["call"] = "1st-own-card";
+
+
/* get some infos about the game */
$gametype = DB_get_gametype_by_gameid($gameid);
$gamestatus = DB_get_game_status_by_gameid($gameid);
@@ -325,7 +322,7 @@ else if(myisset("me"))
foreach($userids as $user)
{
$To = DB_get_email_by_userid($user);
- mymail($To,$EmailName."game canceled",$message);
+ mymail($To,$EmailName."game $gameid canceled",$message);
}
/* delete everything from the dB */
@@ -342,7 +339,7 @@ else if(myisset("me"))
display_card($card,$PREF["cardset"]);
echo "