.Qual servidor ou website você utiliza como base?
Localhost
Qual o motivo deste tópico?
erro
Está surgindo algum erro? Se sim coloque-o aqui.
Você tem o código disponível? Se tiver publique-o aqui:
STATUS.PHP
// connects to server
$socket = @fsockopen($host, $port, $errorCode, $errorString, 1);
$data = 'C:\Users\player\Desktop\Wodbo\Silnik\data';
// if connected then checking statistics
if($socket)
{
// sets 1 second timeout for reading and writing
stream_set_timeout($socket, 1);
// sends packet with request
// 06 - length of packet, 255, 255 is the comamnd identifier, 'info' is a request
fwrite($socket, chr(6).chr(0).chr(255).chr(255).'info');
// reads respond
while (!feof($socket)){
$data .= fread($socket, 128);
}
// closing connection to current server
fclose($socket);
}
return $data;
}
if ($cfg['status_update_interval'] < 60) $cfg['status_update_interval'] = 60;
$modtime = filemtime('status.xml');
if (time() - $modtime > $cfg['status_update_interval'] || $modtime > time()){
$info = getinfo($cfg['server_ip'], $cfg['server_port']);
if (!empty($info)) file_put_contents('status.xml',$info);
}else $info = file_get_contents('status.xml');
if (!empty($info)) {
$infoXML = simplexml_load_string($info);
$up = (int)$infoXML->serverinfo['uptime'];
$online = (int)$infoXML->players['online'];
$max = (int)$infoXML->players['max'];
$h = floor($up/3600);
$up = $up - $h*3600;
$m = floor($up/60);
$up = $up - $m*60;
if ($h < 10) {$h = "0".$h;}
if ($m < 10) {$m = "0".$m;}
echo "<span class=\"online\">Online</span><br/>\n";
echo "<span class=\"players\">Players: <b>$online/$max</b></span><br/>\n";
//echo "<span class=\"monsters\">Monsters: <b>".$infoXML->monsters['total']."</b></span><br/>\n";
echo "<span class=\"uptime\">Uptime: <b>$h:$m</b></span><br/>\n";
} else {
echo "<span class=\"offline\">Offline</span>\n";
}
?>
34 line status.php:
$infoXML = simplexml_load_string($info);
aqui o conteúdo do status.xml (sem inserir o local do mecanismo $ data [status de 3 linhas.php veja acima]) [depois de inserir o local do servidor, o conteúdo abaixo desaparece e é substituído pelo código fornecido (leia abaixo)
<?xml version="1.0"?>
-<tsqp version="1.0">
<serverinfo version="" client="8.0" server="WODBO" url="" location="Poland" port="7171" servername="World of Dragon Ball Online" ip="localhost" uptime="0"/>
<owner email="" name="LEMO"/>
<players peak="0" max="120" online="1"/>
<monsters total="4136"/>
<map name="WODBO" height="" width="" author=""/>
<motd>World of Dragon Ball Online</motd>
</tsqp>
E depois de adicionar o local $ data no status.php VV
// connects to server
$socket = @fsockopen($host, $port, $errorCode, $errorString, 1);
$data = 'C:\Users\player\Desktop\Wodbo\Silnik\data';
o arquivo status.xml altera seu conteúdo para este:
C:\Users\player\Desktop\Wodbo\Silnik\data
Esse erro é exibido na parte superior, se eu não fornecer esse local, o servidor ficará offline ou por algum tempo sairá online do conteúdo status.xml
servidor colocado no xampp (localhost) WODBO
Thanks!
Translate wich translate google
Problema resolvido, a porta incorreta foi especificada em acc no arquivo config.inc.php