more localinfos
This commit is contained in:
parent
98c63e8efd
commit
130f274f86
@ -62,7 +62,7 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
|||||||
|
|
||||||
// Find now folder
|
// Find now folder
|
||||||
char pluginName[256], line[256], error[256];
|
char pluginName[256], line[256], error[256];
|
||||||
const char pluginsDir[] = "addons/amxx/plugins"; // hardcoded; :TODO: make it localinfo
|
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
|
||||||
|
|
||||||
|
|
||||||
while ( fp.getline(line , 255 ) )
|
while ( fp.getline(line , 255 ) )
|
||||||
|
@ -240,7 +240,8 @@ void print_srvconsole( char *fmt, ... );
|
|||||||
void report_error( int code, char* fmt, ... );
|
void report_error( int code, char* fmt, ... );
|
||||||
void* alloc_amxmemory(void**, int size);
|
void* alloc_amxmemory(void**, int size);
|
||||||
void free_amxmemory(void **ptr);
|
void free_amxmemory(void **ptr);
|
||||||
|
// get_localinfo
|
||||||
|
const char* get_localinfo( const char* name , const char* def );
|
||||||
|
|
||||||
#endif // AMXMODX_H
|
#endif // AMXMODX_H
|
||||||
|
|
||||||
|
@ -231,9 +231,10 @@ int Spawn( edict_t *pent ) {
|
|||||||
g_commands.registerPrefix( "sm_" );
|
g_commands.registerPrefix( "sm_" );
|
||||||
g_commands.registerPrefix( "cm_" );
|
g_commands.registerPrefix( "cm_" );
|
||||||
|
|
||||||
// make sure basedir is set
|
// make sure localinfos are set
|
||||||
get_localinfo("amxx_basedir", "addons/amxx");
|
get_localinfo("amxx_basedir", "addons/amxx");
|
||||||
|
get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
|
||||||
|
get_localinfo("amxx_modulesdir", "addons/amxx/modules");
|
||||||
// ###### Load modules
|
// ###### Load modules
|
||||||
loadModules(get_localinfo("amxx_modules", "addons/amxx/modules.ini"));
|
loadModules(get_localinfo("amxx_modules", "addons/amxx/modules.ini"));
|
||||||
attachModules();
|
attachModules();
|
||||||
|
@ -362,7 +362,7 @@ int loadModules(const char* filename)
|
|||||||
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char* pathname = build_pathname("addons/amxx/modules/%s", line);
|
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
|
||||||
|
|
||||||
CList<CModule>::iterator a = g_modules.find( pathname );
|
CList<CModule>::iterator a = g_modules.find( pathname );
|
||||||
|
|
||||||
@ -476,8 +476,8 @@ void dettachMetaModModules( const char* filename )
|
|||||||
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char* pathname = build_pathname_addons("addons/amxx/modules/%s", line);
|
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
|
||||||
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line);
|
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
|
||||||
|
|
||||||
module = DLLOAD( pathname ); // link dll
|
module = DLLOAD( pathname ); // link dll
|
||||||
|
|
||||||
@ -520,8 +520,8 @@ void attachMetaModModules( const char* filename )
|
|||||||
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char* pathname = build_pathname("addons/amxx/modules/%s", line);
|
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
|
||||||
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line);
|
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
|
||||||
module = DLLOAD( pathname ); // link dll
|
module = DLLOAD( pathname ); // link dll
|
||||||
|
|
||||||
if ( module )
|
if ( module )
|
||||||
|
Loading…
Reference in New Issue
Block a user