Checkin missing chunks from bug 5680 (ref bug 5691).
authorDavid Anderson <dvander@alliedmods.net>
Sun Mar 31 22:03:57 2013 -0700 (2013-03-31)
changeset 38827dae5b0b8e28
parent 3881 7ec742e7d629
child 3883 ee82b6ecc09d
Checkin missing chunks from bug 5680 (ref bug 5691).
core/logic/ExtensionSys.cpp
core/logic/ExtensionSys.h
core/logic/intercom.h
core/logic_bridge.cpp
     1.1 --- a/core/logic/ExtensionSys.cpp	Sun Mar 31 13:30:22 2013 -0700
     1.2 +++ b/core/logic/ExtensionSys.cpp	Sun Mar 31 22:03:57 2013 -0700
     1.3 @@ -58,38 +58,6 @@
     1.4  	m_pAPI = pAPI;
     1.5  }
     1.6  
     1.7 -#if defined METAMOD_PLAPI_VERSION
     1.8 -#if SOURCE_ENGINE == SE_LEFT4DEAD
     1.9 -#define GAMEFIX "2.l4d"
    1.10 -#elif SOURCE_ENGINE == SE_LEFT4DEAD2
    1.11 -#define GAMEFIX "2.l4d2"
    1.12 -#elif SOURCE_ENGINE == SE_ALIENSWARM
    1.13 -#define GAMEFIX "2.swarm"
    1.14 -#elif SOURCE_ENGINE == SE_ORANGEBOX
    1.15 -#define GAMEFIX "2.ep2"
    1.16 -#elif SOURCE_ENGINE == SE_BLOODYGOODTIME
    1.17 -#define GAMEFIX "2.bgt"
    1.18 -#elif SOURCE_ENGINE == SE_EYE
    1.19 -#define GAMEFIX "2.eye"
    1.20 -#elif SOURCE_ENGINE == SE_CSS
    1.21 -#define GAMEFIX "2.css"
    1.22 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
    1.23 -#define GAMEFIX "2.ep2v"
    1.24 -#elif SOURCE_ENGINE == SE_DARKMESSIAH
    1.25 -#define GAMEFIX "2.darkm"
    1.26 -#elif SOURCE_ENGINE == SE_PORTAL2
    1.27 -#define GAMEFIX "2.portal2"
    1.28 -#elif SOURCE_ENGINE == SE_CSGO
    1.29 -#define GAMEFIX "2.csgo"
    1.30 -#elif SOURCE_ENGINE == SE_DOTA
    1.31 -#define GAMEFIX "2.dota"
    1.32 -#else
    1.33 -#define GAMEFIX "2.ep1"
    1.34 -#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
    1.35 -#else  //METAMOD_PLAPI_VERSION
    1.36 -#define GAMEFIX "1.ep1"
    1.37 -#endif //METAMOD_PLAPI_VERSION
    1.38 -
    1.39  CLocalExtension::CLocalExtension(const char *filename)
    1.40  {
    1.41  	m_PlId = 0;
    1.42 @@ -107,8 +75,9 @@
    1.43  	g_pSM->BuildPath(Path_SM,
    1.44  		path,
    1.45  		PLATFORM_MAX_PATH,
    1.46 -		"extensions/%s." GAMEFIX "." PLATFORM_LIB_EXT,
    1.47 -		filename);
    1.48 +		"extensions/%s.%s." PLATFORM_LIB_EXT,
    1.49 +		filename,
    1.50 +		smcore.gamesuffix);
    1.51  
    1.52  	if (libsys->IsPathFile(path))
    1.53  	{
    1.54 @@ -119,8 +88,9 @@
    1.55  	g_pSM->BuildPath(Path_SM, 
    1.56  		path, 
    1.57  		PLATFORM_MAX_PATH,
    1.58 -		"extensions/auto." GAMEFIX "/%s." PLATFORM_LIB_EXT,
    1.59 -		filename);
    1.60 +		"extensions/auto.%s/%s." PLATFORM_LIB_EXT,
    1.61 +		filename,
    1.62 +		smcore.gamesuffix);
    1.63  
    1.64  	/* Try the "normal" version */
    1.65  	if (!libsys->IsPathFile(path))
    1.66 @@ -509,11 +479,13 @@
    1.67  {
    1.68  	g_ExtType = g_ShareSys.CreateIdentType("EXTENSION");
    1.69  	pluginsys->AddPluginsListener(this);
    1.70 +	rootmenu->AddRootConsoleCommand("exts", "Manage extensions", this);
    1.71  	g_ShareSys.AddInterface(NULL, this);
    1.72  }
    1.73  
    1.74  void CExtensionManager::OnSourceModShutdown()
    1.75  {
    1.76 +	rootmenu->RemoveRootConsoleCommand("exts", this);
    1.77  	pluginsys->RemovePluginsListener(this);
    1.78  	g_ShareSys.DestroyIdentType(g_ExtType);
    1.79  }
     2.1 --- a/core/logic/ExtensionSys.h	Sun Mar 31 13:30:22 2013 -0700
     2.2 +++ b/core/logic/ExtensionSys.h	Sun Mar 31 22:03:57 2013 -0700
     2.3 @@ -138,7 +138,8 @@
     2.4  class CExtensionManager : 
     2.5  	public IExtensionSys,
     2.6  	public SMGlobalClass,
     2.7 -	public IPluginsListener
     2.8 +	public IPluginsListener,
     2.9 +	public IRootConsoleCommand
    2.10  {
    2.11  public:
    2.12  	CExtensionManager();
     3.1 --- a/core/logic/intercom.h	Sun Mar 31 13:30:22 2013 -0700
     3.2 +++ b/core/logic/intercom.h	Sun Mar 31 22:03:57 2013 -0700
     3.3 @@ -49,7 +49,7 @@
     3.4   * Add 1 to the RHS of this expression to bump the intercom file
     3.5   * This is to prevent mismatching core/logic binaries
     3.6   */
     3.7 -#define SM_LOGIC_MAGIC		(0x0F47C0DE - 20)
     3.8 +#define SM_LOGIC_MAGIC		(0x0F47C0DE - 21)
     3.9  
    3.10  #if defined SM_LOGIC
    3.11  class IVEngineServer
    3.12 @@ -248,6 +248,7 @@
    3.13  	void			(*DoGlobalPluginLoads)();
    3.14  	bool			(*AreConfigsExecuted)();
    3.15  	void			(*ExecuteConfigs)(IPluginContext *ctx);
    3.16 +	const char		*gamesuffix;
    3.17  	/* Data */
    3.18  	ServerGlobals   *serverGlobals;
    3.19  	void *          serverFactory;
     4.1 --- a/core/logic_bridge.cpp	Sun Mar 31 13:30:22 2013 -0700
     4.2 +++ b/core/logic_bridge.cpp	Sun Mar 31 22:03:57 2013 -0700
     4.3 @@ -283,6 +283,38 @@
     4.4  	g_SourceMod.DoGlobalPluginLoads();
     4.5  }
     4.6  
     4.7 +#if defined METAMOD_PLAPI_VERSION
     4.8 +#if SOURCE_ENGINE == SE_LEFT4DEAD
     4.9 +#define GAMEFIX "2.l4d"
    4.10 +#elif SOURCE_ENGINE == SE_LEFT4DEAD2
    4.11 +#define GAMEFIX "2.l4d2"
    4.12 +#elif SOURCE_ENGINE == SE_ALIENSWARM
    4.13 +#define GAMEFIX "2.swarm"
    4.14 +#elif SOURCE_ENGINE == SE_ORANGEBOX
    4.15 +#define GAMEFIX "2.ep2"
    4.16 +#elif SOURCE_ENGINE == SE_BLOODYGOODTIME
    4.17 +#define GAMEFIX "2.bgt"
    4.18 +#elif SOURCE_ENGINE == SE_EYE
    4.19 +#define GAMEFIX "2.eye"
    4.20 +#elif SOURCE_ENGINE == SE_CSS
    4.21 +#define GAMEFIX "2.css"
    4.22 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
    4.23 +#define GAMEFIX "2.ep2v"
    4.24 +#elif SOURCE_ENGINE == SE_DARKMESSIAH
    4.25 +#define GAMEFIX "2.darkm"
    4.26 +#elif SOURCE_ENGINE == SE_PORTAL2
    4.27 +#define GAMEFIX "2.portal2"
    4.28 +#elif SOURCE_ENGINE == SE_CSGO
    4.29 +#define GAMEFIX "2.csgo"
    4.30 +#elif SOURCE_ENGINE == SE_DOTA
    4.31 +#define GAMEFIX "2.dota"
    4.32 +#else
    4.33 +#define GAMEFIX "2.ep1"
    4.34 +#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
    4.35 +#else  //METAMOD_PLAPI_VERSION
    4.36 +#define GAMEFIX "1.ep1"
    4.37 +#endif //METAMOD_PLAPI_VERSION
    4.38 +
    4.39  static ServerGlobals serverGlobals;
    4.40  
    4.41  static sm_core_t core_bridge =
    4.42 @@ -328,6 +360,7 @@
    4.43  	do_global_plugin_loads,
    4.44  	SM_AreConfigsExecuted,
    4.45  	SM_ExecuteForPlugin,
    4.46 +	GAMEFIX,
    4.47  	&serverGlobals
    4.48  };
    4.49