PDA

View Full Version : Getting server status from Q3 Engine



stevomitric
29th December 2014, 10:16
Hello there!

I'm trying to comunicate with a Call of Duty 2 server ( based on Quake 3 Enigine ), to send some data to it and get some in return.
So ( using Python - sockets) i was able to send data to the server but i cant get any back. Here is the script i'm curently using.


import socket # Importing module
# Creating socket File
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP connection
sock.connect(('master3.idsoftware.com', 27950)) # Connectiong to cod2 UDP server
sock.sendto('\xff\xff\xff\xffgetstatus',('80.241.2 08.55', 28960)) # Server i whoud like to inspect
data, addr = sock.recvfrom(7000) # Waiting for Replay.
print "received message:", str(data), addr # Printing out the resoult


My source was from guy named Aluigi (aluigi.org) : http://aluigi.altervista.org/papers/q3info.txt

The reason i uploaded this here and not on Python forum is becouze this code works but servers are broke. i saw:


When we go on the multiplayer option, our client will start to search
servers on LAN, Mplayer, Internet and Favourites.

- LAN: 255.255.255.255
port: 27960, 27961, 27962, 27963
- Mplayer: 60.242.0.0
port: 27950
- Internet: 60.242.0.0 or master3.idsoftware.com
port: 27950

that he wrote. and servers do connect but i'm not getting any data in return.

any sugestions ?

Tally
29th December 2014, 10:32
Hello there!

I'm trying to comunicate with a Call of Duty 2 server ( based on Quake 3 Enigine ), to send some data to it and get some in return.
So ( using Python - sockets) i was able to send data to the server but i cant get any back. Here is the script i'm curently using.


import socket # Importing module
# Creating socket File
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP connection
sock.connect(('master3.idsoftware.com', 27950)) # Connectiong to cod2 UDP server
sock.sendto('\xff\xff\xff\xffgetstatus',('80.241.2 08.55', 28960)) # Server i whoud like to inspect
data, addr = sock.recvfrom(7000) # Waiting for Replay.
print "received message:", str(data), addr # Printing out the resoult


My source was from guy named Aluigi (aluigi.org) : http://aluigi.altervista.org/papers/q3info.txt

The reason i uploaded this here and not on Python forum is becouze this code works but servers are broke. i saw:



that he wrote. and servers do connect but i'm not getting any data in return.

any sugestions ?

Call of Duty 2 is an Activision game. Not id Software. Activision do not use id Software for their Master Servers. So, querying the wrong Master Server is probably the problem.

FYI - Although COD2 does contain some legacy code from the Quake 3 engine, it is NOT built on the Quake 3 engine. Quake 3 is a Fixed Function Graphics Pipeline engine; COD2 uses the High Level Shader Language (.HLSL), and as such is a Programmable Graphics Pipeline engine. Quake 3 uses Gouraud-based lighting; COD2 uses Phong-based lighting. Quake 3 can only dream of the graphics capable in the COD2 engine.

When you code for a game, best to check what engine the game uses first, before you go wasting your time using code from the wrong engine.

stevomitric
29th December 2014, 10:59
That actuly explains alot of sruff.

he also wrote:


The cod2 master server should not have the cached servers information
as far as I remember, that was possible with most of the games on the
old (no longer available) Gamespy master server.

Gametracker is also a good resource because they retrieve the
information and so you don't need to directly query the server.

Remember that querying the server (getinfo/gestatus) is the only way to
retrieve real-time information.

So i need correct Server. I tryed some of thous Master Servers like cod2authorize.activision.com and they dont actuly work. ( cant connect to them ).

IzNoGoD
29th December 2014, 11:08
What do you need a masterserv for if you already know the ip of the server you wanna query?

Why not just connect to the cod2 server ip instead of the masterserver url?

stevomitric
29th December 2014, 11:14
i feel so stupid right now.

thanks. it works....

Tally
29th December 2014, 11:22
That actuly explains alot of sruff.

he also wrote:



So i need correct Server. I tryed some of thous Master Servers like cod2authorize.activision.com and they dont actuly work. ( cant connect to them ).

that's right - you can't connect to any COD Master server because they do not use the server-client model - all they do is authenticate server.

As IzNOGod says - trying to connect to a Master server is pointless anyway, just query servers which have players on them.

stevomitric
29th December 2014, 11:25
*just curious*

what if i wonted for example a server list ? ( all servers of cod2 )

doesnt master server hold that information ?

Tally
29th December 2014, 11:26
i feel so stupid right now.

thanks. it works....

FYI - the code you took from the Quake 3 engine works on any game server. This is because using UDP packets to detect live servers, and then passing the info to a query function, is not unique to Quake 3. The Frostbite engine, the Source engine, and even the TitanFall engine, all use exactly the same principles. John Carmack did not invent it. It is not his Intellectual Property, and that it works in a game does not indicate the presence of a Quake 3 engine.

Mitch
29th December 2014, 11:41
*just curious*

what if i wonted for example a server list ? ( all servers of cod2 )

doesnt master server hold that information ?

I made an applicatie for getting all the servers from the master server a while ago (written in Java).
(Kung helped me with parsing the data)

http://killtube.org/showthread.php?2013-Cracked-Server-doesnt-show-up&p=10493&viewfull=1#post10493