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

[ANY] Plugin Updates Checker (1.6) [14-Jul-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7717
Plugin Version:
1.6
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    8 
    Plugin Description:
    Checks version cvars against a list of known latest plugin versions.
    Old 07-11-2021 , 12:45   [ANY] Plugin Updates Checker (1.6) [14-Jul-2022]
    Reply With Quote #1

    About:
    • Automatically check for plugin updates on server start, or once per day, or manually via command.
    • Downloads a list of links to check, each webpage containing lists of plugins and their latest version numbers from various authors (currently only Silvers).
    • Compares the servers version cvars from these lists with their latest known version number.
    • A future version by Dragokas will hopefully include most plugins on AM. I've uploaded this as a proof-of-concept and demonstrating some code.


    Current plugin authors with manual lists:

    Thanks:
    • "Asherkin", "KyleS" and "Tsunami" for their extensions this plugin uses.
    • "GoD-Tony" for their "Updater" plugin where the networking code was adapted from.
    • "Dragokas" - For ideas and testing.
    • "Lux" - For ideas and testing.
    • "Marttt" - For ideas and testing.



    Example Output:
    Spoiler



    Custom List of Links:
    • Optional data config allows for overriding the main list, instead of downloading it.
    • Save to plugin_updates_checker.cfg in your servers \sourcemod\data\ folder.
    • On each newline put a link to a webpage which contains lists of plugins.
    For example:
    Spoiler


    Custom List of Plugins:
    • The command sm_updates_config opens the file data/plugin_updates.cfg on the server (the file format is shown in the example below, or here).
    • The file is read and an updated version is saved to data/plugin_updates_cmd.cfg with the latest version numbers found running on the server from the listed plugins.
    • Lists are maintained by plugin authors. (Please submit links to be included in the default main list).
    • The webpages must be raw with no other data except a list of plugins in the following format:
    For example:
    Spoiler


    Admin Commands: (requires "z" flag)

    PHP Code:
    sm_updates          // Check for plugin updates.
    sm_updates_config   // Updates the data/plugin_updates.cfg config with detected cvar version numbers from plugins listed in the config. 


    CVars:

    Saved to sm_updates_checker.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Manual checking only. 1=Automatically check on server start. 2=Check on server start and once per day (if uptime >= 24 hours).
    sm_updates_auto "1"

    // Ignores plugins using these version cvars, separate by commas (no spaces).
    sm_updates_ignore ""

    // 0=Print to server console. 1=Logs to sourcecmod/logs/plugin_updates.txt listing plugins whose version differs from the servers. 2=Print to server console and logs to file.
    sm_updates_logs "2"

    // Plugin Updates Checker plugin version.
    sm_updates_version 


    Changes:
    Code:
    1.6 (14-Jul-2022)
        - Fixed plugin version not being set.
        - Fixed "Invalid memory access" error. Thanks to "Psyk0tik" for reporting and testing.
    
    1.5 (18-Apr-2022)
        - Fixed some servers not displaying the updates and throwing an error. Thanks to "Psyk0tik" for reporting and testing.
    
    1.4 (07-Nov-2021)
        - No longer checks for updates every map change.
    
    1.3 (06-Nov-2021)
        - Removed timeout restriction for checking on updates.
        - Changes to fix warnings when compiling on SourceMod 1.11.
    
    1.2 (20-Jul-2021)
        - Made the error message clearer about missing extensions.
    
    1.1 (13-Jul-2021)
        - Fixed "Native "HTTPClient.HTTPClient" was not found" error.
    
    1.0 (20-Apr-2021)
        - Initial release.
    
    0.1 (25-May-2020)
        - Initial creation.

    Compiling:
    You MUST download the include files from these extensions.
    1. REST in Pawn extension by "Tsunami".
    2. SteamTools extension by "Asherkin".
    3. SteamWorks extension by "KyleS".


    Requirements: (one of the following extensions)
    1. REST in Pawn (Windows requires version 1.2.4+).
    2. SteamTools (TF2 only).
    3. SteamWorks.


    Warning:
    Windows cannot fully download the lists using REST in Pawn, a future update to this extension should fix it.

    Installation:
    DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires includes from the above extensions!
    1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder. (Compiled with 1.10).
    Attached Files
    File Type: sp Get Plugin or Get Source (plugin_updates_checker.sp - 176 views - 28.0 KB)
    File Type: smx plugin_updates_checker.smx (13.3 KB, 225 views)
    __________________

    Last edited by Silvers; 07-14-2022 at 11:37.
    Silvers is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 07-11-2021 , 12:48   Re: [ANY] Plugin Updates Checker (1.0) [11-Jul-2021]
    Reply With Quote #2

    Reserved.

    Please note, this is only checking for updates from my plugins since that's the only list currently.
    __________________

    Last edited by Silvers; 07-11-2021 at 12:50.
    Silvers is offline
    foxsay
    AlliedModders Donor
    Join Date: Sep 2013
    Old 07-11-2021 , 13:58   Re: [ANY] Plugin Updates Checker (1.0) [11-Jul-2021]
    Reply With Quote #3

    Add discord webhook option for this
    __________________
    poggers
    foxsay is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 07-11-2021 , 15:20   Re: [ANY] Plugin Updates Checker (1.0) [11-Jul-2021]
    Reply With Quote #4

    Quote:
    Originally Posted by foxsay View Post
    Add discord webhook option for this
    How do you want this to interact with discord? Which plugin/extension? Unlikely to add as I've never worked with any discord APIs.
    __________________
    Silvers is offline
    MAGNAT2645
    Senior Member
    Join Date: Nov 2015
    Location: AlliedMods.net
    Old 07-11-2021 , 18:41   Re: [ANY] Plugin Updates Checker (1.0) [11-Jul-2021]
    Reply With Quote #5

    Quote:
    Originally Posted by Silvers View Post
    How do you want this to interact with discord? Which plugin/extension? Unlikely to add as I've never worked with any discord APIs.
    You can use Discord/Slack API as optional plugin (there are some examples like modules) and create a key for discord.cfg:
    Code:
    	"sm_updates" // sample name
    	{
    		"url"	 "WEBHOOK URL"
    	}
    Then you can use its native:
    Code:
    Discord_SendMessage( "sm_updates", message ); // message should be JSON-formatted but there's an autoformat feature (as said in plugin post)
    __________________

    Last edited by MAGNAT2645; 07-15-2021 at 06:15.
    MAGNAT2645 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 07-11-2021 , 18:44   Re: [ANY] Plugin Updates Checker (1.0) [11-Jul-2021]
    Reply With Quote #6

    Thanks, will look into it.
    __________________
    Silvers is offline
    SkiPlix
    Member
    Join Date: Dec 2016
    Location: Argentina
    Old 07-15-2021 , 01:58   Re: [ANY] Plugin Updates Checker (1.1) [13-Jul-2021]
    Reply With Quote #7

    L 07/15/2021 - 02:56:54: [SM] Exception reported: This plugin requires one of the SteamTools, SteamWorks or REST in Pawn extensions to function.
    L 07/15/2021 - 02:56:54: [SM] Blaming: plugin_updates_checker.smx
    L 07/15/2021 - 02:56:54: [SM] Call stack trace:
    L 07/15/2021 - 02:56:54: [SM] [0] SetFailState
    L 07/15/2021 - 02:56:54: [SM] [1] Line 159, C:\Servers\L4D2\left4dead2\addons\sourcemod\s cripting\plugin_updates_checker.sp::OnConfigs Executed
    SkiPlix is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 07-17-2021 , 13:10   Re: [ANY] Plugin Updates Checker (1.1) [13-Jul-2021]
    Reply With Quote #8

    Quote:
    Originally Posted by SkiPlix View Post
    L 07/15/2021 - 02:56:54: [SM] Exception reported: This plugin requires one of the SteamTools, SteamWorks or REST in Pawn extensions to function.
    L 07/15/2021 - 02:56:54: [SM] Blaming: plugin_updates_checker.smx
    L 07/15/2021 - 02:56:54: [SM] Call stack trace:
    L 07/15/2021 - 02:56:54: [SM] [0] SetFailState
    L 07/15/2021 - 02:56:54: [SM] [1] Line 159, C:\Servers\L4D2\left4dead2\addons\sourcemod\s cripting\plugin_updates_checker.sp::OnConfigs Executed
    Please read the error message, then read the installation instructions and requirements.
    __________________
    Silvers is offline
    thewintersoldier97
    Senior Member
    Join Date: Aug 2021
    Location: Vietnam
    Old 10-20-2021 , 22:53   Re: [ANY] Plugin Updates Checker (1.2) [20-Jul-2021]
    Reply With Quote #9

    Hello Silvers, nice plugin! I've installed the latest version and tested but it showed this
    PHP Code:
    sm_updates
    [SMPlugin Updates CheckerCannot determine last check
    What does this mean? Am I missing something here?
    __________________

    Looking for some fun!
    thewintersoldier97 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 10-21-2021 , 02:47   Re: [ANY] Plugin Updates Checker (1.2) [20-Jul-2021]
    Reply With Quote #10

    Guessing it didn't connect to the SqlLite database. Strange. I'd try reloading the plugin, otherwise try setting "int g_iLastChecked = 1" in the source code and recompiling.
    __________________
    Silvers is offline
    Reply



    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 23:13.


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