From: arun Date: Wed, 22 Nov 2006 10:09:28 +0000 (+0000) Subject: added link to the wiki for debugging X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=9197d1d5144a1d281db321fbaa523172c88da07e;ds=sidebyside added link to the wiki for debugging --- diff --git a/index.php b/index.php index 2eb0cf7..a2366ed 100644 --- a/index.php +++ b/index.php @@ -9,13 +9,13 @@

Welcome to E-Doko

-

"; + echo "\"".card_to_name($card)."\"\n"; else - echo "\"".card_to_name($card-1)."\""; + echo "\"".card_to_name($card-1)."\"\n"; return; } function display_link_card($card,$me) { if( $card/2 - (int)($card/2) == 0.5) - echo "\"".card_to_name($card)."\""; + echo "\"".card_to_name($card)."\"\n"; else - echo "\"".card_to_name($card-1)."\""; + echo "\"".card_to_name($card-1)."\"\n"; return; } @@ -375,6 +375,8 @@ function save_status() return; } +echo "

If you find bugs, please list them in the wiki

\n"; + $history=array(); /* check for status file and read it, if possible */ @@ -548,7 +550,7 @@ if(sizeof($lines)<2) else if( (!isset($_REQUEST["in"])|| !isset($_REQUEST["update"])) && !ereg("i",$player[$b]["option"])) { echo "go back to "; - echo " here and fill out the form
"; + echo " here and fill out the form
\n"; } else { /* show the hand */ @@ -579,7 +581,7 @@ if(sizeof($lines)<2) $mycards = explode(";",$allcards); sort($mycards); - echo "your cards are
"; + echo "your cards are
\n"; foreach($mycards as $card) { display_card($card); @@ -608,33 +610,33 @@ if(sizeof($lines)<2) if(check_wedding($player[$b]["cards"])) { echo " yes"; - echo " no
"; + echo " no
\n"; } else { - echo " no
"; + echo " no
\n"; }; echo "do you have poverty?"; if(count_trump($player[$b]["cards"])<4) { echo " yes"; - echo " no
"; + echo " no
\n"; } else { - echo " no
"; + echo " no
\n"; }; echo "do you have too many nines?"; if(count_nines($player[$b]["cards"])>4) { echo " yes"; - echo " no
"; + echo " no
\n"; } else { - echo " no
"; + echo " no
\n"; }; echo "\n"; @@ -651,7 +653,7 @@ if(sizeof($lines)<2) if(!isset($_REQUEST["solo"])|| !isset($_REQUEST["wedding"])|| !isset($_REQUEST["poverty"]) || !isset($_REQUEST["nines"]) ) { echo "go back to "; - echo " here and fill out the form
"; + echo " here and fill out the form
\n"; } else if( ereg("s",$player[$c]["option"]) && $game["init"]<4 ) { @@ -688,17 +690,17 @@ if(sizeof($lines)<2) } else if($_REQUEST["wedding"] == "yes") { - echo "wedding was chosen
"; + echo "wedding was chosen
\n"; $player[$c]["option"].="W"; } else if($_REQUEST["poverty"] == "yes") { - echo "poverty was chosen
"; + echo "poverty was chosen
\n"; $player[$c]["option"].="P"; } else if($_REQUEST["nines"] == "yes") { - echo "nines was chosen
"; + echo "nines was chosen
\n"; $player[$c]["option"].="N"; } @@ -746,8 +748,8 @@ if(sizeof($lines)<2) { if(!isset($_REQUEST["recovery"])) { - echo "a game is in progress, but you are not playing.
"; - echo "In case you are playing, but lost your email or can't access the game anymore, please input your email here:
"; + echo "a game is in progress, but you are not playing.
\n"; + echo "In case you are playing, but lost your email or can't access the game anymore, please input your email here:
\n"; ?>
recorvery:
@@ -779,16 +781,16 @@ if(sizeof($lines)<2) { /* $me is set */ $me = $_REQUEST["me"]; - echo "game in progress and you are in it
"; + echo "game in progress and you are in it
\n"; if($game["solo-who"]>=0) - echo $player[$hash[$game["solo-who"]]]["name"]." is playing a ".$game["solo-what"]." solo!
"; + echo $player[$hash[$game["solo-who"]]]["name"]." is playing a ".$game["solo-what"]." solo!
\n"; else if($game["wedding"]>=0) - echo $player[$hash[$game["wedding"]]]["name"]." is playing a wedding!
"; + echo $player[$hash[$game["wedding"]]]["name"]." is playing a wedding!
\n"; /* show history */ foreach($history as $play) { - echo "
"; + echo "
\n"; $trick = explode(":",$play); @@ -878,12 +880,12 @@ if(sizeof($lines)<2) mymail($player[$hash[$i]]["email"],"[DoKo-debug] a card has been played",$message); if($debug) - echo " next player
"; + echo " next player
\n"; } } } else - echo "seems like you don't have that card
"; + echo "seems like you don't have that card
\n"; } @@ -903,11 +905,11 @@ if(sizeof($lines)<2) $points += card_value($c); } $player[$hash[$win]]["points"]+=$points; - echo "
".$player[$hash[$win]]["name"]." won: $points Points
"; + echo "
\n ".$player[$hash[$win]]["name"]." won: $points Points
\n"; save_status(); }; /* end if win is set */ - echo "
"; + echo "
\n"; $tmp = explode(":",$history[sizeof($history)-1]); @@ -934,18 +936,18 @@ who won? $next=$tmp[0]; if($debug) - echo "DEBUG: the next move is for the next player
"; + echo "DEBUG: the next move is for the next player
\n"; if(strlen(trim($player[$me]["cards"]))==0) { - echo "
game over, count points
"; + echo "
game over, count points
\n"; for($i=0;$i<4;$i++) { - echo $player[$hash[$i]]["name"]." got ".$player[$hash[$i]]["points"]."
"; + echo $player[$hash[$i]]["name"]." got ".$player[$hash[$i]]["points"]."
\n"; } } } - echo "
"; + echo "
\n"; } /* end check for winner */ /* do we still have cards? display them */ @@ -956,11 +958,12 @@ who won? sort($mycards); + echo "

\n"; /* is it our turn? */ if($hash[$next]==$me) { - echo "ITS YOUR TURN
"; - echo "your cards are:
"; + echo "ITS YOUR TURN
\n"; + echo "your cards are:
\n"; foreach($mycards as $card) { display_link_card($card,$me); @@ -968,13 +971,13 @@ who won? } else { /* not our turn, just show the hand */ - echo "your cards are:
"; + echo "your cards are:
\n"; foreach($mycards as $card) { display_card($card); } } - echo "
\n"; + echo "

\n"; } } } @@ -982,6 +985,5 @@ who won? } ?> -