diff --git a/elconfig.c b/elconfig.c index bfbaef0c9..a8f309556 100755 --- a/elconfig.c +++ b/elconfig.c @@ -3156,6 +3156,7 @@ static void init_ELC_vars(void) SERVER); add_var(OPT_BOOL,"write_ini_on_exit", "wini", &write_ini_on_exit, change_var, 1,"Save INI","Save options when you quit",SERVER); add_var(OPT_STRING,"data_dir","dir",datadir,change_dir_name,90,"Data Directory","Place were we keep our data. Can only be changed with a Client restart.",SERVER); + add_var(OPT_STRING,"alt_updates_dir","aupdir",alt_updates_dir,change_dir_name,90,"Alt Updates Directory","Full path to an alternative updates directory for data files. Normally blank.",SERVER); #endif // ANDROID add_var(OPT_BOOL,"serverpopup","spu",&use_server_pop_win,change_var,1,"Use Special Text Window","Toggles whether server messages from channel 255 are displayed in a pop up window.",SERVER); /* Note: We don't take any action on the already-running thread, as that wouldn't necessarily be good. */ diff --git a/init.c b/init.c index dcd2c39c6..6cf2b4f29 100644 --- a/init.c +++ b/init.c @@ -113,6 +113,8 @@ char datadir[256]=DATA_DIR; char datadir[256]="./"; #endif //DATA_DIR +char alt_updates_dir[256]=""; + static const char *cfg_filename = "el.cfg"; #ifdef JSON_FILES static const char *client_state_filename = "client_state.json"; diff --git a/init.h b/init.h index c0e96586b..46cc766b3 100644 --- a/init.h +++ b/init.h @@ -251,6 +251,7 @@ typedef struct extern char configdir[256]; /*!< the default directory where we look for configuration files */ extern char datadir[256]; /*!< the default directory where we look for data files (aka installation dir) */ +extern char alt_updates_dir[256]; /*!< an alternative updates directory for data files, if blank, default is /updates/ */ /*! * \ingroup loadsave diff --git a/io/elpathwrapper.c b/io/elpathwrapper.c index 9f9c30afd..6796848af 100644 --- a/io/elpathwrapper.c +++ b/io/elpathwrapper.c @@ -192,7 +192,10 @@ const char * get_path_updates(void) return locbuffer; } - safe_snprintf(locbuffer, sizeof(locbuffer), "%supdates/%d_%d_%d/", get_path_config_base(), VER_MAJOR, VER_MINOR, VER_RELEASE); + if (alt_updates_dir[0] != '\0') + safe_snprintf(locbuffer, sizeof(locbuffer), "%s", alt_updates_dir); + else + safe_snprintf(locbuffer, sizeof(locbuffer), "%supdates/%d_%d_%d/", get_path_config_base(), VER_MAJOR, VER_MINOR, VER_RELEASE); return locbuffer; }