PDA

View Full Version : Server load disable arcade?


Cancorp
11-12-2005, 09:39 PM
Ok, I installed the server load disable search hack and I was wondering how to modify it to do the same with the arcade?

This is what I came up with, but it doesn't work. No matter the server load it just disables the arcade (I've edited the server load number in the code from 1 to 1000 and it makes no difference and at the time our server load was averaging 6). Being that I am no coder, I'm not surprised :D

Anyone care to point me in the right direction?



// server too busy?
$toobusy = false;
if (@file_exists('/proc/loadavg') AND $filestuff = @file_get_contents('/proc/loadavg'))
{
$loadavg = explode(' ', $filestuff);
if (trim($loadavg[0]) > 15)
{
$toobusy = true;
}
}

if ($arcadegeneral['active'] == 1 || $toobusy)
{
eval(print_standard_error('error_arcadedisabled')) ;
}