Search

 
 Join the Community, Create an EVE-ONLINE account or log in.

open All Channels
sepopen EVE Technology Lab
blankseplocked Server Staus Code
 
This thread is older than 90 days and has been locked due to inactivity.

New Topic   
 
Author Topic

Alexandros Balfros
Caldari
Pax Britannia
Rally Against Evil
Posted - 2008.05.24 15:23:00 - [1]
 

Hi there,

Just a quick question, i basically want to include a little box on my site that lists the current tranquility server status in it, its just got to be really basic and just say

Tranquility
Status <online/offline>
Users Online <number online>

There are loads of other sites out there but i suspect they might be a little upset if i start hotlinking status images, there is some code posted in a thread below but i can't for the life of me get it to run from within a cell on my web page i'm sure i've managed to run PHP from a cell before but that was just a simple echo, any help is appreciated and the more noob friendly the better :)

The code will run from an index.html file from within a cell on the page that i'm leaving for a server status part, so far my attempts to run the codes i've seen result in large blocks of text being shown instead of being parsed.

Alexandros Balfros
Caldari
Pax Britannia
Rally Against Evil
Posted - 2008.05.24 15:33:00 - [2]
 

Actually never mind i just noticed its not even parsing a simple echo if its inside a cell, i'll poke the webhost to see why :)

Nisd
Amarr
Warsong Co.
Enforcers of Serenity
Posted - 2008.05.26 17:21:00 - [3]
 

Edited by: Nisd on 26/05/2008 17:22:04
How i make my server status on my website :D

function GetEvePlayers()
{
// IP of gameserver (Tranquility)
$strEVEServer = '87.237.38.200';
// Serverport
$intPortNumber = 26000;
// Timeout
$strTimeOut = 8;

function string2hex($String)
{
if (trim($String) != '')
{
$strHex = '';
$intLength = strlen($String);
for ($intCounter = 0; $intCounter < $intLength; $intCounter++)
{
if ($intCounter > 0) $strBound="-"; else $strBound="";
$strHex.=$strBound.str_pad(dechex(ord($String[$intCounter])), 2, 0, STR_PAD_LEFT);
}
return $strHex;
}
}

$objFP = @fsockopen($strEVEServer, $intPortNumber, &$strErrumber, &$strErrString, $strTimeOut);
if (!$objFP)
{
$strResult = 'Server down';
}
else
{
$arrBuffer = fgets($objFP,41);
fclose($objFP);

$strResult = $arrBuffer[21].$arrBuffer[20];
$strResult = string2hex($strResult);
$strResult = hexdec($strResult);
}
return $strResult;
}
echo 'Players Online: '.GetEvePlayers();


If you want to see it click here Cool

btw, it is in the left side

Immersive
Immersive Technology Solutions
Posted - 2008.05.28 10:34:00 - [4]
 

God, I hate trying to decode PHP! Evil or Very Mad

Got something a little more readable?
(I'll take an english translation if you like...)
Pseudocode?
C# or asp.net ideal Laughing


 

This thread is older than 90 days and has been locked due to inactivity.

New Topic