Add support for other engine binaries in game configs (#1414). (#1626)

* Add support for other engine binaries in game configs (#1414).

* Add engine bin path for CRC bin lookup and filter out addons from GAMEBIN.

* MAX_PATH -> PLATFORM_MAX_PATH.

* Fix library lookup on Linux.

Before this, there was a bad assumption that, like on Windows, POSIX module
handle pointers were within the module's address space (and thus usable
with dladdr). That's not true!

Instead, to get a usable address on all platforms, we'll do a lookup of the
CreateInterface function that exists in all modules. This also has the
(arguable) benefit of further locking this implementation to modules owned
by the game.

To get a valid address inside the module now on both p
This commit is contained in:
Nicholas Hastings
2022-12-28 22:58:30 +00:00
committed by GitHub
parent 7e94bfb307
commit ecb707e38d
5 changed files with 156 additions and 84 deletions
-5
View File
@@ -86,11 +86,6 @@ public:
const char *gamesuffix;
/* Data */
ServerGlobals *serverGlobals;
void * serverFactory;
void * engineFactory;
void * matchmakingDSFactory;
void * soundemittersystemFactory;
void * vscriptFactory;
SMGlobalClass * listeners;
// ConVar functions.
+1
View File
@@ -56,6 +56,7 @@ public:
virtual void RenameFile(char const *pOldPath, char const *pNewPath, const char *pathID = 0) = 0;
virtual bool IsDirectory(const char *pFileName, const char *pathID = 0) = 0;
virtual void CreateDirHierarchy(const char *path, const char *pathID = 0) = 0;
virtual int GetSearchPath(const char* pathID, bool bGetPackFiles, char* pPath, int nMaxLen) = 0;
};
} // namespace SourceMod