CoD4/CoD5 Server Query Protocol

Misc things others on the internets might find useful
Post Reply
Masher
Site Admin
Posts: 3409
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Hearland
Contact:

CoD4/CoD5 Server Query Protocol

Post by Masher » Wed Jan 02, 2008 10:46 am

I tried to find info for querying Call of Duty 4 servers and couldn't find anything. This is what I've figured out:
[EDIT 12/23/2008]This also works for Call of Duty World at War (CoD 5)[/EDIT]

To get the basic server status, send a udp packet to the server's port containing
{0xFF, 0xFF, 0xFF, 0XFF, 0x67, 0x65, 0x74,0x69,0x6E,0x66,0x6F,0x20,0x78,0x78,0x78}

Example packet

Code: Select all

                                FF FF FF FF 67 65           ....ge
  74 69 6E 66 6F 20 78 78 78                      tinfo.xxx       
You'll get a reply similar to

Code: Select all

                                FF FF FF FF 69 6E           ....in
  66 6F 52 65 73 70 6F 6E 73 65 0A 5C 63 68 61 6C foResponse.\chal
  6C 65 6E 67 65 5C 78 78 78 5C 70 72 6F 74 6F 63 lenge\xxx\protoc
  6F 6C 5C 33 5C 68 6F 73 74 6E 61 6D 65 5C 5E 33 ol\3\hostname\^3
  23 20 7C 20 43 6F 64 34 2E 69 54 20 7C 20 2D 20 #.|.Cod4.iT.|.-.
  50 75 62 6C 69 63 20 54 44 4D 20 53 65 72 76 65 Public.TDM.Serve
  72 20 76 31 2E 34 5C 6D 61 70 6E 61 6D 65 5C 6D r.v1.4\mapname\m
  70 5F 73 68 6F 77 64 6F 77 6E 5C 63 6C 69 65 6E p_showdown\clien
  74 73 5C 32 36 5C 73 76 5F 6D 61 78 63 6C 69 65 ts\26\sv_maxclie
  6E 74 73 5C 32 37 5C 67 61 6D 65 74 79 70 65 5C nts\27\gametype\
  77 61 72 5C 70 75 72 65 5C 31 5C 6D 61 78 50 69 war\pure\1\maxPi
  6E 67 5C 31 35 30 5C 6B 63 5C 31 5C 68 77 5C 32 ng\150\kc\1\hw\2
  5C 6D 6F 64 5C 30 5C 76 6F 69 63 65 5C 30 5C 70 \mod\0\voice\0\p
  62 5C 31                                        b\1             

To get more info from the server including player names, send a udp packet to the server containing:
{0xFF, 0xFF, 0xFF, 0XFF, 0x67, 0x65, 0x74, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73}

Example:

Code: Select all

                                FF FF FF FF 67 65           ....ge
  74 73 74 61 74 75 73                            tstatus         
You'll get a reply similar to:

