Skip to content

Instantly share code, notes, and snippets.

@gpedro
Created May 7, 2014 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpedro/c015da5f571c54eb73d2 to your computer and use it in GitHub Desktop.
Save gpedro/c015da5f571c54eb73d2 to your computer and use it in GitHub Desktop.
multiservers check
<?php
require_once 'otinfo.php';
function getInfo($ip, $port = 7171)
{
$server = new Otinfo($ip, $port);
if ($server->execute()) {
echo 'Players online: ', $server->players['online'], '<br />',
'Server location: ', $server->serverinfo['location'], '<br />',
'Client version: ', $server->serverinfo['client'] , '<br />';
} else {
echo 'Server offline';
}
}
getInfo('underwar.org');
getInfo('shadowcores.twifysoft.net', 7172);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment