Permalink
Browse files

Fix regression in engine detection for some cases (bug 5963, r=asherk…

…in).
  • Loading branch information...
psychonic committed Oct 24, 2013
1 parent 53c8161 commit 78827f0ea213dc4a9a79c461cfac2a192b4f61c3
Showing with 9 additions and 13 deletions.
  1. +1 −4 loader/gamedll.cpp
  2. +6 −4 loader/loader.cpp
  3. +1 −1 loader/loader.h
  4. +1 −4 loader/serverplugin.cpp
View
@@ -70,10 +70,7 @@ mm_DetectGameInformation()
game_info_detected = -1;
if (!mm_GetGameName(game_name, sizeof(game_name)))
{
return false;
}
mm_GetGameName(game_name, sizeof(game_name));
if (!mm_GetFileOfAddress((void*)mm_DetectGameInformation, mm_path, sizeof(mm_path)))
{
View
@@ -191,7 +191,7 @@ mm_GetProcAddress(const char *name)
return mm_GetLibAddress(mm_library, name);
}
bool
void
mm_GetGameName(char *buffer, size_t size)
{
buffer[0] = '\0';
@@ -217,7 +217,6 @@ mm_GetGameName(char *buffer, size_t size)
LocalFree(wargv);
return buffer[0] != 0;
#elif defined __APPLE__
int argc = *_NSGetArgc();
char **argv = *_NSGetArgv();
@@ -234,7 +233,6 @@ mm_GetGameName(char *buffer, size_t size)
break;
}
return buffer[0] != 0;
#elif defined __linux__
FILE *pFile = fopen("/proc/self/cmdline", "rb");
if (!pFile)
@@ -262,10 +260,14 @@ mm_GetGameName(char *buffer, size_t size)
free(arg);
fclose(pFile);
return buffer[0] != 0;
#else
#error unsupported platform
#endif
if (buffer[0] == 0)
{
strncpy(buffer, ".", size);
}
}
MetamodBackend
View
@@ -116,7 +116,7 @@ mm_UnloadMetamodLibrary();
extern void
mm_LogFatal(const char *message, ...);
extern bool
extern void
mm_GetGameName(char *buffer, size_t size);
extern MetamodBackend
View
@@ -88,10 +88,7 @@ class ServerPlugin
/* Backend should already filled in if loaded as gamedll */
if (gamedll_bridge == NULL)
{
if (!mm_GetGameName(game_name, sizeof(game_name)))
{
return false;
}
mm_GetGameName(game_name, sizeof(game_name));
mm_backend = mm_DetermineBackend(engineFactory, game_name);
}

0 comments on commit 78827f0

Please sign in to comment.