Permalink
Browse files

Improve automatic engine detection for some games (nobug, irc r=asher…

…kin).
  • Loading branch information...
psychonic committed Jan 7, 2014
1 parent 0e572c6 commit 0410bf47f55bb7291d76052f1de907c741439911
Showing with 12 additions and 9 deletions.
  1. +1 −1 loader/gamedll.cpp
  2. +9 −6 loader/loader.cpp
  3. +1 −1 loader/loader.h
  4. +1 −1 loader/serverplugin.cpp
View
@@ -213,7 +213,7 @@ class IServerGameDLL
QueryValveInterface fileSystemFactory,
void *pGlobals)
{
mm_backend = mm_DetermineBackend(engineFactory, game_name);
mm_backend = mm_DetermineBackend(engineFactory, gamedll_qvi, game_name);
char error[255];
if (mm_backend == MMBackend_UNKNOWN)
View
@@ -270,7 +270,7 @@ mm_GetGameName(char *buffer, size_t size)
}
MetamodBackend
mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
mm_DetermineBackend(QueryValveInterface engineFactory, QueryValveInterface serverFactory, const char *game_name)
{
if (engineFactory("VEngineServer024", NULL) != NULL)
{
@@ -287,14 +287,16 @@ mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
else if (engineFactory("VEngineServer022", NULL) != NULL &&
engineFactory("VEngineCvar007", NULL) != NULL)
{
if (strcmp(game_name, "berimbau") == 0)
if (serverFactory("ServerGameClients004", NULL))
{
if (strcmp(game_name, "portal2") == 0)
{
return MMBackend_Portal2;
}
return MMBackend_Blade;
}
if (strcmp(game_name, "portal2") == 0)
{
return MMBackend_Portal2;
}
if (engineFactory("EngineTraceServer004", NULL) != NULL)
{
return MMBackend_AlienSwarm;
@@ -310,6 +312,7 @@ mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
return MMBackend_Left4Dead2;
}
}
return MMBackend_Left4Dead;
}
else if (engineFactory("VEngineServer021", NULL) != NULL)
View
@@ -120,7 +120,7 @@ extern void
mm_GetGameName(char *buffer, size_t size);
extern MetamodBackend
mm_DetermineBackend(QueryValveInterface qvi, const char *game_name);
mm_DetermineBackend(QueryValveInterface engineFactory, QueryValveInterface serverFactory, const char *game_name);
extern MetamodBackend mm_backend;
View
@@ -90,7 +90,7 @@ class ServerPlugin
{
mm_GetGameName(game_name, sizeof(game_name));
mm_backend = mm_DetermineBackend(engineFactory, game_name);
mm_backend = mm_DetermineBackend(engineFactory, gsFactory, game_name);
}
if (mm_backend == MMBackend_UNKNOWN)

0 comments on commit 0410bf4

Please sign in to comment.