Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow installation to global directories. #246

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appframework/posixapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool CSteamApplication::Create( )
m_pFileSystem = (IFileSystem*)AddSystem( fileSystemModule, FILESYSTEM_INTERFACE_VERSION );
if ( !m_pFileSystem )
{
Error( "Unable to load %s", pFileSystemDLL );
Error( "Unable to load %s\n", pFileSystemDLL );
return false;
}

Expand Down
12 changes: 4 additions & 8 deletions dedicated_main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ static void WaitForDebuggerConnect( int argc, char *argv[], int time )

int main( int argc, char *argv[] )
{
#if 0
// Must add 'bin' to the path....
char* pPath = getenv("LD_LIBRARY_PATH");
char szBuffer[4096];
Expand All @@ -203,14 +204,11 @@ int main( int argc, char *argv[] )
{
printf( "%s\n", strerror(errno) );
}
void *tier0 = dlopen( "libtier0" DLL_EXT_STRING, RTLD_NOW );
void *vstdlib = dlopen( "libvstdlib" DLL_EXT_STRING, RTLD_NOW );

const char *pBinaryName = "bin/dedicated" DLL_EXT_STRING;
#endif

void *dedicated = dlopen( pBinaryName, RTLD_NOW );
void *dedicated = dlopen( "libdedicated", RTLD_NOW );
if ( !dedicated )
dedicated = dlopen( "bin/libdedicated" DLL_EXT_STRING, RTLD_NOW );
dedicated = dlopen( "dedicated" DLL_EXT_STRING, RTLD_NOW );

if ( !dedicated )
{
Expand All @@ -228,7 +226,5 @@ int main( int argc, char *argv[] )

ret = dedicated_main( argc,argv );
dlclose( dedicated );
dlclose( vstdlib );
dlclose( tier0 );
}
#endif
16 changes: 16 additions & 0 deletions engine/cdll_engine_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,7 @@ bool ClientDLL_Load()
{
Assert ( !g_ClientDLLModule );

#if 0
// Check the signature on the client dll. If this fails we load it anyway but put this client
// into insecure mode so it won't connect to secure servers and get VAC banned
if ( !Host_AllowLoadModule( "client.dll", "GAMEBIN", true ) )
Expand All @@ -1723,8 +1724,23 @@ bool ClientDLL_Load()
Host_DisallowSecureServers();
Host_AllowLoadModule( "client.dll","GAMEBIN", true );
}
#endif

#if 0
g_ClientDLLModule = g_pFileSystem->LoadModule( "client", "GAMEBIN", false );
#else
char clientPath[MAX_PATH];
const char *modName = CommandLine()->ParmValue("-game");

Q_snprintf(clientPath, MAX_PATH, "%s/libclient", modName);
g_ClientDLLModule = Sys_LoadModule(clientPath);

if (!g_ClientDLLModule)
{
Q_snprintf(clientPath, MAX_PATH, "%s/client", modName);
g_ClientDLLModule = Sys_LoadModule(clientPath);
}
#endif
if ( g_ClientDLLModule )
{
g_ClientFactory = Sys_GetFactory( g_ClientDLLModule );
Expand Down
16 changes: 13 additions & 3 deletions engine/sys_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void Sys_Error_Internal( bool bMinidump, const char *error, va_list argsList )
// Doing this doesn't quite work the way we want because there is no "crashing" thread
// and we see "No thread was identified as the cause of the crash; No signature could be created because we do not know which thread crashed" on the back end
//SteamAPI_WriteMiniDump( 0, NULL, build_number() );
printf("\n ##### Sys_Error: %s", text );
printf("\n ##### Sys_Error: %s\n", text );
fflush(stdout );

raise(SIGTRAP);
Expand Down Expand Up @@ -1117,12 +1117,12 @@ void Sys_ShutdownGame( void )

CreateInterfaceFn g_ServerFactory;


#pragma optimize( "g", off )
static bool LoadThisDll( char *szDllFilename, bool bIsServerOnly )
{
CSysModule *pDLL = NULL;

#if 0
// check signature, don't let users with modified binaries connect to secure servers, they will get VAC banned
if ( !Host_AllowLoadModule( szDllFilename, "GAMEBIN", true, bIsServerOnly ) )
{
Expand All @@ -1134,6 +1134,16 @@ static bool LoadThisDll( char *szDllFilename, bool bIsServerOnly )
// ensures that the game.dll is running under Steam
// this will have to be undone when we want mods to be able to run
if ((pDLL = g_pFileSystem->LoadModule(szDllFilename, "GAMEBIN", false)) == NULL)
#endif
char dllPath[MAX_PATH];
const char *modName = CommandLine()->ParmValue("-game");
Q_snprintf(dllPath, MAX_PATH, "%s/lib%s", modName, szDllFilename);
if (!(pDLL = Sys_LoadModule(dllPath)))
{
Q_snprintf(dllPath, MAX_PATH, "%s/%s",modName, szDllFilename);
pDLL = Sys_LoadModule(dllPath);
}
if (!pDLL)
{
ConMsg("Failed to load %s\n", szDllFilename);
goto IgnoreThisDLL;
Expand Down Expand Up @@ -1255,7 +1265,7 @@ void LoadEntityDLLs( const char *szBaseDir, bool bIsServerOnly )

if ( serverGameDLL )
{
Msg("server%s loaded for \"%s\"\n", DLL_EXT_STRING, (char *)serverGameDLL->GetGameDescription());
Msg("server" DLL_EXT_STRING " loaded for \"%s\"\n", (char *)serverGameDLL->GetGameDescription());
}
}

Expand Down
13 changes: 5 additions & 8 deletions filesystem/basefilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5057,20 +5057,17 @@ CSysModule *CBaseFileSystem::LoadModule( const char *pFileName, const char *pPat
if ( FilterByPathID( &m_SearchPaths[i], lookup ) )
continue;

Q_snprintf( tempPathID, sizeof(tempPathID), "%s%s", m_SearchPaths[i].GetPathString(), pFileName ); // append the path to this dir.
pModule = Sys_LoadModule( tempPathID );
if ( pModule )
{
// we found the binary in one of our search paths
return pModule;
}

#ifdef POSIX
Q_snprintf( tempPathID, sizeof(tempPathID), "%slib%s", m_SearchPaths[i].GetPathString(), pFileName ); // append the path to this dir.
pModule = Sys_LoadModule( tempPathID );
if ( pModule )
return pModule;
#endif

Q_snprintf( tempPathID, sizeof(tempPathID), "%s%s", m_SearchPaths[i].GetPathString(), pFileName ); // append the path to this dir.
pModule = Sys_LoadModule( tempPathID );
if ( pModule )
return pModule;
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions game/client/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def build(bld):
'ZLIB'
]

install_path = bld.env.PREFIX
install_path = bld.env.LIBDIR
if bld.env.DEST_OS != 'android':
install_path += '/'+bld.env.GAMES+'/bin'
install_path += '/'+bld.env.GAMES
Comment on lines +68 to +70
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ебанутый или да?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да


source = [ 'in_touch.cpp' ]
if bld.env.DEST_OS == 'win32':
Expand Down
4 changes: 2 additions & 2 deletions game/server/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def build(bld):
if bld.env.DEST_OS == 'win32':
libs += ['USER32']

install_path = bld.env.PREFIX
install_path = bld.env.LIBDIR
if bld.env.DEST_OS != 'android':
install_path += '/'+bld.env.GAMES+'/bin'
install_path += '/'+bld.env.GAMES
Comment on lines +62 to +64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ебанутый или да?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

самоходная пизда


source = game["sources"] + ['../../public/tier0/memoverride.cpp']
includes += game["includes"]
Expand Down
10 changes: 6 additions & 4 deletions launcher_main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ static void WaitForDebuggerConnect( int argc, char *argv[], int time )

int main( int argc, char *argv[] )
{
#if 0
char ld_path[4196];
char *path = "bin/";
char *ld_env;
Expand All @@ -234,13 +235,14 @@ int main( int argc, char *argv[] )
setenv("NO_EXECVE_AGAIN", "1", 1);
execve(argv[0], argv, environ);
}
#endif

void *launcher = dlopen( "bin/liblauncher" DLL_EXT_STRING, RTLD_NOW );
void *launcher = dlopen( "liblauncher" DLL_EXT_STRING, RTLD_NOW );
if ( !launcher )
{
fprintf( stderr, "%s\nFailed to load the launcher\n", dlerror() );

if( !launcher )
launcher = dlopen( "bin/launcher" DLL_EXT_STRING, RTLD_NOW );
launcher = dlopen( "launcher" DLL_EXT_STRING, RTLD_NOW );
}

if ( !launcher )
{
Expand Down
2 changes: 0 additions & 2 deletions materialsystem/cmaterialsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3102,8 +3102,6 @@ void CMaterialSystem::ResetTempHWMemory( bool bExitingLevel )
//-----------------------------------------------------------------------------
void CMaterialSystem::CacheUsedMaterials( )
{
printf("Cache materials\n");

g_pShaderAPI->EvictManagedResources();

for (MaterialHandle_t i = FirstMaterial(); i != InvalidMaterial(); i = NextMaterial(i) )
Expand Down
Loading