mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi ppl.
I am traying to do a script that connect to a Battlefiled 2 server game and that result the active status off the game.
Like the server name , max players , max players playing , game map , etc etc etc.

But i have two problems

1. - I don´t know the protocol that the game use, but some one have already told me that it was the default gamespy protocol -->

This one

2- If the protocll that that game uses is that one i already have try, but with none result ...

I have already try this :

sockudp -k A 194.65.14.120 29900 þý.CORYÿÿ

i think i have to change the last two ÿÿ for something but i don´t have understund that quite ...

Well if some one could help me i will apreciate very mucth.

Thanks for all and bee good

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
This is in hex what you need to send, mIRc works in decimal so you'll have to use $base(FF,16,10) for each hex number to get the deciman number (or a calculater or whatever)
FE FD 00 43 4F 52 59 FF FF 00 -> 254 253 0 1 2 3 4 255 255 0

The red is a ping value, you can use whatever you want here, it's just so you know which reply you get sent back because the same value will be in the reply. The last 3 numbers show what you want, in this case no team info apparently.

bset &binvar 10 254 253 0 1 2 3 4 255 255 0
sockudp -kb A 194.65.14.120 29900 10 &binvar

This sends the 10 bytes of the request in a binvar to the given ip/port and names the udp socket A for later use (the reply)

Joined: Jun 2003
Posts: 13
P
Pikka bird
Offline
Pikka bird
P
Joined: Jun 2003
Posts: 13
Battlefield 2 uses the new Gamespy Query Protocol 3...there are 11 Bytes now to transmit...

Gamespy Query Protocol 3

If you have success with your UDP script...can you please post the code here...I've tried it myself to get a running script with sockudp to get the serverstats shown in mirc...but the f**king mirc help and the tuts about sockudp in the internet are s**t...useless... mad
getting no server reply at all...

I've tried this code...
Code:
alias udp {
  bset &binvar 11 254 253 0 12 174 61 0 255 255 255 1
  sockudp -kb test 70.84.77.164 29900 11 &binvar
}

on *:udpread:test:{
  var %temp
  sockread %temp
  echo -st -> %temp
}


Link Copied to Clipboard