mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-21 14:54:14 +01:00
Ditch "source2" naming, restoring "dota".
This commit is contained in:
parent
4472cc4cc7
commit
366a27e10c
@ -32,13 +32,12 @@ PossibleSDKs = {
|
|||||||
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
|
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
|
||||||
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
|
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
|
||||||
'csgo': SDK('HL2SDKCSGO', '2.csgo', '20', 'CSGO', WinLinuxMac, 'csgo'),
|
'csgo': SDK('HL2SDKCSGO', '2.csgo', '20', 'CSGO', WinLinuxMac, 'csgo'),
|
||||||
'dota': SDK('HL2SDKDOTA', '2.dota', '21', 'DOTA', [], 'dota'),
|
'dota': SDK('HL2SDKDOTA', '2.dota', '21', 'DOTA', WinLinux, 'dota'),
|
||||||
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'),
|
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'),
|
||||||
'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'),
|
'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'),
|
||||||
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'),
|
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'),
|
||||||
'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'),
|
'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'),
|
||||||
'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'),
|
'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'),
|
||||||
'source2': SDK('HL2SDKSOURCE2', '2.source2', '22', 'SOURCE2', WinOnly, 'source2'),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def ResolveEnvPath(env, folder):
|
def ResolveEnvPath(env, folder):
|
||||||
@ -281,7 +280,7 @@ class MMSConfig(object):
|
|||||||
else:
|
else:
|
||||||
compiler.defines += ['COMPILER_GCC']
|
compiler.defines += ['COMPILER_GCC']
|
||||||
|
|
||||||
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'dota', 'source2']:
|
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'dota']:
|
||||||
if builder.target_platform in ['linux', 'mac']:
|
if builder.target_platform in ['linux', 'mac']:
|
||||||
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
|
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
|
||||||
|
|
||||||
@ -357,7 +356,7 @@ class MMSConfig(object):
|
|||||||
else:
|
else:
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'tier1_i486.a'))]
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'tier1_i486.a'))]
|
||||||
|
|
||||||
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota', 'source2']:
|
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
|
||||||
|
|
||||||
binary = self.LibraryBuilder(compiler, name)
|
binary = self.LibraryBuilder(compiler, name)
|
||||||
@ -367,7 +366,7 @@ class MMSConfig(object):
|
|||||||
compiler.linkflags[0:0] = ['-lm']
|
compiler.linkflags[0:0] = ['-lm']
|
||||||
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency']:
|
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency']:
|
||||||
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
|
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
|
||||||
elif sdk.name in ['l4d', 'blade', 'insurgency', 'csgo', 'dota', 'source2']:
|
elif sdk.name in ['l4d', 'blade', 'insurgency', 'csgo', 'dota']:
|
||||||
dynamic_libs = ['libtier0.so', 'libvstdlib.so']
|
dynamic_libs = ['libtier0.so', 'libvstdlib.so']
|
||||||
else:
|
else:
|
||||||
dynamic_libs = ['tier0_i486.so', 'vstdlib_i486.so']
|
dynamic_libs = ['tier0_i486.so', 'vstdlib_i486.so']
|
||||||
@ -376,7 +375,7 @@ class MMSConfig(object):
|
|||||||
dynamic_libs = ['libtier0.dylib', 'libvstdlib.dylib']
|
dynamic_libs = ['libtier0.dylib', 'libvstdlib.dylib']
|
||||||
elif builder.target_platform == 'windows':
|
elif builder.target_platform == 'windows':
|
||||||
libs = ['tier0', 'tier1', 'vstdlib']
|
libs = ['tier0', 'tier1', 'vstdlib']
|
||||||
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota', 'source2']:
|
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
|
||||||
libs.append('interfaces')
|
libs.append('interfaces')
|
||||||
for lib in libs:
|
for lib in libs:
|
||||||
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
#define SOURCE_ENGINE_INSURGENCY 21 /**< Insurgency */
|
#define SOURCE_ENGINE_INSURGENCY 21 /**< Insurgency */
|
||||||
#define SOURCE_ENGINE_CONTAGION 22 /**< Contagion */
|
#define SOURCE_ENGINE_CONTAGION 22 /**< Contagion */
|
||||||
#define SOURCE_ENGINE_BMS 23 /**< Black Mesa Multiplayer */
|
#define SOURCE_ENGINE_BMS 23 /**< Black Mesa Multiplayer */
|
||||||
#define SOURCE_ENGINE_SOURCE2 24
|
|
||||||
|
|
||||||
#define METAMOD_PLAPI_VERSION 15 /**< Version of this header file */
|
#define METAMOD_PLAPI_VERSION 15 /**< Version of this header file */
|
||||||
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */
|
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
SourceHook::MemFuncInfo mfi;
|
SourceHook::MemFuncInfo mfi;
|
||||||
|
|
||||||
mfi.isVirtual = false;
|
mfi.isVirtual = false;
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SourceHook::GetFuncInfo(&IServerGameDLL::Shutdown, mfi);
|
SourceHook::GetFuncInfo(&IServerGameDLL::Shutdown, mfi);
|
||||||
#else
|
#else
|
||||||
SourceHook::GetFuncInfo(&IServerGameDLL::DLLShutdown, mfi);
|
SourceHook::GetFuncInfo(&IServerGameDLL::DLLShutdown, mfi);
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#if defined __linux__
|
#if defined __linux__
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
#include <iserver.h>
|
#include <iserver.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ using namespace SourceHook::Impl;
|
|||||||
* @file sourcemm.cpp
|
* @file sourcemm.cpp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
// Hack to make hook decl compile when only having forward decl in header.
|
// Hack to make hook decl compile when only having forward decl in header.
|
||||||
// (we have class structure but it requires protobuf which we don't want to include here)
|
// (we have class structure but it requires protobuf which we don't want to include here)
|
||||||
class GameSessionConfiguration_t { };
|
class GameSessionConfiguration_t { };
|
||||||
@ -189,7 +189,7 @@ mm_InitializeForLoad()
|
|||||||
*/
|
*/
|
||||||
in_first_level = true;
|
in_first_level = true;
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SourceHook::MemFuncInfo info;
|
SourceHook::MemFuncInfo info;
|
||||||
|
|
||||||
if (!provider->GetHookInfo(ProvidedHook_StartupServer, &info))
|
if (!provider->GetHookInfo(ProvidedHook_StartupServer, &info))
|
||||||
@ -537,7 +537,7 @@ mm_HandleGameInit()
|
|||||||
if (is_game_init)
|
if (is_game_init)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
Msg("MMS: GameInit\n");
|
Msg("MMS: GameInit\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -557,7 +557,7 @@ mm_HandleGameInit()
|
|||||||
static void
|
static void
|
||||||
mm_HandleLevelShutdown()
|
mm_HandleLevelShutdown()
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
Msg("MMS: LevelShutdown\n");
|
Msg("MMS: LevelShutdown\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -601,14 +601,14 @@ char const *pLandmarkName,
|
|||||||
bool loadGame,
|
bool loadGame,
|
||||||
bool background)
|
bool background)
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
Msg("MMS: LevelInit\n");
|
Msg("MMS: LevelInit\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ITER_EVENT(OnLevelInit, (pMapName, pMapEntities, pOldLevel, pLandmarkName, loadGame, background));
|
ITER_EVENT(OnLevelInit, (pMapName, pMapEntities, pOldLevel, pLandmarkName, loadGame, background));
|
||||||
}
|
}
|
||||||
#include <utlbuffer.h>
|
#include <utlbuffer.h>
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
static void
|
static void
|
||||||
Handler_SwitchToLoop(const char *pszLoopName, KeyValues *pKV, uint32 nId, const char *pszUnk, bool bUnk)
|
Handler_SwitchToLoop(const char *pszLoopName, KeyValues *pKV, uint32 nId, const char *pszUnk, bool bUnk)
|
||||||
{
|
{
|
||||||
@ -943,7 +943,7 @@ size_t MetamodSource::PathFormat(char *buffer, size_t len, const char *fmt, ...)
|
|||||||
return mylen;
|
return mylen;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
void MetamodSource::ClientConPrintf(int clientIndex, const char *fmt, ...)
|
void MetamodSource::ClientConPrintf(int clientIndex, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -76,7 +76,7 @@ public:
|
|||||||
void *InterfaceSearch(CreateInterfaceFn fn, const char *iface, int max, int *ret);
|
void *InterfaceSearch(CreateInterfaceFn fn, const char *iface, int max, int *ret);
|
||||||
const char *GetBaseDir();
|
const char *GetBaseDir();
|
||||||
size_t PathFormat(char *buffer, size_t len, const char *fmt, ...);
|
size_t PathFormat(char *buffer, size_t len, const char *fmt, ...);
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
// Shim
|
// Shim
|
||||||
void ClientConPrintf(int clientIndex, const char *fmt, ...);
|
void ClientConPrintf(int clientIndex, const char *fmt, ...);
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,7 +44,7 @@ using namespace SourceHook;
|
|||||||
#define CLIENT_CONMSG g_Metamod.ClientConPrintf
|
#define CLIENT_CONMSG g_Metamod.ClientConPrintf
|
||||||
template <typename ... Ts>
|
template <typename ... Ts>
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
void CMDMSG(int client, const char *pMsg, Ts ... ts)
|
void CMDMSG(int client, const char *pMsg, Ts ... ts)
|
||||||
#else
|
#else
|
||||||
void CMDMSG(edict_t *client, const char *pMsg, Ts ... ts)
|
void CMDMSG(edict_t *client, const char *pMsg, Ts ... ts)
|
||||||
@ -100,13 +100,11 @@ void CMDMSG(edict_t *client, const char *pMsg, Ts ... ts)
|
|||||||
#define MMS_ENGINE_NAME "Counter-Strike: Global Offensive (2012)"
|
#define MMS_ENGINE_NAME "Counter-Strike: Global Offensive (2012)"
|
||||||
#elif SOURCE_ENGINE == SE_DOTA
|
#elif SOURCE_ENGINE == SE_DOTA
|
||||||
#define MMS_ENGINE_NAME "Dota 2 (2013)"
|
#define MMS_ENGINE_NAME "Dota 2 (2013)"
|
||||||
#elif SOURCE_ENGINE == SE_SOURCE2
|
|
||||||
#define MMS_ENGINE_NAME "Source 2"
|
|
||||||
#else
|
#else
|
||||||
#error "SOURCE_ENGINE not defined to a known value"
|
#error "SOURCE_ENGINE not defined to a known value"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
static void ReplyCredits(int client = 0)
|
static void ReplyCredits(int client = 0)
|
||||||
#else
|
#else
|
||||||
static void ReplyCredits(edict_t *client = nullptr)
|
static void ReplyCredits(edict_t *client = nullptr)
|
||||||
@ -120,7 +118,7 @@ static void ReplyCredits(edict_t *client = nullptr)
|
|||||||
CMDMSG(client, "http://www.metamodsource.net/\n");
|
CMDMSG(client, "http://www.metamodsource.net/\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
static void ReplyVersion(int client = 0)
|
static void ReplyVersion(int client = 0)
|
||||||
#else
|
#else
|
||||||
static void ReplyVersion(edict_t *client = nullptr)
|
static void ReplyVersion(edict_t *client = nullptr)
|
||||||
@ -700,7 +698,7 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
bool Command_ClientMeta(int client, IMetamodSourceCommandInfo *info)
|
bool Command_ClientMeta(int client, IMetamodSourceCommandInfo *info)
|
||||||
#else
|
#else
|
||||||
bool Command_ClientMeta(edict_t *client, IMetamodSourceCommandInfo *info)
|
bool Command_ClientMeta(edict_t *client, IMetamodSourceCommandInfo *info)
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "metamod_provider.h"
|
#include "metamod_provider.h"
|
||||||
|
|
||||||
bool Command_Meta(IMetamodSourceCommandInfo *info);
|
bool Command_Meta(IMetamodSourceCommandInfo *info);
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
bool Command_ClientMeta(int client, IMetamodSourceCommandInfo *info);
|
bool Command_ClientMeta(int client, IMetamodSourceCommandInfo *info);
|
||||||
#else
|
#else
|
||||||
bool Command_ClientMeta(edict_t *client, IMetamodSourceCommandInfo *info);
|
bool Command_ClientMeta(edict_t *client, IMetamodSourceCommandInfo *info);
|
||||||
|
@ -37,7 +37,7 @@ namespace SourceMM
|
|||||||
|
|
||||||
enum ProvidedHooks
|
enum ProvidedHooks
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
ProvidedHook_StartChangeLevel = 0,
|
ProvidedHook_StartChangeLevel = 0,
|
||||||
ProvidedHook_Init = 1,
|
ProvidedHook_Init = 1,
|
||||||
ProvidedHook_StartupServer = 2,
|
ProvidedHook_StartupServer = 2,
|
||||||
|
@ -39,11 +39,11 @@
|
|||||||
#include <filesystem.h>
|
#include <filesystem.h>
|
||||||
#include "metamod.h"
|
#include "metamod.h"
|
||||||
#include <tier1/KeyValues.h>
|
#include <tier1/KeyValues.h>
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
#include <iserver.h>
|
#include <iserver.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SH_DECL_HOOK1(ISource2ServerConfig, AllowDedicatedServers, const, 0, bool, EUniverse);
|
SH_DECL_HOOK1(ISource2ServerConfig, AllowDedicatedServers, const, 0, bool, EUniverse);
|
||||||
bool BaseProvider::AllowDedicatedServers(EUniverse universe) const
|
bool BaseProvider::AllowDedicatedServers(EUniverse universe) const
|
||||||
{
|
{
|
||||||
@ -74,23 +74,18 @@ DLL_IMPORT ICommandLine *CommandLine();
|
|||||||
/* Functions */
|
/* Functions */
|
||||||
void CacheUserMessages();
|
void CacheUserMessages();
|
||||||
void Detour_Error(const tchar *pMsg, ...);
|
void Detour_Error(const tchar *pMsg, ...);
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
|
||||||
void ClientCommand(CEntityIndex index, const CCommand &args);
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
void LocalCommand_Meta(const CCommandContext &context, const CCommand &args);
|
void ClientCommand(CEntityIndex index, const CCommand &args);
|
||||||
#else
|
|
||||||
void LocalCommand_Meta(const CCommand &args);
|
|
||||||
#endif
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
|
||||||
void meta_game_init(const CCommand &args);
|
|
||||||
void meta_level_init(const CCommand &args);
|
|
||||||
void meta_level_shutdown(const CCommand &args);
|
|
||||||
#endif
|
|
||||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
void ClientCommand(edict_t *pEdict, const CCommand &args);
|
void ClientCommand(edict_t *pEdict, const CCommand &args);
|
||||||
void LocalCommand_Meta(const CCommand &args);
|
|
||||||
#else
|
#else
|
||||||
void ClientCommand(edict_t *pEdict);
|
void ClientCommand(edict_t *pEdict);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
|
void LocalCommand_Meta(const CCommand &args);
|
||||||
|
#else
|
||||||
void LocalCommand_Meta();
|
void LocalCommand_Meta();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -104,7 +99,7 @@ static jmp_buf usermsg_end;
|
|||||||
ICvar *icvar = NULL;
|
ICvar *icvar = NULL;
|
||||||
IFileSystem *baseFs = NULL;
|
IFileSystem *baseFs = NULL;
|
||||||
IServerGameDLL *server = NULL;
|
IServerGameDLL *server = NULL;
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
static ISource2ServerConfig *serverconfig = NULL;
|
static ISource2ServerConfig *serverconfig = NULL;
|
||||||
INetworkServerService *netservice = NULL;
|
INetworkServerService *netservice = NULL;
|
||||||
IEngineServiceMgr *enginesvcmgr = NULL;
|
IEngineServiceMgr *enginesvcmgr = NULL;
|
||||||
@ -115,7 +110,7 @@ CGlobalVars *gpGlobals = NULL;
|
|||||||
IMetamodSourceProvider *provider = &g_Ep1Provider;
|
IMetamodSourceProvider *provider = &g_Ep1Provider;
|
||||||
ConCommand meta_local_cmd("meta", LocalCommand_Meta, "Metamod:Source control options");
|
ConCommand meta_local_cmd("meta", LocalCommand_Meta, "Metamod:Source control options");
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, CEntityIndex, const CCommand &);
|
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, CEntityIndex, const CCommand &);
|
||||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
||||||
@ -154,7 +149,7 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
|
|||||||
DisplayError("Could not find IVEngineServer! Metamod cannot load.");
|
DisplayError("Could not find IVEngineServer! Metamod cannot load.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
gpGlobals = engine->GetServerGlobals();
|
gpGlobals = engine->GetServerGlobals();
|
||||||
serverconfig = (ISource2ServerConfig *) ((serverFactory) (INTERFACEVERSION_SERVERCONFIG, NULL));
|
serverconfig = (ISource2ServerConfig *) ((serverFactory) (INTERFACEVERSION_SERVERCONFIG, NULL));
|
||||||
netservice = (INetworkServerService *) ((engineFactory) (NETWORKSERVERSERVICE_INTERFACE_VERSION, NULL));
|
netservice = (INetworkServerService *) ((engineFactory) (NETWORKSERVERSERVICE_INTERFACE_VERSION, NULL));
|
||||||
@ -171,7 +166,7 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
gameclients = (IServerGameClients *)(serverFactory(INTERFACEVERSION_SERVERGAMECLIENTS, NULL));
|
gameclients = (IServerGameClients *)(serverFactory(INTERFACEVERSION_SERVERGAMECLIENTS, NULL));
|
||||||
#else
|
#else
|
||||||
if ((gameclients = (IServerGameClients *)(serverFactory("ServerGameClients003", NULL)))
|
if ((gameclients = (IServerGameClients *)(serverFactory("ServerGameClients003", NULL)))
|
||||||
@ -187,7 +182,7 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
|
|||||||
mm_LogMessage("Unable to find \"%s\": .vdf files will not be parsed", FILESYSTEM_INTERFACE_VERSION);
|
mm_LogMessage("Unable to find \"%s\": .vdf files will not be parsed", FILESYSTEM_INTERFACE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
// Since we have to be added as a Game path (cannot add GameBin directly), we
|
// Since we have to be added as a Game path (cannot add GameBin directly), we
|
||||||
// automatically get added to other paths as well, including having the MM:S
|
// automatically get added to other paths as well, including having the MM:S
|
||||||
// dir become the default write path for logs and more. We can fix some of these.
|
// dir become the default write path for logs and more. We can fix some of these.
|
||||||
@ -244,7 +239,7 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
|
|||||||
SH_ADD_HOOK_STATICFUNC(IServerGameClients, ClientCommand, gameclients, ClientCommand, false);
|
SH_ADD_HOOK_STATICFUNC(IServerGameClients, ClientCommand, gameclients, ClientCommand, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SH_ADD_VPHOOK(ISource2ServerConfig, AllowDedicatedServers, serverconfig, SH_MEMBER(this, &BaseProvider::AllowDedicatedServers), false);
|
SH_ADD_VPHOOK(ISource2ServerConfig, AllowDedicatedServers, serverconfig, SH_MEMBER(this, &BaseProvider::AllowDedicatedServers), false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -269,7 +264,7 @@ bool BaseProvider::IsRemotePrintingAvailable()
|
|||||||
|
|
||||||
void BaseProvider::ClientConsolePrint(edict_t *pEdict, const char *message)
|
void BaseProvider::ClientConsolePrint(edict_t *pEdict, const char *message)
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
int client = (int)(pEdict - gpGlobals->pEdicts);
|
int client = (int)(pEdict - gpGlobals->pEdicts);
|
||||||
engine->ClientPrintf(client, message);
|
engine->ClientPrintf(client, message);
|
||||||
#else
|
#else
|
||||||
@ -353,7 +348,7 @@ bool BaseProvider::LogMessage(const char *buffer)
|
|||||||
|
|
||||||
bool BaseProvider::GetHookInfo(ProvidedHooks hook, SourceHook::MemFuncInfo *pInfo)
|
bool BaseProvider::GetHookInfo(ProvidedHooks hook, SourceHook::MemFuncInfo *pInfo)
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SourceHook::MemFuncInfo mfi = {true, -1, 0, 0};
|
SourceHook::MemFuncInfo mfi = {true, -1, 0, 0};
|
||||||
|
|
||||||
switch (hook)
|
switch (hook)
|
||||||
@ -411,7 +406,7 @@ void BaseProvider::DisplayError(const char *fmt, ...)
|
|||||||
UTIL_FormatArgs(buffer, sizeof(buffer), fmt, ap);
|
UTIL_FormatArgs(buffer, sizeof(buffer), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
Msg("ERROR: %s", buffer);
|
Msg("ERROR: %s", buffer);
|
||||||
#else
|
#else
|
||||||
Error("%s", buffer);
|
Error("%s", buffer);
|
||||||
@ -447,7 +442,7 @@ void BaseProvider::UnregisterConCommandBase(ConCommandBase *pCommand)
|
|||||||
|
|
||||||
int BaseProvider::GetUserMessageCount()
|
int BaseProvider::GetUserMessageCount()
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
return (int)usermsgs_list.size();
|
return (int)usermsgs_list.size();
|
||||||
@ -493,7 +488,7 @@ void BaseProvider::GetGamePath(char *pszBuffer, int len)
|
|||||||
|
|
||||||
const char *BaseProvider::GetGameDescription()
|
const char *BaseProvider::GetGameDescription()
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
return serverconfig->GetGameDescription();
|
return serverconfig->GetGameDescription();
|
||||||
#else
|
#else
|
||||||
return server->GetGameDescription();
|
return server->GetGameDescription();
|
||||||
@ -542,8 +537,6 @@ int BaseProvider::DetermineSourceEngine()
|
|||||||
return SOURCE_ENGINE_DOTA;
|
return SOURCE_ENGINE_DOTA;
|
||||||
#elif SOURCE_ENGINE == SE_BMS
|
#elif SOURCE_ENGINE == SE_BMS
|
||||||
return SOURCE_ENGINE_BMS;
|
return SOURCE_ENGINE_BMS;
|
||||||
#elif SOURCE_ENGINE == SE_SOURCE2
|
|
||||||
return SOURCE_ENGINE_SOURCE2;
|
|
||||||
#else
|
#else
|
||||||
#error "SOURCE_ENGINE not defined to a known value"
|
#error "SOURCE_ENGINE not defined to a known value"
|
||||||
#endif
|
#endif
|
||||||
@ -657,11 +650,7 @@ public:
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA// || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
void LocalCommand_Meta(const CCommandContext &context, const CCommand &args)
|
|
||||||
{
|
|
||||||
GlobCommand cmd(&args);
|
|
||||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
|
||||||
void LocalCommand_Meta(const CCommand &args)
|
void LocalCommand_Meta(const CCommand &args)
|
||||||
{
|
{
|
||||||
GlobCommand cmd(&args);
|
GlobCommand cmd(&args);
|
||||||
@ -673,7 +662,7 @@ void LocalCommand_Meta()
|
|||||||
Command_Meta(&cmd);
|
Command_Meta(&cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
void ClientCommand(CEntityIndex index, const CCommand &_cmd)
|
void ClientCommand(CEntityIndex index, const CCommand &_cmd)
|
||||||
{
|
{
|
||||||
int client = index.Get();
|
int client = index.Get();
|
||||||
@ -696,7 +685,7 @@ void ClientCommand(edict_t *client)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
|
||||||
|
|
||||||
void CacheUserMessages()
|
void CacheUserMessages()
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <sourcehook.h>
|
#include <sourcehook.h>
|
||||||
#include <sh_memfuncinfo.h>
|
#include <sh_memfuncinfo.h>
|
||||||
#if SOURCE_ENGINE != SE_SOURCE2
|
#if SOURCE_ENGINE != SE_DOTA
|
||||||
#include <iserverplugin.h>
|
#include <iserverplugin.h>
|
||||||
#endif
|
#endif
|
||||||
#include "ISmmAPI.h"
|
#include "ISmmAPI.h"
|
||||||
@ -81,7 +81,7 @@ public:
|
|||||||
virtual const char *GetUserMessage(int index, int *size=NULL);
|
virtual const char *GetUserMessage(int index, int *size=NULL);
|
||||||
virtual int DetermineSourceEngine();
|
virtual int DetermineSourceEngine();
|
||||||
virtual bool ProcessVDF(const char *file, char path[], size_t path_len, char alias[], size_t alias_len);
|
virtual bool ProcessVDF(const char *file, char path[], size_t path_len, char alias[], size_t alias_len);
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
bool AllowDedicatedServers(EUniverse universe) const;
|
bool AllowDedicatedServers(EUniverse universe) const;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -91,7 +91,7 @@ extern IServerGameDLL *server;
|
|||||||
extern IServerGameClients *gameclients;
|
extern IServerGameClients *gameclients;
|
||||||
extern ICvar *icvar;
|
extern ICvar *icvar;
|
||||||
extern CGlobalVars *gpGlobals;
|
extern CGlobalVars *gpGlobals;
|
||||||
#if SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
extern INetworkServerService *netservice;
|
extern INetworkServerService *netservice;
|
||||||
extern IEngineServiceMgr *enginesvcmgr;
|
extern IEngineServiceMgr *enginesvcmgr;
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <sh_string.h>
|
#include <sh_string.h>
|
||||||
#include "provider/provider_ep2.h"
|
#include "provider/provider_ep2.h"
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
SH_DECL_HOOK2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
|
SH_DECL_HOOK2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
|
||||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
|
SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
|
||||||
@ -46,7 +46,7 @@ ConCommand *g_plugin_unload = NULL;
|
|||||||
bool g_bIsTryingToUnload;
|
bool g_bIsTryingToUnload;
|
||||||
SourceHook::String vsp_desc("Metamod:Source");
|
SourceHook::String vsp_desc("Metamod:Source");
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
void InterceptPluginUnloads(const CCommandContext &context, const CCommand &args)
|
void InterceptPluginUnloads(const CCommandContext &context, const CCommand &args)
|
||||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
void InterceptPluginUnloads(const CCommand &args)
|
void InterceptPluginUnloads(const CCommand &args)
|
||||||
@ -57,7 +57,7 @@ void InterceptPluginUnloads()
|
|||||||
g_bIsTryingToUnload = true;
|
g_bIsTryingToUnload = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_SOURCE2
|
#if SOURCE_ENGINE == SE_DOTA
|
||||||
void InterceptPluginUnloads_Post(const CCommandContext &context, const CCommand &args)
|
void InterceptPluginUnloads_Post(const CCommandContext &context, const CCommand &args)
|
||||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
void InterceptPluginUnloads_Post(const CCommand &args)
|
void InterceptPluginUnloads_Post(const CCommand &args)
|
||||||
@ -165,7 +165,7 @@ public:
|
|||||||
virtual void Unload()
|
virtual void Unload()
|
||||||
{
|
{
|
||||||
// Source2 doesn't have the Error function (nor VSP support).
|
// Source2 doesn't have the Error function (nor VSP support).
|
||||||
#if SOURCE_ENGINE != SE_SOURCE2
|
#if SOURCE_ENGINE != SE_DOTA
|
||||||
if (g_bIsTryingToUnload)
|
if (g_bIsTryingToUnload)
|
||||||
{
|
{
|
||||||
Error("Metamod:Source cannot be unloaded from VSP mode. Use \"meta unload\" to unload specific plugins.\n");
|
Error("Metamod:Source cannot be unloaded from VSP mode. Use \"meta unload\" to unload specific plugins.\n");
|
||||||
|
@ -315,7 +315,7 @@ public:
|
|||||||
|
|
||||||
virtual InitReturnVal_t Init()
|
virtual InitReturnVal_t Init()
|
||||||
{
|
{
|
||||||
mm_backend = MMBackend_Source2;
|
mm_backend = MMBackend_DOTA;
|
||||||
|
|
||||||
char error[255];
|
char error[255];
|
||||||
if (!mm_LoadMetamodLibrary(mm_backend, error, sizeof(error)))
|
if (!mm_LoadMetamodLibrary(mm_backend, error, sizeof(error)))
|
||||||
|
@ -89,8 +89,7 @@ static const char *backend_names[] =
|
|||||||
"2.blade",
|
"2.blade",
|
||||||
"2.insurgency",
|
"2.insurgency",
|
||||||
"2.contagion",
|
"2.contagion",
|
||||||
"2.bms",
|
"2.bms"
|
||||||
"2.source2"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
|
@ -102,7 +102,6 @@ enum MetamodBackend
|
|||||||
MMBackend_Insurgency,
|
MMBackend_Insurgency,
|
||||||
MMBackend_Contagion,
|
MMBackend_Contagion,
|
||||||
MMBackend_BMS,
|
MMBackend_BMS,
|
||||||
MMBackend_Source2,
|
|
||||||
|
|
||||||
MMBackend_UNKNOWN
|
MMBackend_UNKNOWN
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user