如何添加“假的额外在线用户”。让我说我有真正的30,但我需要额外30假。任何想法如何调整它?
function GetLoggedInCount()
{
$cachefile = './cache/playercount.txt';
$db = $this->database[ADB];
if (!file_exists($cachefile) || (time() - 300) >= filemtime($cachefile))
{
$count = 0;
$num_rows = $db->doQuery('SELECT COUNT(strCharID) as pCount FROM CURRENTUSER');
if ($num_rows == 1)
{
$row = $db->doRead();
$count = $row['pCount'];
$fp = fopen($cachefile, 'w');
fwrite($fp, $count);
fclose($fp);
}
return $count;
}
else if ((time() - 300) < filemtime($cachefile))
{
$fp = fopen($cachefile, 'r');
$content = fread($fp, filesize($cachefile));
fclose($fp);
return intval($content);
}
}