PHP-Fusion Mods
Navigacija
Apsauga
Apsauga Neleista registracija: 29011
Šiandien: 33
Prisijungę nariai
» Svečių: 12
» Narių: 0

» Viso narių: 10,232
» Naujausias: EdvinasG1337

Prisijungimų istorija:
tabux 5 Dienos
EdvinasG1337nepamenu
rolandas94nepamenu
Zbigniew@nepamenu
Edis2nepamenu
klubogerbejasnepamenu
Miskinisnepamenu
mast3rnepamenu
N1nt3ndnepamenu
Matze1987nepamenu
Piter_NSnepamenu
MariukasRnepamenu
Pask. modai
Prisijungti
Vardas

Slaptažodis



Dar ne narys?
Registruotis.

Pamiršai slaptažodį?
Prašyk naujo!.

Naujausi prašymai
[L] testas
Narių apklausa
Ar dar kuriate tinklalapius?

Ne
Ne
0% [0 Balsai]

Taip
Taip
88% [7 Balsai]

Naudojuosi socialiniais tinklais
Naudojuosi socialiniais tinklais
13% [1 Balsas]

Balsai: 8
Kad galėtum balsuoti, turi prisijungti.
Pradėta: 2022-05-29 19:54
Shoutbox
You must login to post a message.

2024-03-07 22:13
Oj Tabux… apkabinčiau už tą moderatorių 😁

2024-02-22 17:40
Šypsosi2 jo buvo laikai.. Senukai jau mes. Bega laikas greiciau nei noretusi. Smagu matyti kad uzsuka seni nariai, ne as vienas Šypsosi

2024-02-20 22:18
Zodziu.. Nostalgija. Sorry Tabux uz spam’a, netelpa viskas i viena shout’a. 😁

2024-02-20 22:14
Aisku dabar tokie laikai, kai turinio valdymo sistemas valdome one-click principu. Ne kaip seniau kode ieskodavom klaidu, norint moda pasileist.. :D paciam reikdavo susidiegt viska i ftp..

2024-02-20 22:03
Sveiki kolegos 👌 kazkada rasiau greit 11 metu bet ziuriu greit 14 metu. 😄 baisuu, reik ta proga kazka sugalvot su php-f kaip jaunima itraukt.

Shoutbox Archive
Peržiūrėti temą
 Spausdinti temą
v6 serverio monitorius
xarnisx
#1 Spausdinti pranešimą
parašyta 2010-04-08 09:25
Pradinukas



Reputacija: 0

Pranešimai: 33
Įstojo: 2009-11-19

[IMG]http://www.part.lt/img/d390373e52aa7391b9ca94fbe2db12be997.bmp[/IMG]

Sveiki. Kaip paredaguoti si monitoriu, kad netampytu puslapio (zemyn) kai rodo zaidejus , o eitu paciam ziuret einant zemyn (nemoku paaiskint kaip, bet kad butu tas pats kaip ziurint betkoki saita ir desineje puseje yra juosta kuria trauki ir webas slekasi zemyn ar i virsu :D nu kaska suveliau, bet nemoku kitaip paaiskint, manau supratot ). Gal yra koks kodas?

iskarto dekingas kas papasakos kaip :)
Redagavo xarnisx 2010-04-08 09:27
 
PM
beshell
#2 Spausdinti pranešimą
parašyta 2010-04-08 09:31
Pradinukas



Reputacija: 0

Pranešimai: 28
Įstojo: 2010-04-05

Jau buvo kurta tokia tema, naudokis paieska...
 
PM
xarnisx
#3 Spausdinti pranešimą
parašyta 2010-04-08 09:36
Pradinukas



Reputacija: 0

Pranešimai: 33
Įstojo: 2009-11-19

Srry, visko neperzejau, bet pasakymas "naudokis paieska" kaskaip nlb, nes net neisivaiduoju ka rasyt ;d
 
PM
beshell
#4 Spausdinti pranešimą
parašyta 2010-04-08 09:38
Pradinukas



Reputacija: 0

Pranešimai: 28
Įstojo: 2010-04-05

<----- situo kodu naudokis :)
 
PM
xarnisx
#5 Spausdinti pranešimą
parašyta 2010-04-08 09:51
Pradinukas



Reputacija: 0

Pranešimai: 33
Įstojo: 2009-11-19

jau buvau rades, bet net neiivaizuodu kur ji det..
va idedu koda tai jei nesunku idek ta iframe , busiu dekingas :)


opentable("Serverio monitorius");
?>

$serverIP = "82.135.228.43";
$serverPort = 7777;

try
{
$rQuery = new QueryServer( $serverIP, $serverPort );

$aInformation = $rQuery->GetInfo( );
$aServerRules = $rQuery->GetRules( );
$aBasicPlayer = $rQuery->GetPlayers( );
$aTotalPlayers = $rQuery->GetDetailedPlayers( );
$serverIP = "82.135.228.43";
$serverPort = 7777;

$rQuery->Close( );
}
catch (QueryServerException $pError)
{
echo 'SERVERIS I?JUNGTAS!!!';
}

if(isset($aInformation) && is_array($aInformation)){
?>
Serverio monitorius







































Pavadinimas:
Modas
?aidejai /
?emelapis
iP: :
Oras
Laikas
Versija ?>




if(!is_array($aTotalPlayers) || count($aTotalPlayers) == 0){
echo '
Niekas ne?aid?ia';
} else {
?>






foreach($aTotalPlayers AS $id => $value){
?>





}

echo '
ID ?aidejas XP
';
}
}

