_
new in v1.6.4
- removed the need of the file autodemo_changemap.cfg
plugin will just restart the map that is currently running if sourcetv fakeclient is absent
- new cvar: sm_autodemo_playercount - default 2
recording is started only if this amount of REAL players are on the server
Required server settings:
tv_enable 1
tv_autorecord 0 (!)
Well I have sourceTV record everything for quite some time now.
And it bugged me that it recorded demos even if nobody was on the server, so our available space got hooked pretty quick.
This plugin checks the presence of HUMAN clients on connection and disconnection of players, and starts/stops the sourceTV recording feature.
Also, if your server has just been started, or it crashed and auto-restarted, it changes to a new map so the sourceTV bot will connect.
When you run this plugin, make sure the cvar tv_autorecord
is set to ZERO!
The only hooked event is player_team, so this plugin works on all source mods that support this event.
Update to 1.2
Just a small but crucial bugfix that prevented recording after a mapchange
v1.2d, nothing changed except for debug messages and logging
log goes to "autodemo_smx.log" in the sourcemod log folder.
timed checks, critical faults are logged to autodemo_smx_critical.log
v1.3 - bugfix, exchanged "OnClientDisconnect" for "OnClientDisconnect_Post"
exchanged hooked event with "OnMapStart"-forward
v1.4
Code:
sm_autodemo_filename_format "%m-%d-%y %H.%M-*H.*M *MAP"
Filename format of the demos.
Default: "%m-%d-%y %H.%M-*H.*M *MAP"
Note that you cannot use asterisks. I use them as escape char here for map name and ending time.
For the ending time, only *H and *M are supported. They equal %H and %M
I will NOT check if you use invalid filename characters for your target platform
AFAIK, unix supports colons in filenames. Windows does not. Just stick to dots.
For supported % placeholders, refer to:
http://cplusplus.com/reference/clibrary/ctime/strftime/
Do not record when there are only spectators
Default: "1"
sm_autodemo_ignore_spectators "1"
0 = Don't delete old demos, 1 = Check on mapchange only, 2 = Check every x seconds(ttl_tick)
Default: "1"
sm_autodemo_ttl_checkmode "1"
Hours to keep demos on disk before deletion. default = 168 = 7 days
Default: "168"
sm_autodemo_ttl_hours "168"
Interval in seconds, that are checked for old demos that can be deleted
Default: "120.0"
sm_autodemo_ttl_tick "120.0"
Recording is started only if this amount of REAL players are on the server. Must be >0
Default: "2"
sm_autodemo_playercount "2"
The console command
sm_autodemo_query
tells you if recording is in progress currently, and to what file.
v1.5
a thousands of bugfixes and re-design
sm_autodemo_steambans cvar has been removed, due to some engine limitations. See start of this posting.
The "status" command has been replaced by a logging function. You get a .log file that has the same name
as the demofile, where the 'simulated' status output goes into, so you have the SteamIDs of the players.
These will be deleted together with the demofile if they exceed TTL.
v1.6
sm_autodemo_ttl_hours * changed
// Hours to keep demos on disk before deletion. Default unlimited (0). Must be >=1 otherwise its unlimited.
// Having this, and ttl_kilobyte = 0 overrides ttl_checkmode to 0
// Default: "0"
sm_autodemo_ttl_hours "0"
sm_autodemo_ttl_kilobyte * added
// Max size in kilobytes of demos before the oldest gets deleted. Default unlimited (0). Must be >=51200 otherwise its unlimited. Max size is 4294967295 KB = 3,9 Therabyte
// Having this, and ttl_hours = 0 overrides ttl_checkmode to 0
// Default: "0"
sm_autodemo_ttl_kilobyte "0"
Note that ttl_kilobyte takes only completed demos into account.
This can be changed, if someone demands.
If any of ttl_kilobyte, ttl_hours or ttl_checkmode is 0, no new demofile will be written to the log!!
(The demo is written to the log after the recording has been stopped. So you could use this to prevent certain single demos from being deleted)
1.6.1
Fixed plugin thinking dead players are spectators
1.6.2
Improved SourceTV detection.
New CVAR:
sm_autodemo_mapchange
- Do a mapchange if SourceTV absent
0 = never, 1 = once, 2 = always
Default: 1
Added optional checking if new plugin version is available.
This feature depends on socket extension.
If you want to enable that feature, you must uncomment
//#define SOCKET_ENABLED // Comment this line out to disable Sockets. this line at the top and recompile. (You will need the file socket.inc from the sockets extension in your scripting folder)
If enabled, it writes a message into SourceMods error log, the new version number and where to get it.
1.6.3
Update check feature dropped
Autodemo Plugin now supports SteamBans plugin
sb_status is automatically fired when a new player connects and SteamBans was detected running.
The fake status textfiles are now optional and can be deactivated by setting the cvar
sm_autodemo_fakestatus_file to 0
v1.6.4
- removed the need of the file autodemo_changemap.cfg
plugin will just restart the map that is currently running if sourcetv fakeclient is absent
- new cvar: sm_autodemo_playercount - default 2
recording is started only if this amount of REAL players are on the server