Raised This Month: $32 Target: $400
 8% 

Auto SourceTV Recorder


Post New Thread Reply   
 
Thread Tools Display Modes
Author
StevoTVR
Senior Member
Join Date: Oct 2008
Plugin ID:
867
Plugin Version:
1.3.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    199 
    Plugin Description:
    Automates SourceTV demo recording based on player count and time of day. Also allows admins to manually record.
    Old 05-09-2009 , 16:20   Auto SourceTV Recorder
    Reply With Quote #1

    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
    Attached Files
    File Type: sp Get Plugin or Get Source (autorecorder.sp - 5681 views - 6.7 KB)

    Last edited by StevoTVR; 06-22-2017 at 00:36. Reason: More descriptive title
    StevoTVR is offline
    Thermopyle
    Member
    Join Date: Jun 2008
    Old 05-09-2009 , 16:35   Re: Auto Recorder
    Reply With Quote #2

    Nice job. I'll let you know when I have a chance to test it out...
    Thermopyle is offline
    Chewy_Solo
    Junior Member
    Join Date: May 2008
    Old 05-09-2009 , 16:42   Re: Auto Recorder
    Reply With Quote #3

    Great thanks! One question, does sourcetv stop recording once the player count goes below minimum again?
    Chewy_Solo is offline
    Send a message via AIM to Chewy_Solo Send a message via MSN to Chewy_Solo
    StevoTVR
    Senior Member
    Join Date: Oct 2008
    Old 05-09-2009 , 16:52   Re: Auto Recorder
    Reply With Quote #4

    Quote:
    Originally Posted by Chewy_Solo View Post
    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.
    StevoTVR is offline
    MadMakz
    SourceMod Donor
    Join Date: Oct 2008
    Old 05-09-2009 , 17:00   Re: Auto Recorder
    Reply With Quote #5

    thanks!
    MadMakz is offline
    Atreus
    SourceMod Donor
    Join Date: Apr 2005
    Location: San Diego, CA
    Old 05-09-2009 , 20:09   Re: Auto Recorder
    Reply With Quote #6

    Oh, quite awesome and speedy StevoTVR! Thanks
    Atreus is offline
    Send a message via AIM to Atreus Send a message via MSN to Atreus
    liv3d
    SourceMod Donor
    Join Date: Oct 2006
    Old 05-11-2009 , 15:38   Re: Auto Recorder
    Reply With Quote #7

    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)
    liv3d is offline
    StevoTVR
    Senior Member
    Join Date: Oct 2008
    Old 05-11-2009 , 18:00   Re: Auto Recorder
    Reply With Quote #8

    I was planning on adding that feature. Thanks for reminding me.

    I added that option and fixed some potential problems.
    StevoTVR is offline
    mgunnett
    Member
    Join Date: May 2008
    Location: Somewhere in null...
    Old 05-13-2009 , 04:13   Re: Auto Recorder
    Reply With Quote #9

    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!
    __________________
    [IMG]http://img209.**************/img209/2452/picture4ix9.jpg[/IMG]
    My Plugins: Bhop Health
    mgunnett is offline
    waertf
    Member
    Join Date: Jan 2009
    Old 05-16-2009 , 23:30   Re: Auto Recorder
    Reply With Quote #10

    work for L4D?
    waertf is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 09:10.


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