Digital Paint Discussion Board
Development => General Development => Topic started by: vague312 on September 13, 2008, 02:03:36 AM
-
Sup guys
Just wondering how to use this sdk?
I changed the ip and rcon password to my current settings before i uploaded it to a testing site with php5 enabled.
Went to the area i have it installed ran the example.php and i get this.
"
Testing server 71.181.165.146:27910
Is the server online?
It's not online =(
Quitting...
"
I even went as far as running the program on localhost with localhost as the ip. Still nothing
(i have apachie installed on this cpu also)
The server is being ran from my laptop and i know its working properly so im guessing its something in my coding or site.
What else needs to be done on my part?
thanks
-
Change the IP/port to some random public server that's not yours. If it works, then your setup can't connect to your address. If it doesn't, then something else is wrong.
-
nope didnt work.
Im seeing both of our site servers are running Apache. Did you have to enable anything in Apache or modify your .htaccess?
-
No. I've run it on my local development Apache installation too.
I'll write up some test code later for you to try to troubleshoot.
-
<?php
// (GT)
$conn = fsockopen("udp://69.93.11.66", 27911, $errno, $errstr, 5);
assert('$conn') or die;
stream_set_timeout($conn, 5);
fwrite($conn, "\xFF\xFF\xFF\xFFstatus\0");
$in = fread($conn, 4096);
$expect = "\xFF\xFF\xFF\xFFprint\n";
assert('substr($in, 0, strlen($expect)) == $expect') or die;
echo "OK\n";
-
nope
Warning: assert() [function.assert]: Assertion "substr($in, 0, strlen($expect)) == $expect" failed in example.php on line 9
ill send u a pm later today.
-
var_dump($in) and post it here. Forgot to put that in the code.
-
string(0) ""
Warning: assert() [function.assert]: Assertion "substr($in, 0, strlen($expect)) == $expect " failed in example.php on line 10
not a clue whats going on with the assert function. My first time using that function personally.
thanks for giving a hand with this man.
-
var_dump($in) and post it here.
-
still not happening.
where am i putting "var_dump($in)"
could you repost the code
-
<?php
// (GT)
$conn = fsockopen("udp://69.93.11.66", 27911, $errno, $errstr, 5);
assert('$conn') or die;
stream_set_timeout($conn, 5);
fwrite($conn, "\xFF\xFF\xFF\xFFstatus\0");
$in = fread($conn, 4096);
var_dump($in);
-
at last
string(0) ""
-
That's weird. You don't have some annoying firewall or anything?
Output should be along the lines of:
string(463) "ÿÿÿÿprint
\TimeLeft\0:00\mapname\propaint1\_scores\Red:0 Blue:0 \gamename\Digital Paint Paintball 2 v1.904(155)\gameversion\DPPB2 v1.904(155)\needpass\0\gamedate\Dec 26 2007\elim\60\location\Dallas, Texas\e-mail\graffiti-taggerz@hotmail.com\admin\Snipen, Sharon, PiCaSSo\website\http://www.graffiti-taggerz.com\hostname\GRaFFiTi PainT ={PuB 1}=\maxclients\32\protocol\34\timelimit\20\fraglimit\50\version\2.00 i386 Dec 26 2007 Linux (20)\gamedir\pball\game\pball
"
-
not that im aware of. Ill check with my webhost techs and see if i need to enable anything.
what does that little bit of code you gave me do differently?
-
enables the spyware portion of libdpserver
-
:p
It, without using libdpserver, tries to connect to a GT server and queries it for information. fsockopen opens a socket, fwrite writes to the socket, and fread reads from the socket.
-
Woot!
Got the test script and the program working. Had to request a port from my admin.
thanks for the help sk89q