}
-function create_array_of_random_numbers()
+function create_array_of_random_numbers($useridA,$useridB,$useridC,$useridD)
{
global $debug;
}
else
{
+ /* check if we can find a game were non of the player was involved and return
+ * cards insted
+ */
+ $userstr = implode(",",array($useridA,$useridB,$useridC,$useridD));
+ $randomnumbers = DB_get_unused_randomnumbers($userstr);
+ $randomnumbers = explode(":",$randomnumbers);
+
+ if(sizeof($randomnumbers)==48)
+ return $randomnumbers;
+
+ /* need to create new numbers */
for($i=0;$i<48;$i++)
$r[$i]=$i+1;
- shuffle($r);
+ shuffle($r);
};
return $r;
$gameid = DB_get_gameid_by_hash($hash);
$gametype = DB_get_gametype_by_gameid($gameid);
- $NRcards = count(DB_get_hand($me));
+ $NRcards = count(DB_get_hand($hash));
$NRallcards = 0;
for ($i=1;$i<5;$i++)
return 1;
break;
case "5th-card":
- if( 27+4*($what/30)) <= $NRallcards + $offset*4)
+ if( 27+4*($what/30) <= $NRallcards + $offset*4)
return 1;
break;
case "9-cards":