• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Błąd statusu servera

Lemoo

New Member
Joined
Oct 17, 2018
Messages
5
Reaction score
0
Witam mam problem ze statusem ots'a Ots odpalony a na acc wywala błąd(patrz ss)
Bez tytułu.jpgpisze że w 34 linijce

tu wklejam zawartość status.php:
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 linijka status.php :
Code:
$infoXML = simplexml_load_string($info);

tutaj zawartość status.xml(bez podaniej lokalizacji sinika $data[3 linijka status.php patrz wyżej])[po podaniu lokalizacji servera zawartość poniżej znika i zamienia ją kod podany(czytaj niżej)

PHP:
<?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>

A po dodaniu lokalizacji $data w status.php VV

Code:
// connects to server
        $socket = @fsockopen($host, $port, $errorCode, $errorString, 1);
        $data = 'C:\Users\player\Desktop\Wodbo\Silnik\data';

plik status.xml zmienia swoją zawartość na to:
Code:
C:\Users\player\Desktop\Wodbo\Silnik\data

Czyli na samą lokalizacje silnika z folderem data

serwer postawiony na xampie(localhost)
 
Last edited:
Back
Top