IVIaniac
02-29-2008, 01:42 PM
Come on... this is been bugging me forever, when there is a turn change, you get more rage than you should have briefly... Then you have a cron job that goes around and sets anyone with more rage than max to only have there max.... That is a waste of resources. If you want help making your turn change happen smoother... Get a hold of me, I could optimize that a lot more.
But until then, here is a freebie to fix the more than max rage.
In the code section, or include that displays the rage to the user... Just take care of it there real quick... It wouldn't matter if people had more than max rage without seeing it. So you can dump that cron job, and simply put a bit of code like this to adjust there rage so they aren't getting more than there max. If you want more advice, and full pages of code, get a hold of me, I could probaly get rid of a lot of your cron jobs, reducing "turn change lag". Leading to less exploits, as 70% of the exploits have been due to turn change.
if($rage >= $maxrage){
mysql_query("UPDATE `users` SET `turns` = '$maxrage' WHERE `id` = '".$_SESSION['id']."' LIMIT 1") or die(mysql_error());
$user['rage'] = "<b class=green10>".number_format($menergy)."</b>";
}
But until then, here is a freebie to fix the more than max rage.
In the code section, or include that displays the rage to the user... Just take care of it there real quick... It wouldn't matter if people had more than max rage without seeing it. So you can dump that cron job, and simply put a bit of code like this to adjust there rage so they aren't getting more than there max. If you want more advice, and full pages of code, get a hold of me, I could probaly get rid of a lot of your cron jobs, reducing "turn change lag". Leading to less exploits, as 70% of the exploits have been due to turn change.
if($rage >= $maxrage){
mysql_query("UPDATE `users` SET `turns` = '$maxrage' WHERE `id` = '".$_SESSION['id']."' LIMIT 1") or die(mysql_error());
$user['rage'] = "<b class=green10>".number_format($menergy)."</b>";
}