RobsonDias
New Member
Hello,
I developed a class in PHP to grab all the data from a server (Players, Maximum Players, Server Version, Client Version, Map Size, Monsters, NPCs, Server Name).
I'll be updating it whenever I have a new idea to implement. And I'm already working on a caching system to save data and only make new checks every 5 minutes (or more, will be configurable).
Examples:
Current Functions
Download:
https://github.com/v0id5/OTServStatus
OBS: If you liked it, and you have some idea to implement in the project, post in this topic.
:ninja:
I developed a class in PHP to grab all the data from a server (Players, Maximum Players, Server Version, Client Version, Map Size, Monsters, NPCs, Server Name).
I'll be updating it whenever I have a new idea to implement. And I'm already working on a caching system to save data and only make new checks every 5 minutes (or more, will be configurable).
Examples:
PHP:
Include('class.otserv.php');
$OTServ = new OTServStatus();
$Connect = $OTServ->Connect('shadowcores.twifysoft.net', 7171);
if(!$Connect) {
echo 'server offline';
} else {
echo "{$OTServ->Players()} / {$OTServ->PlayersMax()}";
}
Current Functions
PHP:
$OTServ->Players()
/* Get current number of players online. */
$OTServ->PlayersMax()
/* Returns max players online of server. */
$OTServ->ServerVersion()
/* Returns current distro version. (Ex: The Forgotten Server 0.4_DEV) */
$OTServ->Monsters()
/* Returns current total monsters on server. */
$OTServ->NPCs()
/* Returns current total number of npcs on server. */
$OTServ->UptimeHours()
/* Return current uptime hours. */
$OTServ->UptimeMinutes()
/* Returns current uptime minutes. */
$OTServ->MapWidth()
/* Returns server map width. */
$OTServ->MapHeight()
/* Returns server map height. */
$OTServ->ServerName()
/* Returns current server name. */
$OTServ->ClientVersion()
/* Returns current server client version (Ex: 8.62, 9.81) */
Download:
https://github.com/v0id5/OTServStatus
OBS: If you liked it, and you have some idea to implement in the project, post in this topic.
:ninja: