PDA

View Full Version : I Need Help With Php Sockets And Cod4, ports different of "28960" don't work


marson
02-19-2008, 04:42 PM
Hello people,

I'm with problems for this script bellow:


<?php

$server_ip = "200.181.171.8";
$server_port = 28960; //if I change to a server in "28961" this script don't work =/

$server_ip = "udp://" . $server_ip;
$serverip = substr($server_ip, 6);
$connect = fsockopen($server_ip, $server_port, $errno, $errstr, 30);

if ($connect)
{
socket_set_timeout ($connect, 1, 000000);
$send = "\xFF\xFF\xFF\xFF\x02rcon "."password"." "."say hello"."\x0a\x00";

fwrite ($connect, $send);
fclose($connect);
}
else
{
echo "ERROR: $errno - $errstr<br />\n";
}

?>


this script just work with port default of COD4 (28960), but I want to find some solution for it work with ports different of default port.

I'm sorry by my poor english. =/

Help me plz.
Marson

NoLife192
02-21-2008, 06:21 PM
Well first make sure that the server is running on the different port; while the server is running type in the console:
net_port it will come up with something like this:
]net_port
"net_port" is: "28960" default: "28960"
Domain is any integer from 0 to 65535


Make sure that it looks like this: "net_port" is: "yourdifferent port"
If it says anything underneath that line like: latched "yourdifferent port" then the next time the server is restarted that will be the port, something like that.