Raised This Month: $ Target: $400
 0% 

[INC] Append new ConVars to plugin config v2.1


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-12-2014 , 13:30   [INC] Append new ConVars to plugin config v2.1
Reply With Quote #1

Ciao,

I made a simple replacement for AutoExecConfig ;-)

PHP Code:
/**
 * Append new ConVars to config file on new plugin version.
 *
 * @param name            Name of the config file, excluding the .cfg extension.
 *                        If empty, <plugin.filename.cfg> is assumed.
 * @param folder          Folder under cfg/ to use.  By default this is "sourcemod."
 * @param AppendNote      Note for server master about appended ConVars or just about appending.
 * @param AlwaysAppend    Always try to append new ConVars and do not look at plugin version. (useful for developer release)
 *
 * @noreturn
 */
stock AutoExecConfigAppend( const String:name[] = "", const String:folder[] = "sourcemod"String:AppendNote512 ] = ""bool:AlwaysAppend false 
When is config updating?
  1. When plugin version is not written in config file (those "// @version:" lines).
  2. When AlwaysAppend = true
Note: You will see all your ConVars on server console when is config updating.

Implementing:
  1. #include <convar_append>
  2. Replace "AutoExecConfig" with "AutoExecConfigAppend" - no special functions for creating convars etc. needed.
Note: AutoExecConfigAppend will log message about appending ConVars to SourceMod logs.
Important note: If AutoExecConfigAppend do not append all ConVars, change "#define CONVAR_APPEND_MAXCHARS 4096" to higher value (in convar_append.inc line 7).
Example:
Spoiler

Against my testing, there might be some bugs.. So let me know if you find someone please.

Change log:
Spoiler
Attached Files
File Type: inc convar_append.inc (6.6 KB, 408 views)

Last edited by KissLick; 02-17-2014 at 03:10. Reason: New version
KissLick is offline
 


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


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