Checkin missing chunks from bug 5680 (ref bug 5691).

This commit is contained in:
David Anderson 2013-03-31 22:03:57 -07:00
parent 9b5ca124ab
commit 6cb67a19e7
4 changed files with 45 additions and 38 deletions

View File

@ -58,38 +58,6 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
m_pAPI = pAPI; m_pAPI = pAPI;
} }
#if defined METAMOD_PLAPI_VERSION
#if SOURCE_ENGINE == SE_LEFT4DEAD
#define GAMEFIX "2.l4d"
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
#define GAMEFIX "2.l4d2"
#elif SOURCE_ENGINE == SE_ALIENSWARM
#define GAMEFIX "2.swarm"
#elif SOURCE_ENGINE == SE_ORANGEBOX
#define GAMEFIX "2.ep2"
#elif SOURCE_ENGINE == SE_BLOODYGOODTIME
#define GAMEFIX "2.bgt"
#elif SOURCE_ENGINE == SE_EYE
#define GAMEFIX "2.eye"
#elif SOURCE_ENGINE == SE_CSS
#define GAMEFIX "2.css"
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
#define GAMEFIX "2.ep2v"
#elif SOURCE_ENGINE == SE_DARKMESSIAH
#define GAMEFIX "2.darkm"
#elif SOURCE_ENGINE == SE_PORTAL2
#define GAMEFIX "2.portal2"
#elif SOURCE_ENGINE == SE_CSGO
#define GAMEFIX "2.csgo"
#elif SOURCE_ENGINE == SE_DOTA
#define GAMEFIX "2.dota"
#else
#define GAMEFIX "2.ep1"
#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#else //METAMOD_PLAPI_VERSION
#define GAMEFIX "1.ep1"
#endif //METAMOD_PLAPI_VERSION
CLocalExtension::CLocalExtension(const char *filename) CLocalExtension::CLocalExtension(const char *filename)
{ {
m_PlId = 0; m_PlId = 0;
@ -107,8 +75,9 @@ CLocalExtension::CLocalExtension(const char *filename)
g_pSM->BuildPath(Path_SM, g_pSM->BuildPath(Path_SM,
path, path,
PLATFORM_MAX_PATH, PLATFORM_MAX_PATH,
"extensions/%s." GAMEFIX "." PLATFORM_LIB_EXT, "extensions/%s.%s." PLATFORM_LIB_EXT,
filename); filename,
smcore.gamesuffix);
if (libsys->IsPathFile(path)) if (libsys->IsPathFile(path))
{ {
@ -119,8 +88,9 @@ CLocalExtension::CLocalExtension(const char *filename)
g_pSM->BuildPath(Path_SM, g_pSM->BuildPath(Path_SM,
path, path,
PLATFORM_MAX_PATH, PLATFORM_MAX_PATH,
"extensions/auto." GAMEFIX "/%s." PLATFORM_LIB_EXT, "extensions/auto.%s/%s." PLATFORM_LIB_EXT,
filename); filename,
smcore.gamesuffix);
/* Try the "normal" version */ /* Try the "normal" version */
if (!libsys->IsPathFile(path)) if (!libsys->IsPathFile(path))
@ -509,11 +479,13 @@ void CExtensionManager::OnSourceModAllInitialized()
{ {
g_ExtType = g_ShareSys.CreateIdentType("EXTENSION"); g_ExtType = g_ShareSys.CreateIdentType("EXTENSION");
pluginsys->AddPluginsListener(this); pluginsys->AddPluginsListener(this);
rootmenu->AddRootConsoleCommand("exts", "Manage extensions", this);
g_ShareSys.AddInterface(NULL, this); g_ShareSys.AddInterface(NULL, this);
} }
void CExtensionManager::OnSourceModShutdown() void CExtensionManager::OnSourceModShutdown()
{ {
rootmenu->RemoveRootConsoleCommand("exts", this);
pluginsys->RemovePluginsListener(this); pluginsys->RemovePluginsListener(this);
g_ShareSys.DestroyIdentType(g_ExtType); g_ShareSys.DestroyIdentType(g_ExtType);
} }

View File

@ -138,7 +138,8 @@ public:
class CExtensionManager : class CExtensionManager :
public IExtensionSys, public IExtensionSys,
public SMGlobalClass, public SMGlobalClass,
public IPluginsListener public IPluginsListener,
public IRootConsoleCommand
{ {
public: public:
CExtensionManager(); CExtensionManager();

View File

@ -49,7 +49,7 @@ using namespace SourceHook;
* Add 1 to the RHS of this expression to bump the intercom file * Add 1 to the RHS of this expression to bump the intercom file
* This is to prevent mismatching core/logic binaries * This is to prevent mismatching core/logic binaries
*/ */
#define SM_LOGIC_MAGIC (0x0F47C0DE - 20) #define SM_LOGIC_MAGIC (0x0F47C0DE - 21)
#if defined SM_LOGIC #if defined SM_LOGIC
class IVEngineServer class IVEngineServer
@ -248,6 +248,7 @@ struct sm_core_t
void (*DoGlobalPluginLoads)(); void (*DoGlobalPluginLoads)();
bool (*AreConfigsExecuted)(); bool (*AreConfigsExecuted)();
void (*ExecuteConfigs)(IPluginContext *ctx); void (*ExecuteConfigs)(IPluginContext *ctx);
const char *gamesuffix;
/* Data */ /* Data */
ServerGlobals *serverGlobals; ServerGlobals *serverGlobals;
void * serverFactory; void * serverFactory;

View File

@ -283,6 +283,38 @@ void do_global_plugin_loads()
g_SourceMod.DoGlobalPluginLoads(); g_SourceMod.DoGlobalPluginLoads();
} }
#if defined METAMOD_PLAPI_VERSION
#if SOURCE_ENGINE == SE_LEFT4DEAD
#define GAMEFIX "2.l4d"
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
#define GAMEFIX "2.l4d2"
#elif SOURCE_ENGINE == SE_ALIENSWARM
#define GAMEFIX "2.swarm"
#elif SOURCE_ENGINE == SE_ORANGEBOX
#define GAMEFIX "2.ep2"
#elif SOURCE_ENGINE == SE_BLOODYGOODTIME
#define GAMEFIX "2.bgt"
#elif SOURCE_ENGINE == SE_EYE
#define GAMEFIX "2.eye"
#elif SOURCE_ENGINE == SE_CSS
#define GAMEFIX "2.css"
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
#define GAMEFIX "2.ep2v"
#elif SOURCE_ENGINE == SE_DARKMESSIAH
#define GAMEFIX "2.darkm"
#elif SOURCE_ENGINE == SE_PORTAL2
#define GAMEFIX "2.portal2"
#elif SOURCE_ENGINE == SE_CSGO
#define GAMEFIX "2.csgo"
#elif SOURCE_ENGINE == SE_DOTA
#define GAMEFIX "2.dota"
#else
#define GAMEFIX "2.ep1"
#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#else //METAMOD_PLAPI_VERSION
#define GAMEFIX "1.ep1"
#endif //METAMOD_PLAPI_VERSION
static ServerGlobals serverGlobals; static ServerGlobals serverGlobals;
static sm_core_t core_bridge = static sm_core_t core_bridge =
@ -328,6 +360,7 @@ static sm_core_t core_bridge =
do_global_plugin_loads, do_global_plugin_loads,
SM_AreConfigsExecuted, SM_AreConfigsExecuted,
SM_ExecuteForPlugin, SM_ExecuteForPlugin,
GAMEFIX,
&serverGlobals &serverGlobals
}; };