Code: Select all

                                FF FF FF FF 73 74           ....st
  61 74 75 73 52 65 73 70 6F 6E 73 65 0A 5C 5F 41 atusResponse.\_A
  64 6D 69 6E 5C 43 6F 64 34 2E 69 54 23 4C 69 6E dmin\Cod4.iT#Lin
  64 6F 6E 5C 5F 45 6D 61 69 6C 5C 69 6E 66 6F 40 don\_Email\info@
  63 61 6C 6C 6F 66 64 75 74 79 32 2E 69 74 5C 5F callofduty2.it\_
  4D 6F 64 5C 43 6F 64 34 2E 69 54 5C 67 5F 63 6F Mod\Cod4.iT\g_co
  6D 70 61 73 73 53 68 6F 77 45 6E 65 6D 69 65 73 mpassShowEnemies
  5C 30 5C 67 5F 67 61 6D 65 74 79 70 65 5C 77 61 \0\g_gametype\wa
  72 5C 67 61 6D 65 6E 61 6D 65 5C 43 61 6C 6C 20 r\gamename\Call.
  6F 66 20 44 75 74 79 20 34 5C 6D 61 70 6E 61 6D of.Duty.4\mapnam
  65 5C 6D 70 5F 73 68 6F 77 64 6F 77 6E 5C 70 72 e\mp_showdown\pr
  6F 74 6F 63 6F 6C 5C 33 5C 73 68 6F 72 74 76 65 otocol\3\shortve
  72 73 69 6F 6E 5C 31 2E 34 5C 73 76 5F 61 6C 6C rsion\1.4\sv_all
  6F 77 41 6E 6F 6E 79 6D 6F 75 73 5C 30 5C 73 76 owAnonymous\0\sv
  5F 64 69 73 61 62 6C 65 43 6C 69 65 6E 74 43 6F _disableClientCo
  6E 73 6F 6C 65 5C 30 5C 73 76 5F 66 6C 6F 6F 64 nsole\0\sv_flood
  70 72 6F 74 65 63 74 5C 31 5C 73 76 5F 68 6F 73 protect\1\sv_hos
  74 6E 61 6D 65 5C 5E 33 23 20 7C 20 43 6F 64 34 tname\^3#.|.Cod4
  2E 69 54 20 7C 20 2D 20 50 75 62 6C 69 63 20 54 .iT.|.-.Public.T
  44 4D 20 53 65 72 76 65 72 20 76 31 2E 34 5C 73 DM.Server.v1.4\s
  76 5F 6D 61 78 63 6C 69 65 6E 74 73 5C 33 32 5C v_maxclients\32\
  73 76 5F 6D 61 78 50 69 6E 67 5C 31 35 30 5C 73 sv_maxPing\150\s
  76 5F 6D 61 78 52 61 74 65 5C 32 35 30 30 30 5C v_maxRate\25000\
  73 76 5F 6D 69 6E 50 69 6E 67 5C 30 5C 73 76 5F sv_minPing\0\sv_
  70 72 69 76 61 74 65 43 6C 69 65 6E 74 73 5C 36 privateClients\6
  5C 73 76 5F 70 75 6E 6B 62 75 73 74 65 72 5C 31 \sv_punkbuster\1
  5C 73 76 5F 70 75 72 65 5C 31 5C 73 76 5F 76 6F \sv_pure\1\sv_vo
  69 63 65 5C 30 5C 75 69 5F 6D 61 78 63 6C 69 65 ice\0\ui_maxclie
  6E 74 73 5C 33 32 5C 70 73 77 72 64 5C 30 5C 6D nts\32\pswrd\0\m
  6F 64 5C 30 0A 30 20 37 37 20 22 44 65 65 64 65 od\0.0.77."Deede
  72 20 4C 65 6F 6E 22 0A 30 20 31 32 39 20 22 41 r.Leon".0.129."A
  6C 65 73 73 69 6F 22 0A 32 30 20 31 31 31 20 22 lessio".20.111."
  5E 32 41 69 72 5E 37 62 6F 5E 31 72 6E 65 22 0A ^2Air^7bo^1rne".
  35 32 20 35 30 20 22 44 74 70 6C 69 66 65 22 0A 52.50."Dtplife".
  34 30 20 37 39 20 22 7C 43 6F 72 6C 65 6F 6E 65 40.79."|Corleone
  7C 4A 69 72 61 69 22 0A 32 20 31 30 32 20 22 7C |Jirai".2.102."|
  43 6F 72 6C 65 6F 6E 65 7C 53 6C 79 76 65 22 0A Corleone|Slyve".
  30 20 31 30 39 20 22 45 6D 6F 62 6F 79 53 69 63 0.109."EmoboySic
  69 6C 79 22 0A 31 32 20 39 38 20 22 47 61 73 22 ily".12.98."Gas"
  0A 30 20 37 38 20 22 43 6F 64 34 2E 69 54 23 56 .0.78."Cod4.iT#V
  69 6B 69 6E 67 22 0A 30 20 37 31 20 22 61 33 6C iking".0.71."a3l
  65 78 22 0A 30 20 34 36 20 22 43 4F 44 34 22 0A ex".0.46."COD4".
  30 20 35 31 20 22 4A 2E 4A 2E 20 46 33 52 52 30 0.51."J.J..F3RR0
  22 0A 30 20 36 31 20 22 41 6C 65 78 22 0A 30 20 ".0.61."Alex".0.
  35 31 20 22 41 57 44 5F 42 6F 4D 42 65 52 22 0A 51."AWD_BoMBeR".
  31 32 20 37 32 20 22 2A 3C 3D 29 20 53 77 61 74 12.72."*<=).Swat
  22 0A 30 20 36 34 20 22 4C 69 6C 20 45 22 0A 30 ".0.64."Lil.E".0
  20 34 31 20 22 47 75 72 65 6C 6C 61 22 0A 30 20 .41."Gurella".0.
  36 39 20 22 7C 43 6F 72 6C 65 6F 6E 65 7C 47 69 69."|Corleone|Gi
  61 6E 22 0A 30 20 38 37 20 22 5B 43 6F 72 6C 65 an".0.87."[Corle
  6F 6E 65 5D 52 6F 63 63 6F 22 0A 33 30 20 31 32 one]Rocco".30.12
  35 20 22 6A 6F 6E 6E 79 22 0A 34 32 20 34 35 20 5."jonny".42.45.
  22 73 6F 6C 69 64 65 6F 22 0A 30 20 37 38 20 22 "solideo".0.78."
  59 61 6E 75 73 22 0A 30 20 38 30 20 22 4E 69 63 Yanus".0.80."Nic
  6B 22 0A 31 30 20 33 39 20 22 54 72 69 6C 6C 65 k".10.39."Trille
  6B 61 7A 7A 22 0A 30 20 37 33 20 22 43 6F 64 34 kazz".0.73."Cod4
  2E 69 54 23 6D 61 6E 75 32 37 22 0A 30 20 36 37 .iT#manu27".0.67
  20 22 44 61 6E 69 65 6C 65 22 0A                ."Daniele".     
Player info is towards the end. Players score, ping, then player's name in quotes.
Masher
-----------
Please do not PM me unless asked to! We are a small company and if you have an issue or question it would be best to post it in the forums where it can help others in the future.

Need an affordable web control panel? Try UGCC.

Sniper
Posts: 1
Joined: Sat Aug 09, 2008 4:02 am

Re: COD4 Server Query Protocol

Post by Sniper » Sat Aug 09, 2008 4:04 am

Hi, im trying to make a server query for my own call of duty 4 server.

Would you be able to help me please as im a complete newbie to this...

Thanks in advance!

Masher
Site Admin
Posts: 3409
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Hearland
Contact:

Re: COD4 Server Query Protocol

Post by Masher » Sat Aug 09, 2008 10:07 am

There's tons of free stuff out there for using query with your website, etc. Just google it.
Masher
-----------
Please do not PM me unless asked to! We are a small company and if you have an issue or question it would be best to post it in the forums where it can help others in the future.

Need an affordable web control panel? Try UGCC.

Post Reply