I added this to the bottom of my config.php file:
- Code: Select all
$addon_conf['ArmorySync']['Timeout'] = 45; //This is the maximum number of seconds we will try to get stuff from the armory.
In functions.synch.php I changed the code in synchPlayers to this:
- Code: Select all
function synchPlayers($realm, $players) {
global $wowdb, $roster_conf, $addon_conf;
print $wowdb->getMessages();
$wowdb->resetMessages();
if (empty($realm)) {
$realm = $roster_conf['server_name'];
}
if (empty($players) || !is_array($players)) {
//Throw Error
print "CRITICAL ERROR: No Player Given or Empty Array.<br>\n";
return;
}
$startTime = time();
foreach($players as $player) {
if ((time() - $startTime) <= $addon_conf['ArmorySync']['Timeout'])
{
$playerStartTime = time();
synchPlayer(null, $player, false);
print $player . " synched: " . (time() - $playerStartTime) . " seconds. Total runtime: " . (time() - $startTime) . " seconds.<br>\n";
flush();
}
}
displayMessages($wowdb->getMessages());
displayErrors($wowdb->getErrors());
}
Basically just check to see if I have gone over the timeout limit and stop. Might be a better way to code it, but this works.