Chaging a Query From UDP to TCP

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Chaging a Query From UDP to TCP
Neoszion
CZ Super Newbie
 Codezwiz Site Donator
Neoszion has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Web Designer
Age: 45
Gender: Male
Fav. Sports Team: Liverpool
Website:
Status: Offline
Joined: Sep 02, 2004
0.01 posts per day
Posts: 92
Points: 10,111
   
Hi there,

I am having problems with my host they will not allow UDP queerys on there server because they are prone to DDOS attacks on there servers so they blcok the querry but told me the that the TCP querry is still available.. I do not know how to change the code. Can anyone help me out?

<?PHP
$ip_aasf = '212.187.247.149';    //---- Change this to match the IP address of your America's Army server (you may use a DNS name: server.yourclan.com)
$port_aasf = '1716';           //---- Change this to match the UDP port of your America's Army server (default is 1716)

//---- THERE IS NO NEED TO MAKE ANY CHANGES BELOW THIS LINE ------\
ini_set("max_execution_time", "2");

$stat_aasf = @fsockopen("udp://${ip_aasf}", $port_aasf, $errno, $errstr, 2);
socket_set_timeout($stat_aasf, 000002);

if (!$stat_aasf) {
echo '<IMG SRC="skins/IG-DesertCombat/img/tracker_offline.gif" HEIGHT="7" TITLE="Bad derrière Brits AA Server Offline" WIDTH="41">';
    exit;
} else {
}

$send = pack("CCCV", 0xFE, 0xFD, 0x00, 0x7E) . pack("CCC", 0xFF,0xFF,0xFF);
@fwrite ($stat_aasf, $send);
$outp_aasf = @fread ($stat_aasf, 1);//0);

if (!$outp_aasf)
echo '<IMG SRC="skins/IG-DesertCombat/img/tracker_offline.gif" HEIGHT="7" TITLE="Bad derrière Brits AA Server Offline" WIDTH="41">';
else {
echo '<IMG SRC="skins/IG-DesertCombat/img/tracker_online.gif" HEIGHT="7" TITLE="Bad derrière Brits AA Server Online" WIDTH="41">';
}
@fclose($stat_aasf);
?>


btw. I hope this is the correct forum to post in icon_smile.gif



_________________
Back to top Reply with quote
#2   re: Chaging a Query From UDP to TCP
BigJim
CZ Super Newbie
BigJim has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Jun 09, 2006
0.01 posts per day
Posts: 60
Points: 1,327
   
Not real sure here...I think it's more dependant on the game, perhaps that game you're trying to query only works using UDP ports. I had this issue once with an old host and they refused to open it up claiming security issues.



Back to top Reply with quote
#3   re: Chaging a Query From UDP to TCP
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
I don't know the answer so I am gonna stab in the dark here.

Did you try changing udp to tcp on this line?

$stat_aasf = @fsockopen("udp://${ip_aasf}", $port_aasf, $errno, $errstr, 2);


I hardly doubt thats it, but its worth a shot.

I think your problem will be this.. most games that I know only use udp ports. So changing it to tcp will not work anyway.


Back to top Reply with quote
#4   re: Chaging a Query From UDP to TCP
Neoszion
CZ Super Newbie
 Codezwiz Site Donator
Neoszion has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Web Designer
Age: 45
Gender: Male
Fav. Sports Team: Liverpool
Website:
Status: Offline
Joined: Sep 02, 2004
0.01 posts per day
Posts: 92
Points: 10,111
   
No I tried that and didnt work thanks anyways for your reply. icon_sad.gif




_________________
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum