PDA

View Full Version : PHP send "status server"



maxdamage99
4th May 2015, 14:12
How to send "status" server cod2(NO RCON)? with the results:
1) Number of players
2) The map / mode
3) Nicky players / Statistics
and so on.
PHP

kung foo man
4th May 2015, 18:02
Basically you just make an UDP request and parse it, e.g. with explode(...)

Example code could be found in these projects, google for "php rcon call of duty".

http://callofduty.filefront.com/file/PHP_CoD2CoD4_RCON;84664
https://ashus.ashus.net/viewtopic.php?t=27

maxdamage99
4th May 2015, 18:22
This method is known to me, I thought there is any other!
But anyway, thank you!

maxdamage99
4th May 2015, 19:04
But still, it can be done without rcon password?!?!

Mitch
4th May 2015, 19:14
But still, it can be done without rcon password?!?!

Rcon commands, no.
But none rcon commands like getstatus and getinfo are used without passwords.

See: http://killtube.org/showthread.php?2147-Receiving-server-info (if you don't like to search it yourself within this forum)

Jeplaa
15th May 2015, 14:26
@maxdamage99 You can always use API from services like game-monitor.

I made an example in PHP:


<?php

ini_set( "display_errors", false );

//$host = "192.168.1.2"; // localhost
//$port = 28960;

$host = "46.4.55.66"; // evil.High Jump CRACKED
$port = 28958;

$serialized = file_get_contents( "http://module.game-monitor.com/$host:$port/data/server.php" );
$json_data = unserialize( $serialized );
$array = ( array )$json_data;

if( $array["error"] == 0 )
{
$hostname = $array["name"];
$ip = $array["ip"];
$port = $array["port"];
$player = $array["player"];
$maxplayer = $array["maxplayer"];

$hostname = "<pre>Hostname: $hostname</pre>";
$ip = "<pre>IP: $ip:$port</pre>";
$players = "<pre>Players: $player/$maxplayer</pre>";
}
else
{
$hostname = "<pre>Server offline or wrong IP</pre>";
$ip = "<pre>IP: $host:$port</pre>";
}

?>

<html>
<body>
<?php echo $hostname; ?>
<?php echo $ip; ?>
<?php echo $players; ?>
</body>
</html>

maxdamage99
17th May 2015, 17:14
No thanks, I do not need it! I need a way to himself. There is an option nicks count after mod\1\. But I need to make sure the script is needed!