Results 1 to 9 of 9

Thread: Getting server status from Q3 Engine

  1. #1
    Private
    Join Date
    Nov 2013
    Posts
    16
    Thanks
    2
    Thanked 17 Times in 6 Posts

    Getting server status from Q3 Engine

    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.

    Code:
    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.208.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 ?
    Last edited by stevomitric; 29th December 2014 at 10:19.

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by stevomitric View Post
    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.

    Code:
    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.208.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.
    Last edited by Tally; 29th December 2014 at 10:35.

  3. The Following User Says Thank You to Tally For This Useful Post:

    stevomitric (29th December 2014)

  4. #3
    Private
    Join Date
    Nov 2013
    Posts
    16
    Thanks
    2
    Thanked 17 Times in 6 Posts
    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 ).

  5. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    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?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    stevomitric (29th December 2014)

  7. #5
    Private
    Join Date
    Nov 2013
    Posts
    16
    Thanks
    2
    Thanked 17 Times in 6 Posts
    i feel so stupid right now.

    thanks. it works....

  8. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by stevomitric View Post
    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.

  9. #7
    Private
    Join Date
    Nov 2013
    Posts
    16
    Thanks
    2
    Thanked 17 Times in 6 Posts
    *just curious*

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

    doesnt master server hold that information ?

  10. #8
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by stevomitric View Post
    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.

  11. #9
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by stevomitric View Post
    *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?2...ll=1#post10493

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •