Getting current map and game mode from Server Console

Ask questions, discuss ideas, get answers
Post Reply
wasabi
Posts: 18
Joined: Tue Apr 21, 2020 1:16 am

Getting current map and game mode from Server Console

Post by wasabi »

Hello,

Is there a way to get the current running map and gamemode either from the Server Console started by BFSM, or externally through RemoteConsole.exe?

I cannot seem to find a command that does this. game.listMaps gives me the list, but I need the actual current map name + gamemode (CQ/CTF etc).

The reason I ask is, I thought I could get this from the XML log but it seems the logger is bugged and writes GPM_CQ even if the map is actually GPM_CTF.

Thank you!
duffman
Posts: 55
Joined: Tue Apr 15, 2014 8:02 am

Re: Getting current map and game mode from Server Console

Post by duffman »

What you are looking for is in the old GameSpy on UDP port 14567.

if you send the command: \info\
will response with something like:

_check\0\dedicated\2\gameId\desertcombat\gamemode\openplaying\gametype\coop\hostname\Safe House\hostport\14567\mapId\Desertcombat\mapname\dc desertshield\maxplayers\32\numplayers\0\password\0\reservedslots\0\roundTime\-1\roundTimeRemain\-1\status\3\sv_punkbuster\0\tickets1\196\tickets2\190\unpure_mods\\version\v1.612\final\

Other commands like: \status\, \info\, \players\, \rules\, \basic\

The format of the data is pretty much:
separator=\
variable-name\value\variable-name\value\ etc..
wasabi
Posts: 18
Joined: Tue Apr 21, 2020 1:16 am

Re: Getting current map and game mode from Server Console

Post by wasabi »

Thank you very much. I found a Gamespy query library in Python and was able to use it to get this information.
Post Reply