=mktime()-5) {
// Check status every 3 seconds until bot updates
while($info['status']==3) {
sleep(3);
$handle = mysql_query("SELECT * FROM w_lookup WHERE name='".$_GET['name']."' AND dim='".$_GET['dim']."' LIMIT 1");
$info = mysql_fetch_array($handle);
$info['status'] = 0;
}
switch($info['status']) {
case 0:
// Return our code for offline player
$c = 'Offline';
break;
case 1:
// Return our code for online player
$c = 'Online';
break;
default:
// Return error if bot returns an unknown status ($info['status'] != 0|1|3)
$c = 'Error Unknown status ('.$info['status'].') returned';
}
}
// Return error if bot hasn't updated within 5 seconds
else $c = 'Status unavailable at this time. Err (Bot failed to update)';
// Return error if an entry for that player has not been added to our database via our main script
} else $c = 'Status unavailable at this time. Err (No player '.$_GET['name'].' in DB)';
// Send our response back to main script
echo $c;
?>