AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Auto SourceTV Recorder (https://forums.alliedmods.net/showthread.php?t=92072)

StevoTVR 05-09-2009 16:20

Auto SourceTV Recorder
 
4 Attachment(s)
Auto Recorder

Automates SourceTV demo recording based on player count and time of day. Also allows admins to manually record. This is useful if you want to keep records of suspected cheaters or other problem players, but you don't want to waste space on off times.

Console Variables

Code:

// This file was auto-generated by SourceMod (v1.8.0.5928)
// ConVars for plugin "autorecorder.smx"


// Enable automatic recording
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_autorecord_enable "1"

// If 1, continue recording until the map ends
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_autorecord_finishmap "1"

// Ignore bots in the player count
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_autorecord_ignorebots "1"

// Minimum players on server to start recording
// -
// Default: "4"
// Minimum: "0.000000"
sm_autorecord_minplayers "4"

// Path to store recorded demos
// -
// Default: "."
sm_autorecord_path "."

// Hour in the day to start recording (0-23, -1 disables)
// -
// Default: "-1"
sm_autorecord_timestart "-1"

// Hour in the day to stop recording (0-23, -1 disables)
// -
// Default: "-1"
sm_autorecord_timestop "-1"



Console Commands
  • sm_record: Starts a SourceTV demo
  • sm_stoprecord: Stops recording the current SourceTV demo

Notes
  • Requires SourceTV to be enabled
  • Demos are named similar to SourceTV auto demos (auto-YYYYMMDD-hhmmss-map.dem)
Changelog
  • 1.0.0 - 05/09/2009
    • Initial Release
  • 1.1.0 - 05/11/2009
    • Added path cvar to control where demos are stored
    • Changed manual recording to override automatic recording
    • Added seconds to demo names
  • 1.1.1 - 05/04/2016
    • Changed demo file names to replace slashes with hyphens [ajmadsen]
  • 1.2.0 - 08/26/2016
    • Now ignores bots in the player count by default
    • The SourceTV client is now always ignored in the player count
    • Added sm_autorecord_ignorebots to control whether to ignore bots
    • Now checks the status of the server immediately when a setting is changed
  • 1.3.0 - 06/21/2017
    • Fixed minimum player count setting being off by one
    • Fixed player counting code getting out of range
    • Updated source code to the new syntax

Thermopyle 05-09-2009 16:35

Re: Auto Recorder
 
Nice job. I'll let you know when I have a chance to test it out...

Chewy_Solo 05-09-2009 16:42

Re: Auto Recorder
 
Great thanks! One question, does sourcetv stop recording once the player count goes below minimum again?

StevoTVR 05-09-2009 16:52

Re: Auto Recorder
 
Quote:

Originally Posted by Chewy_Solo (Post 824451)
Great thanks! One question, does sourcetv stop recording once the player count goes below minimum again?

Yes. If sm_autorecord_finishmap is 1 it will first wait until the map to end, and if it is set to 0 it will stop immediately when the player count is below threshold.

MadMakz 05-09-2009 17:00

Re: Auto Recorder
 
thanks!

Atreus 05-09-2009 20:09

Re: Auto Recorder
 
Oh, quite awesome and speedy StevoTVR! Thanks :)

liv3d 05-11-2009 15:38

Re: Auto Recorder
 
I made a small change of it, so we can use it our iseries lan ;)
(Multiple servers sharing the same TF2 folder - which causes demo's to get overwritten)

It now has the option to record demos to a specific folder rather than in to the main tf2 folder.

Code changes are:
Code:

// Line 47 Add below
g_hPath = CreateConVar("sm_autorecord_path", ".", "If blank, records to tf2 folder");

Code:

// Lines 143 - 154 replace with:
    if(GetConVarBool(g_hTvEnabled) && !g_bIsRecording)
    {
        decl String:sTime[16], String:sMap[32];
        new String:sPath[128];
        GetConVarString(g_hPath, sPath, sizeof(sPath));
       
        FormatTime(sTime, sizeof(sTime), "%Y%m%d-%H%M", GetTime());
        GetCurrentMap(sMap, sizeof(sMap));
       
        ServerCommand("tv_record \"%s/auto-%s-%s\"", sPath, sTime, sMap);
        g_bIsRecording = true;
       
        LogMessage("Recording to %s/auto-%s-%s.dem", sPath, sTime, sMap);
    }

Notes: This does no error checking if the folder/path doesn't exist. It should just work (tm)

StevoTVR 05-11-2009 18:00

Re: Auto Recorder
 
I was planning on adding that feature. Thanks for reminding me.:)

I added that option and fixed some potential problems.

mgunnett 05-13-2009 04:13

Re: Auto Recorder
 
Hey man, I want to thank you for writing this at Chewy's request. We have hours and hours of empty server recordings which are kind of a pain in the butt to go through. This should help clear that up!

waertf 05-16-2009 23:30

Re: Auto Recorder
 
work for L4D?


All times are GMT -4. The time now is 21:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.