I thought I'd share a small fix. We had one game (Onslaught 2) that would get errors when scores were submitted, and I always suspected it was because the scores were large numbers. It turns out the problem was due to the fact that our server OS is 64 bit and the score encoding depends on 32 bit arithmetic. So I made this change:
Find this line:
PHP Code:
$decodescore = $player_score * $vs['randchar1'] ^ $vs['randchar2'];
and put this code after it:
PHP Code:
if (defined('PHP_INT_SIZE') AND (PHP_INT_SIZE == 8) AND ($player_score * $vs['randchar1'])>2147483647)
{
$decodescore &= 0xffffffff;
$decodescore |= ($decodescore & 0x80000000) ? 0xffffffff00000000 : 0;
}
As far as I know Onslaught 2 is the only game we had a problem with, but I thought I'd share it anyway in case someone else is interested.
Edit: I changed the above to simpler code that only runs when needed, and it's been tested better (although I don't know of any problem with what I originally posted).