To: $To Subject: $Subject $message ";
+ {
+ str_replace("\n"," ",$message);
+ echo " To: $To Subject: $Subject $message ";
+ }
else
mail($To,$Subject,$message);
return;
}
+function parse_status()
+{
+ global $game,$history,$player,$hash,$lines;
+
+ $game["init"] = 0;
+ $game["solo-who"] = -1;
+ $game["solo-what"] = "todo";
+ $game["wedding"] = -1;
+ $game["poverty"] = -1;
+ $game["nines"] = -1;
+ $game["startplayer"] = 0;
+
+ for($i=0;$i<4;$i++)
+ {
+ $tmp = explode( ":",$lines[$i]);
+ $hash[$i] = $tmp[0];
+ $player[$tmp[0]]["number"] = $i;
+ $player[$tmp[0]]["hash"] = $tmp[0];
+ $player[$tmp[0]]["name"] = $tmp[1];
+ $player[$tmp[0]]["email"] = $tmp[2];
+ $player[$tmp[0]]["option"] = $tmp[3];
+ $player[$tmp[0]]["points"] = $tmp[4];
+ $player[$tmp[0]]["cards"] = $tmp[5];
+ if(ereg("s",$tmp[3])) $game["init"]++;
+ if(ereg("P",$tmp[3])) $game["poverty"] = $i;
+ if(ereg("N",$tmp[3])) $game["nines"] = $i;
+ if(ereg("W",$tmp[3])) $game["wedding"] = $i;
+ if(ereg("[OSQJCAH]",$tmp[3]) && ($game["solo-who"]<0) )
+ {
+ $game["solo-who"] = $i;
+ $game["startplayer"] = $i;
+ }
+
+ }
+ /* save the game history */
+ for($i=4;$i here and fill out the form ";
@@ -471,9 +552,9 @@ if(sizeof($lines)<2)
{
for($i=0;$i<4;$i++)
{
- echo "Hello ".$player[$hash[$i]]["name"].",\n";
- echo "\n";
- echo "the game has been cancled due to the request of one of the players.\n";
+ $message = "Hello ".$player[$hash[$i]]["name"].",\n\n".
+ "the game has been cancled due to the request of one of the players.\n";
+ mymail($player[$hash[$i]]["email"],"[DoKo] the game has been cancled",$message);
}
$output = fopen("status.txt","w");
if($output)
@@ -501,21 +582,57 @@ if(sizeof($lines)<2)
}
echo " \n";
?>
+
aehm... at the moment please just answer everything with no, still need to implement this
the next player ";
+
+ if($debug)
+ echo "DEBUG: the next move is for the next player ";
+
if(strlen(trim($player[$me]["cards"]))==0)
{
echo " game over, count points ";
- for($i=0;$i>4;$i++)
+ for($i=0;$i<4;$i++)
{
echo $player[$hash[$i]]["name"]." got ".$player[$hash[$i]]["points"]." ";
}