mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-01-31 20:52:18 +01:00
Added support for Dota 2 (bug 5640).
This commit is contained in:
parent
afa0fcaa74
commit
0f2d7aa234
@ -31,6 +31,8 @@ class MMS:
|
|||||||
'name': 'EYE', 'platform': ['windows']}
|
'name': 'EYE', 'platform': ['windows']}
|
||||||
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '12',
|
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '12',
|
||||||
'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin']}
|
'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin']}
|
||||||
|
self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '13',
|
||||||
|
'name': 'DOTA', 'platform': ['windows']}
|
||||||
# self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '11',
|
# self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '11',
|
||||||
# 'name': 'PORTAL2', 'platform': ['windows']}
|
# 'name': 'PORTAL2', 'platform': ['windows']}
|
||||||
|
|
||||||
@ -58,6 +60,7 @@ class MMS:
|
|||||||
envvars['HL2SDK-SWARM'] = 'hl2sdk-swarm'
|
envvars['HL2SDK-SWARM'] = 'hl2sdk-swarm'
|
||||||
envvars['HL2SDK-BGT'] = 'hl2sdk-bgt'
|
envvars['HL2SDK-BGT'] = 'hl2sdk-bgt'
|
||||||
envvars['HL2SDK-EYE'] = 'hl2sdk-eye'
|
envvars['HL2SDK-EYE'] = 'hl2sdk-eye'
|
||||||
|
envvars['HL2SDK-DOTA'] = 'hl2sdk-dota'
|
||||||
|
|
||||||
# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
|
# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
|
||||||
def findDictByKey(dictionary, key, value):
|
def findDictByKey(dictionary, key, value):
|
||||||
@ -309,7 +312,7 @@ class MMS:
|
|||||||
job.AddCommand(SymlinkCommand(link, target))
|
job.AddCommand(SymlinkCommand(link, target))
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
elif AMBuild.target['platform'] == 'windows':
|
||||||
libs = ['tier0', 'tier1', 'vstdlib']
|
libs = ['tier0', 'tier1', 'vstdlib']
|
||||||
if sdk in ['swarm', 'csgo']:
|
if sdk in ['swarm', 'csgo', 'dota']:
|
||||||
libs.append('interfaces')
|
libs.append('interfaces')
|
||||||
for lib in libs:
|
for lib in libs:
|
||||||
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
|
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
|
||||||
@ -319,7 +322,7 @@ class MMS:
|
|||||||
def PostSetupHL2Job(self, job, builder, sdk):
|
def PostSetupHL2Job(self, job, builder, sdk):
|
||||||
if AMBuild.target['platform'] in ['linux', 'darwin']:
|
if AMBuild.target['platform'] in ['linux', 'darwin']:
|
||||||
builder.AddObjectFiles(['tier1_i486.a'])
|
builder.AddObjectFiles(['tier1_i486.a'])
|
||||||
if( sdk == 'csgo' ):
|
if( sdk in ['csgo', 'dota'] ):
|
||||||
builder.AddObjectFiles(['interfaces_i486.a'])
|
builder.AddObjectFiles(['interfaces_i486.a'])
|
||||||
|
|
||||||
def DefaultHL2Compiler(self, path, sdk, noLink = False):
|
def DefaultHL2Compiler(self, path, sdk, noLink = False):
|
||||||
@ -351,7 +354,7 @@ class MMS:
|
|||||||
|
|
||||||
compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
|
compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
|
||||||
|
|
||||||
if sdk in ['swarm', 'csgo']:
|
if sdk in ['swarm', 'csgo', 'dota']:
|
||||||
if AMBuild.target['platform'] == 'windows':
|
if AMBuild.target['platform'] == 'windows':
|
||||||
compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
|
compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
|
||||||
else:
|
else:
|
||||||
|
@ -56,6 +56,7 @@ enum
|
|||||||
#define SOURCE_ENGINE_PORTAL2 11 /**< Portal 2 */
|
#define SOURCE_ENGINE_PORTAL2 11 /**< Portal 2 */
|
||||||
#define SOURCE_ENGINE_CSGO 12 /**< Counter-Strike: Global Offensive */
|
#define SOURCE_ENGINE_CSGO 12 /**< Counter-Strike: Global Offensive */
|
||||||
#define SOURCE_ENGINE_CSS 13 /**< Counter-Strike: Source (sometimes older version of Orange Box Valve) */
|
#define SOURCE_ENGINE_CSS 13 /**< Counter-Strike: Source (sometimes older version of Orange Box Valve) */
|
||||||
|
#define SOURCE_ENGINE_DOTA 14 /**< Dota 2 */
|
||||||
|
|
||||||
#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 */
|
||||||
|
@ -133,6 +133,8 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
|
|||||||
CONMSG(" Engine: Portal 2 (2011)\n");
|
CONMSG(" Engine: Portal 2 (2011)\n");
|
||||||
#elif SOURCE_ENGINE == SE_CSGO
|
#elif SOURCE_ENGINE == SE_CSGO
|
||||||
CONMSG(" Engine: Counter-Strike: Global Offensive (2012)\n");
|
CONMSG(" Engine: Counter-Strike: Global Offensive (2012)\n");
|
||||||
|
#elif SOURCE_ENGINE == SE_DOTA
|
||||||
|
CONMSG(" Engine: Dota 2 (2013)\n");
|
||||||
#else
|
#else
|
||||||
#error "SOURCE_ENGINE not defined to a known value"
|
#error "SOURCE_ENGINE not defined to a known value"
|
||||||
#endif
|
#endif
|
||||||
|
@ -315,7 +315,7 @@ void BaseProvider::UnregisterConCommandBase(ConCommandBase *pCommand)
|
|||||||
|
|
||||||
int BaseProvider::GetUserMessageCount()
|
int BaseProvider::GetUserMessageCount()
|
||||||
{
|
{
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#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();
|
||||||
@ -383,6 +383,8 @@ int BaseProvider::DetermineSourceEngine(const char *game)
|
|||||||
return SOURCE_ENGINE_PORTAL2;
|
return SOURCE_ENGINE_PORTAL2;
|
||||||
#elif SOURCE_ENGINE == SE_CSGO
|
#elif SOURCE_ENGINE == SE_CSGO
|
||||||
return SOURCE_ENGINE_CSGO;
|
return SOURCE_ENGINE_CSGO;
|
||||||
|
#elif SOURCE_ENGINE == SE_DOTA
|
||||||
|
return SOURCE_ENGINE_DOTA;
|
||||||
#else
|
#else
|
||||||
#error "SOURCE_ENGINE not defined to a known value"
|
#error "SOURCE_ENGINE not defined to a known value"
|
||||||
#endif
|
#endif
|
||||||
@ -526,7 +528,7 @@ void ClientCommand(edict_t *pEdict)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSGO
|
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
|
||||||
|
|
||||||
void CacheUserMessages()
|
void CacheUserMessages()
|
||||||
{
|
{
|
||||||
|
@ -81,7 +81,8 @@ static const char *backend_names[] =
|
|||||||
"2.l4d2",
|
"2.l4d2",
|
||||||
"2.swarm",
|
"2.swarm",
|
||||||
"2.portal2",
|
"2.portal2",
|
||||||
"2.csgo"
|
"2.csgo",
|
||||||
|
"2.dota",
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
@ -281,7 +282,10 @@ mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
|
|||||||
/* Check for L4D */
|
/* Check for L4D */
|
||||||
if (engineFactory("VEngineServer023", NULL) != NULL)
|
if (engineFactory("VEngineServer023", NULL) != NULL)
|
||||||
{
|
{
|
||||||
|
if (engineFactory("ISERVERPLUGINHELPERS001", NULL) != NULL)
|
||||||
return MMBackend_CSGO;
|
return MMBackend_CSGO;
|
||||||
|
else
|
||||||
|
return MMBackend_DOTA;
|
||||||
}
|
}
|
||||||
else if (engineFactory("VEngineServer022", NULL) != NULL &&
|
else if (engineFactory("VEngineServer022", NULL) != NULL &&
|
||||||
engineFactory("VEngineCvar007", NULL) != NULL)
|
engineFactory("VEngineCvar007", NULL) != NULL)
|
||||||
|
@ -92,6 +92,7 @@ enum MetamodBackend
|
|||||||
MMBackend_AlienSwarm,
|
MMBackend_AlienSwarm,
|
||||||
MMBackend_Portal2,
|
MMBackend_Portal2,
|
||||||
MMBackend_CSGO,
|
MMBackend_CSGO,
|
||||||
|
MMBackend_DOTA,
|
||||||
MMBackend_UNKNOWN
|
MMBackend_UNKNOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user