Steam – Team Fortress 2 Dedicated Server Replays

server-administrationsteamteam-fortress-2

I am running a dedicated server for Team Fortress 2 and I have SourceMod installed.

I would like to include replay support, which is presently almost functional.
By almost functional I mean that it works how I want it to, but I have to manually start it.

My server.cfg calls replay.cfg like so

exec replay.cfg

which gets me to where I am now. I need to manually run a map change to get it going. The reason why I can't have replay.cfg trigger a map change is that the map change would call server.cfg and thus replay.cfg getting us stuck in an infinite loop.

What I really need is the ability to run a config file if and only if it was called by a server initial start up and not a map change.

Thanks in advance.

Best Answer

TF2's version of srcds has a command-line switch -replay that will automatically exec replay.cfg for you on server startup.

This switch also does some magic with maxplayers (i.e. it adds an additional player slot and hides it from the server browser).

Alternately, you can create a cfg/autoexec.cfg and add exec replay.cfg to it, but this doesn't do the previously mentioned slot magic. autoexec.cfg is only processed on server startup and happens before the server loads the first map.