Hi! I’m currently working on a small passion project for hosting CoD4 servers through discord bots. Basically, if someone wants to pug you contact the bot, it sets up a lobby and people can join. Once full, start a dedicated server and send the details to connect to each user. Similar to the Rocket League 6 mans discords.
Currently, I am at the phase where I want to connect the dedicated server to the discord bot such that they can communicate (change map/mode, get info, etc.)
I thought it would be a good idea to ask here if there exists a parser for the CoD4 dedicated server already? Just to be clear, I’m looking for an interface/package/library which can write output to the dedicated server and read the output in a digestible format.
If anyone has info about projects similar to this, I would really appreciate it. Thanks!
Edit: Just to clarify, this project is done on Linux in case it matters.
How does the cod4x master server extract the number of players in a server?
I know this question sounds stupid. A server sends a heartbeat with information which has list of players currently connected, to the master server.
Is there a way this can be intercepted and parsed by a different program? How does the packet look like? What is the other information contained in this packet?
Any leads on these questions would be greatly appreciated.
To get the player count you could send a “getstatus” packet to the server. The server will respond with a “statusresponse” packet containing some basic info (name, player count, ping, etc. Basically what you see in the server list) about the server.
I believe the client repo on github has the code that handles the sending/receiving of those packets. There are also a lot of scripts on github you could reference.