class QueryServer
{
private $szServerIP;
private $iPort;
private $rSocketID;

private $bStatus;

function __construct( $szServerIP, $iPort )
{
$this->szServerIP = $this->VerifyAddress( $szServerIP );
$this->iPort = $iPort;

if (empty( $this->szServerIP ) || !is_numeric( $iPort )) {
throw new QueryServerException( 'Either the ip-address or the port isn\'t filled in correctly.' );
}

$this->rSocketID = @fsockopen( 'udp://' . $this->szServerIP, $iPort, $iErrorNo, $szErrorStr, 5 );
if (!$this->rSocketID) {
throw new QueryServerException( 'Cannot connect to the server: ' . $szErrorStr );
}

socket_set_timeout( $this->rSocketID, 0, 500000 );
$this->bStatus = true;
}

function VerifyAddress( $szServerIP )
{
if (ip2long( $szServerIP ) !== false &&
long2ip( ip2long( $szServerIP ) ) == $szServerIP ) {
return $szServerIP;
}

$szAddress = gethostbyname( $szServerIP );
if ($szAddress == $szServerIP) {
return "";
}

return $szAddress;
}

function SendPacket( $cPacket )
{
$szPacket = 'SAMP';
$aIpChunks = explode( '.', $this->szServerIP );

foreach( $aIpChunks as $szChunk ) {
$szPacket .= chr( $szChunk );
}

$szPacket .= chr( $this->iPort & 0xFF );
$szPacket .= chr( $this->iPort >> 8 & 0xFF );
$szPacket .= $cPacket;

return fwrite( $this->rSocketID, $szPacket, strlen( $szPacket ) );
}

function GetPacket( $iBytes )
{
$iResponse = fread( $this->rSocketID, $iBytes );
if ($iResponse === false) {
throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
}

$iLength = ord( $iResponse );
if ($iLength > 0)
return fread( $this->rSocketID, $iLength );

return "";
}

function Close( )
{
if ($this->rSocketID !== false) {
fclose( $this->rSocketID );
}
}

function toInteger( $szData )
{
$iInteger = 0;

$iInteger += ( ord( @$szData[ 0 ] ) );
$iInteger += ( ord( @$szData[ 1 ] ) << 8 );
$iInteger += ( ord( @$szData[ 2 ] ) << 16 );
$iInteger += ( ord( @$szData[ 3 ] ) << 24 );

if( $iInteger >= 4294967294 )
$iInteger -= 4294967296;

return $iInteger;
}


function GetInfo( )
{
if ($this->SendPacket('i') === false) {
throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
}

$szFirstData = fread( $this->rSocketID, 4 );
if (empty( $szFirstData ) || $szFirstData != 'SAMP') {
throw new QueryServerException( 'The server at ' . $this->szServerIP . ' is not an SA-MP Server.' );
}

fread( $this->rSocketID, 7 );

return array (
'Password' => ord( fread( $this->rSocketID, 1 ) ),
'Players' => $this->toInteger( fread( $this->rSocketID, 2 ) ),
'MaxPlayers' => $this->toInteger( fread( $this->rSocketID, 2 ) ),
'Hostname' => $this->GetPacket( 4 ),
'Gamemode' => $this->GetPacket( 4 ),
'Map' => $this->GetPacket( 4 )
);
}

function GetRules( )
{
if ($this->SendPacket('r') === false) {
throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
}

// Pop the first 11 bytes from the response;
fread( $this->rSocketID, 11 );

$iRuleCount = ord( fread( $this->rSocketID, 2 ) );
$aReturnArray = array( );

for( $i = 0; $i < $iRuleCount; $i ++ ) {
$szRuleName = $this->GetPacket( 1 );
$aReturnArray[ $szRuleName ] = $this->GetPacket( 1 );
}

return $aReturnArray;
}

function GetPlayers( )
{
if ($this->SendPacket('c') === false) {
throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
}

// Again, pop the first eleven bytes send;
fread( $this->rSocketID, 11 );

$iPlayerCount = ord( fread( $this->rSocketID, 2 ) );
$aReturnArray = array( );

for( $i = 0; $i < $iPlayerCount; $i ++ )
{
$aReturnArray[ ] = array (
'Nickname' => $this->GetPacket( 1 ),
'Score' => $this->toInteger( fread( $this->rSocketID, 4 ) )
);
}

return $aReturnArray;
}

function GetDetailedPlayers( )
{
if ($this->SendPacket('d') === false) {
throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
}

fread( $this->rSocketID, 11 );

$iPlayerCount = ord( fread( $this->rSocketID, 2 ) );
$aReturnArray = array( );

for( $i = 0; $i < $iPlayerCount; $i ++ ) {
$aReturnArray[ ] = array(
'PlayerID' => $this->toInteger( fread( $this->rSocketID, 1 ) ),
'Nickname' => $this->GetPacket( 1 ),
'Score' => $this->toInteger( fread( $this->rSocketID, 4 ) ),
'Ping' => $this->toInteger( fread( $this->rSocketID, 4 ) )
);
}

return $aReturnArray;
}

function RCON($rcon, $command)
{
echo 'Password '.$rcon.' with '.$command;
if ($this->SendPacket('x '.$rcon.' '.$command) === false) {
throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
}

// Pop the first 11 bytes from the response;
$aReturnArray = fread( $this->rSocketID, 11 );

echo fread( $this->rSocketID, 11 );

return $aReturnArray;
}

}

class QueryServerException extends Exception
{

private $szMessage;

function __construct( $szMessage )
{
$this->szMessage = $szMessage;
}

function toString( )
{
return $this->szMessage;
}
}
closetable();


Tiek daug lankytoju ir visa kita, tokie visi protingi, bet niekas negali supysto koduko padt ra?yt... kraupu
Redagavo xarnisx 2010-04-14 11:33
 
PM
Peršokti į forumą: