extensions/updater/extension.cpp
changeset 2575 8d1896d809f1
parent 2573 9e715ee7389e
child 2576 69d3cc552b89
     1.1 --- a/extensions/updater/extension.cpp	Tue Feb 17 16:19:11 2009 -0500
     1.2 +++ b/extensions/updater/extension.cpp	Tue Feb 17 16:39:02 2009 -0500
     1.3 @@ -38,6 +38,8 @@
     1.4  #include <sh_list.h>
     1.5  #include <sh_string.h>
     1.6  
     1.7 +#define DEFAULT_UPDATE_URL			"http://www.sourcemod.net/update/"
     1.8 +
     1.9  using namespace SourceHook;
    1.10  
    1.11  SmUpdater g_Updater;		/**< Global singleton for extension's main interface */
    1.12 @@ -46,6 +48,7 @@
    1.13  IWebternet *webternet;
    1.14  static List<String *> update_errors;
    1.15  static IThreadHandle *update_thread;
    1.16 +static String update_url;
    1.17  
    1.18  bool SmUpdater::SDK_OnLoad(char *error, size_t maxlength, bool late)
    1.19  {
    1.20 @@ -64,6 +67,13 @@
    1.21  		return false;
    1.22  	}
    1.23  
    1.24 +	const char *url = smutils->GetCoreConfigValue("AutoUpdateURL");
    1.25 +	if (url == NULL)
    1.26 +	{
    1.27 +		url = DEFAULT_UPDATE_URL;
    1.28 +	}
    1.29 +	update_url.assign(url);
    1.30 +
    1.31  	return true;
    1.32  }
    1.33  
    1.34 @@ -175,7 +185,7 @@
    1.35  {
    1.36  	UpdateReader ur;
    1.37  
    1.38 -	ur.PerformUpdate();
    1.39 +	ur.PerformUpdate(update_url.c_str());
    1.40  
    1.41  	smutils->AddFrameAction(PumpUpdate, ur.DetachParts());
    1.42  }