Ir para conteúdo

Featured Replies

Postado

Então galera eu abri um server de dbo + bleach + naruto.. e tipo no site ta la status: online players online não muda, aí do nada fica status off e mesmo se tiver on nao muda nada os player

abaixo meu status.xml e status.php

Spoiler

<?xml version="1.0"?>
<tsqp version="1.0"><serverinfo uptime="509151" ip="boruto.zapto.org" servername="Dbolegend +naruto+bleach" port="7171" location="Brazil" url="0" server="Jacolos Server (DBKO 0.8)" version="" client="8.0"/><owner name="Legend" email="0"/><players online="23" max="300" peak="23"/><monsters total="6234"/><map name="0" author="0" width="" height=""/><motd>Welcome to Dragon Ball Z The Revolution... Bem Vindos e Bom Jogo</motd></tsqp>
 

Spoiler

<?php 
include ('config.inc.php');
function getinfo($host='localhost',$port=7171){
        // connects to server
        $socket = @fsockopen($host, $port, $errorCode, $errorString, 1);
        $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'] = 1;
$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";
}
?>

 

Editado por blindado3000 (veja o histórico de edições)

  • Respostas 9
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Você explicou totalmente embaralhado, não declarou qual site usa, qual versão do mesmo etc... Tente dar permissão 777 no arquivo que marca os players online, o "serverstatus".

Postado
5 minutos atrás, blindado3000 disse:

Então galera eu abri um server de dbo + bleach + naruto.. e tipo no site ta la status: online players online não muda, aí do nada fica status off e mesmo se tiver on nao muda nada os player

abaixo meu status.xml e status.php

  Mostrar conteúdo oculto

<?xml version="1.0"?>
<tsqp version="1.0"><serverinfo uptime="509151" ip="boruto.zapto.org" servername="Dbolegend +naruto+bleach" port="7171" location="Brazil" url="0" server="Jacolos Server (DBKO 0.8)" version="" client="8.0"/><owner name="Legend" email="0"/><players online="23" max="300" peak="23"/><monsters total="6234"/><map name="0" author="0" width="" height=""/><motd>Welcome to Dragon Ball Z The Revolution... Bem Vindos e Bom Jogo</motd></tsqp>
 

  Ocultar conteúdo

<?php 
include ('config.inc.php');
function getinfo($host='localhost',$port=7171){
        // connects to server
        $socket = @fsockopen($host, $port, $errorCode, $errorString, 1);
        $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'] = 1;
$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";
}
?>

 

 

 

 

 

Olá, o seu site está offline aqui pra mim, não consigo acessá-lo para ver como está.

Editado por strakh (veja o histórico de edições)

mOw9OYy.png

[Designer] / [Developer] 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo