1

Pingr - Simplifying xPaw, One letter at a time.

tenten8401's Avatar tenten84013/28/14 8:46 pm
1 emeralds 241 1
3/28/2014 9:08 pm
XxGman21104xX's Avatar XxGman21104xX
Hello PMC,
When I didn't know much about xPaw's Minecraft pinger... i failed to find a lot of support on it.
Now, I want to help anyone who is seeing this thread.

I know that xPaw's Minecraft Pinger isnt that easy... so i created Pingr to simplify it a little bit.

Pinger consists of 2 files:
pingr.php
xpaw.php
Download:
http://tentencraft.net/pingr/pingr.zip

Demo:
http://tentencraft.net/pingr/view.php
Wanna try the demo on your server? navigate to http://tentencraft.net/pingr/view.php?i ... er.ip.here

Now, to call this function in PHP... would be something like this:
PHP:
<?php
include_once 'pingr.php';
$status = Pingr::getStats('play.tentencraft.net');
?>
It also supports ports...
PHP:
<?php
include_once 'pingr.php';
$status = Pingr::getStats('play.tentencraft.net:25565');
?>
Now to the basics... How to use it:

Variables:
$status['version'] Is the minecraft version number of the server.
$status['players'] Is the players that are currently online.
$status['maxplayers'] Is the max player count.
$status['favicon'] Is the favicon, it can be used in the SRC tag of an image.
$status['motd'] Is the MOTD, fixed up for display purposes.
$status['motd_raw'] Is the raw MOTD, including all special characters.
$status['ping'] Is the time in milliseconds that the server info was retrieved in.
$status['pnames'] Is the players online. This does not work for all servers.
$status['online'] Returns true if online or false if offline

Example Code:
PHP:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<div class="container">
<?php
include_once 'pingr.php';
$status = Pingr::getStats('endcraft.net');
if($status['online'] == true) {
echo "<br>"; echo "<hr>";
echo "The server is running on minecraft version ".$status['version'].".";
echo "<br>"; echo "<hr>";
echo "Players Online:";
echo "<br>";
echo $status['players']." out of ".$status['maxplayers'];
echo "<br>"; echo "<hr>";
echo "Favicon: ";
echo '<img src="'.$status['favicon'].'"></img>';
echo "<br>"; echo "<hr>";
echo "Motd:";
echo "<br>";
echo $status['motd'];
Posted by tenten8401's Avatar
tenten8401
Level 2 : Apprentice Cake
10

Create an account or sign in to comment.

1

1
03/28/2014 9:08 pm
Level 12 : Journeyman Explorer
XxGman21104xX
XxGman21104xX's Avatar
ok
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome