X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=b2c4fb08b7d841e876fd0e617df38843c3bd58a3;hp=0e16292abd5fb4459152e7b507531260ff21d4f6;hb=981c12ce5d5aaf606584a4ab59054316d2b6c6c2;hpb=09515348107d9aab7823a12d31b082a2ebb75555 diff --git a/include/game.php b/include/game.php index 0e16292..b2c4fb0 100644 --- a/include/game.php +++ b/include/game.php @@ -5,6 +5,14 @@ if(!isset($HOST)) exit; +if(!myisset("me")) + { + echo "Hmm, you really shouldn't mess with the urls.
\n"; + output_footer(); + DB_close(); + exit(); + } + $me = $_REQUEST["me"]; /* test for valid ID */ @@ -70,7 +78,7 @@ for($i=1;$i<5;$i++) }; /* put everyting in a form */ -echo "
\n"; +echo "\n"; /* output game */ @@ -86,7 +94,7 @@ if($session) if($hash == $me) echo "$i \n"; else - echo "$i \n"; + echo "$i \n"; $i++; } echo "\n"; @@ -174,7 +182,7 @@ switch($mystatus) DB_set_player_by_gameid($gameid,$who); $message = "It's your turn now in game ".DB_format_gameid($gameid).".\n". - "Use this link to go the game: ".$HOST.$INDEX."?me=".$hash."\n\n" ; + "Use this link to go the game: ".$HOST.$INDEX."?action=game&me=".$hash."\n\n" ; mymail($email,$EmailName."ready, set, go... (game ".DB_format_gameid($gameid).") ",$message); */ } @@ -208,7 +216,7 @@ switch($mystatus) * unless a user tries to cheat ;) * can also happen if user reloads the page! */ - echo "

You need to answer the questions.

"; + echo "

You need to answer the questions.

"; DB_set_hand_status_by_hash($me,'init'); } else @@ -223,7 +231,7 @@ switch($mystatus) if($Nvorbehalt>1) { echo "

You selected more than one vorbehalt, please go back ". - "and answer the question again.

"; + "and answer the question again.

"; DB_set_hand_status_by_hash($me,'init'); } else @@ -274,7 +282,7 @@ switch($mystatus) DB_set_sickness_by_hash($me,"nines"); } - echo " Ok, done with checking, please go to the next step of the setup.

"; + echo " Ok, done with checking, please go to the next step of the setup.

"; /* move on to the next stage*/ DB_set_hand_status_by_hash($me,'poverty'); @@ -304,7 +312,7 @@ switch($mystatus) { $message = "Everyone finish the questionary in game ".DB_format_gameid($gameid).", ". "please visit this link now to continue: \n". - " ".$HOST.$INDEX."?me=".$userhash."\n\n" ; + " ".$HOST.$INDEX."?action=game&me=".$userhash."\n\n" ; mymail($To,$EmailName." finished setup in game ".DB_format_gameid($gameid),$message); } }; @@ -513,7 +521,7 @@ switch($mystatus) DB_set_party_by_hash($me,"contra"); echo "Whoever will make the first trick will be on the re team.
\n"; - echo " Ok, the game can start now, please finish the setup.
"; + echo " Ok, the game can start now, please finish the setup.
"; DB_set_hand_status_by_hash($me,'play'); break; @@ -576,7 +584,7 @@ switch($mystatus) DB_set_player_by_gameid($gameid,$userid); $message = "Someone has poverty, it's your turn to decide, if you want to take the trump. Please visit:". - " ".$HOST.$INDEX."?me=".$userhash."\n\n" ; + " ".$HOST.$INDEX."?action=game&me=".$userhash."\n\n" ; mymail($To,$EmailName." poverty (game ".DB_format_gameid($gameid).")",$message); } @@ -658,7 +666,7 @@ switch($mystatus) $message = "Someone has poverty, it's your turn to decide, ". "if you want to take the trump. Please visit:". - " ".$HOST.$INDEX."?me=".$userhash."\n\n" ; + " ".$HOST.$INDEX."?action=game&me=".$userhash."\n\n" ; mymail($To,$EmailName." poverty (game ".DB_format_gameid($gameid).")",$message); } } @@ -732,10 +740,10 @@ switch($mystatus) /* count trump */ if($nrtrump<4) echo "Player $name has $nrtrump trump. Do you want to take them?". - "yes
\n"; + "yes
\n"; } } - echo "No,way I take those trump...
\n"; + echo "No,way I take those trump...
\n"; echo "
\n"; echo "Your cards are:
\n"; @@ -803,11 +811,11 @@ switch($mystatus) { /* email startplayer) */ $message = "It's your turn now in game ".DB_format_gameid($gameid).".\n". - "Use this link to play a card: ".$HOST.$INDEX."?me=".$hash."\n\n" ; + "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$hash."\n\n" ; mymail($email,$EmailName."ready, set, go... (game ".DB_format_gameid($gameid).") ",$message); } else - echo " Please, start the game.
"; + echo " Please, start the game.
"; } else echo "\n
"; @@ -1260,7 +1268,7 @@ switch($mystatus) $message = "A card has been played in game ".DB_format_gameid($gameid).".\n\n". "It's your turn now.\n". - "Use this link to play a card: ".$HOST.$INDEX."?me=".$next_hash."\n\n" ; + "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$next_hash."\n\n" ; if( DB_get_email_pref_by_uid($who)!="emailaddict" ) mymail($email,$EmailName."a card has been played in game ".DB_format_gameid($gameid),$message); } @@ -1526,7 +1534,7 @@ switch($mystatus) $hash = DB_get_hash_from_gameid_and_userid($gameid,$user); $link = "Use this link to have a look at game ".DB_format_gameid($gameid).": ". - $HOST.$INDEX."?me=".$hash."\n\n" ; + $HOST.$INDEX."?action=game&me=".$hash."\n\n" ; if( DB_get_email_pref_by_uid($user) != "emailaddict" ) mymail($To,$EmailName."game over (game ".DB_format_gameid($gameid).") part 2(2)",$link); } @@ -1719,12 +1727,19 @@ switch($mystatus) echo "
"; } - echo "\n"; + echo "\n
\n"; + + $session = DB_get_session_by_gameid($gameid); + $score = generate_score_table($session); + echo $score; + + echo "
\n"; + + echo "
\n"; if($mystatus=='gameover' && DB_get_game_status_by_gameid($gameid)=='gameover' ) { - echo "
\n"; $session = DB_get_session_by_gameid($gameid); $result = mysql_query("SELECT id,create_date FROM Game". @@ -1748,15 +1763,7 @@ switch($mystatus) } } - $session = DB_get_session_by_gameid($gameid); - $score = generate_score_table($session); - - // if(size_of($score)>30) - echo $score; - - echo "\n"; - echo "\n"; output_footer(); DB_close(); exit();