Digital Paint Discussion Board

Development => General Development => Topic started by: vague312 on September 13, 2008, 02:03:36 AM

Title: sk89q - libdpserver???
Post 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
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 13, 2008, 03:02:24 AM
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.
Title: Re: sk89q - libdpserver???
Post by: vague312 on September 13, 2008, 07:49:21 PM
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?

Title: Re: sk89q - libdpserver???
Post by: sk89q on September 13, 2008, 10:34:56 PM
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.
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 14, 2008, 12:36:03 AM
Code: [Select]
<?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";
Title: Re: sk89q - libdpserver???
Post by: vague312 on September 15, 2008, 10:33:03 AM
nope
Quote
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.
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 15, 2008, 05:37:39 PM
var_dump($in) and post it here. Forgot to put that in the code.
Title: Re: sk89q - libdpserver???
Post by: vague312 on September 16, 2008, 09:33:07 AM
Quote
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.
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 16, 2008, 05:55:02 PM
var_dump($in) and post it here.
Title: Re: sk89q - libdpserver???
Post by: vague312 on September 19, 2008, 01:47:42 PM
still not happening.
where am i putting "var_dump($in)"

could you repost the code
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 19, 2008, 06:59:47 PM
<?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);
Title: Re: sk89q - libdpserver???
Post by: vague312 on September 19, 2008, 11:06:18 PM
at last

string(0) ""
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 19, 2008, 11:14:16 PM
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
"
Title: Re: sk89q - libdpserver???
Post by: vague312 on September 20, 2008, 12:31:58 AM
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?
Title: Re: sk89q - libdpserver???
Post by: KnacK on September 20, 2008, 10:01:46 AM
enables the spyware portion of libdpserver
Title: Re: sk89q - libdpserver???
Post by: sk89q on September 20, 2008, 05:37:35 PM
: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.
Title: Re: sk89q - libdpserver???
Post by: vague312 on October 13, 2008, 11:37:25 AM
Woot!
Got the test script and the program working. Had to request a port from my admin.

thanks for the help sk89q