ARK: Survival Evolved

ARK: Survival Evolved

Statistiken ansehen:
PHP Website Server Status
anyone have a server status PHP script that works and dont mind sharing? I run other steamcmd servers among others and have always used

$ark = fsockopen ("IP",Port, $errno, $errstr, 10)

with and if ($ark) else statement after it..

it never seems to find the port open.. ever....

thanks
< >
Beiträge 115 von 30
anyone?
Wstar 15. Juni 2015 um 12:14 
interested to know this too.
I still can not seem to get this to work at all....
<?php
// Simple UDP port check
// I will be adding static images as well
// shortybsd

set_error_handler('my_error_handler');
function my_error_handler($errno, $errstr, $errfile, $errline) {}

function checkUDP($host,$port=7777){
$fp = fsockopen("udp://".$host, $port, $errno, $errstr,1.0);
if (!$fp) {
return false;
} else {
fclose($fp);
return true;
}
}

$server1 = '192.168.1.7';

if(checkUDP($server1)){
echo $server1.' ElementArk Online';
}else{
echo $server1.' ElementArk Offline';
}

?>

Change port 7777 to example 27015 (for game query port). When using fsocketopen you need to specify it is UDP. You can add more servers as well as if statements to reflect the new servers.
Zuletzt bearbeitet von shortybsd; 1. Aug. 2015 um 11:16
thank you !!
idk what the hell this is but id love to know how to check if a server is up without going into the game
<?php

class portScan {

protected $_vars = array();
public $output;

public function set($name, $value) {
if (!isset($this->_vars[$name])) {
$this->_vars[$name] = $value;
} else {
return false;
}
}

public function run() {
$this->output = '';
foreach ($this->_vars['ports'] as $key => $port) {
foreach ($this->_vars['proticals'] as $key => $protical) {
$port_scan = $this->_scan($protical,$port);
if ($port_scan) {
$this->output .= $this->_vars['server_name'] . " Offline (Protical:{$protical} Port:{$port})<br />";
} else {
$this->output .= $this->_vars['server_name'] . " Online (Protical:{$protical} Port:{$port})<br />";
}
}
}
return $this;
}

private function _scan($protical,$port) {
$fp = fsockopen("{$protical}://" . $this->_vars['host'], $port, $errno, $errstr,1.0);
if (!$fp) {
return false;
} else {
fclose($fp);
return true;
}
}
}
?>


//this code you can use anywere if you include the above file...
<?php
$portscan = new portScan();
$portscan->set("server_name", 'Ark Server'); //server name
$portscan->set("host", '123.123.123.123'); //server ip
$portscan->set("ports", array(80,7777,27015)); //add more ports but it will be slow
$portscan->set("proticals", array('udp')); //add more proticals like tcp or ftp
if ($portscan->run()) { echo $portscan->output; } //html output
?>

Html OutPut will be:
Ark Server Offline (Protical:udp Port:80)
Ark Server Offline (Protical:udp Port:7777)
Ark Server Offline (Protical:udp Port:27015)

just a basic class code to know if a server is online or not ;)

if you needed help just pm me and ask me and maby i can help you ;)

greetz.

Zander you just forgot to use UDP in your connect line..
Is there a way to check the server version, if yes how?
yeah, with the parameter app_info_print for steamcmd ..you get at least the buildID
and your local copy ..can be checked by parsing the appmanifest file, the .acf one, there is also an entry with buildid
Zuletzt bearbeitet von crckdns; 3. Okt. 2015 um 4:34
I have no idea how to do that.
What do i have to add exactly?
I've used source protocol query clients to get data from the server before. It's not entirely accurate, but seems to generally agree with steam's player counts, so at least it's equally wrong.
I only need the server version
It seems that the code above is not working, it shows all the time that my server is offline
< >
Beiträge 115 von 30
Pro Seite: 1530 50

Geschrieben am: 15. Juni 2015 um 9:53
Beiträge: 30