Author Topic: sk89q - libdpserver???  (Read 4993 times)

vague312

  • VM-68
  • Posts: 217
sk89q - libdpserver???
« on: September 13, 2008, 12: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

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #1 on: September 13, 2008, 01: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.

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #2 on: September 13, 2008, 05: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?


sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #3 on: September 13, 2008, 08: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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #4 on: September 13, 2008, 10:36:03 PM »
Code: [Select]
<?php
// (GT)
$conn fsockopen("udp://69.93.11.66"27911$errno$errstr5);
assert('$conn') or die;
stream_set_timeout($conn5);
fwrite($conn"\xFF\xFF\xFF\xFFstatus\0");
$in fread($conn4096);
$expect "\xFF\xFF\xFF\xFFprint\n";
assert('substr($in, 0, strlen($expect)) == $expect') or die;
echo 
"OK\n";

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #5 on: September 15, 2008, 08: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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #6 on: September 15, 2008, 03:37:39 PM »
var_dump($in) and post it here. Forgot to put that in the code.

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #7 on: September 16, 2008, 07: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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #8 on: September 16, 2008, 03:55:02 PM »
var_dump($in) and post it here.

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #9 on: September 19, 2008, 11:47:42 AM »
still not happening.
where am i putting "var_dump($in)"

could you repost the code

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #10 on: September 19, 2008, 04: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);

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #11 on: September 19, 2008, 09:06:18 PM »
at last

string(0) ""

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #12 on: September 19, 2008, 09: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
"

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #13 on: September 19, 2008, 10:31:58 PM »
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?

KnacK

  • Global Moderator
  • Autococker
  • Posts: 3039
Re: sk89q - libdpserver???
« Reply #14 on: September 20, 2008, 08:01:46 AM »
enables the spyware portion of libdpserver

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: sk89q - libdpserver???
« Reply #15 on: September 20, 2008, 03: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.

vague312

  • VM-68
  • Posts: 217
Re: sk89q - libdpserver???
« Reply #16 on: October 13, 2008, 09: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