User:Psycommando/Alien Swarm Disabling Steam Integration
When I first used the code of the Alien Swarm SDK, downloaded on July 29 2010, there were a few issues and crashes caused by the steam integration. Since I don't want to save stats, and I want to test my code changes, I decided to thrash the whole thing.
Hopefully, the nice devs were thoughtful enough to provide a define to disable steam integration. But it doesn't work right out of the box, there are two place that need to be changed in order to compile/work correctly :
Client Fixes
I've been able to fix those problems by adding the define "NO_STEAM" in : CLIENT project's properties->Configuration Properties->C/C++->Preprocessor->preprocessor Definition That's essentially what the programmers had planned to turn off steam integration. But, it doesn't work like it should...
You need to replace one line of the "src\game\client\swarm\vgui\nb_lobby_row.cpp" file :
at line 484 :
pMainPanel->m_FlyoutSteamID = Briefing()->GetCommanderSteamID( m_nLobbySlot ).ConvertToUint64();
Replace with this :
//PsyCommando : Fix compile for no steam, I hope that's not important!
#ifndef NO_STEAM
pMainPanel->m_FlyoutSteamID = Briefing()->GetCommanderSteamID( m_nLobbySlot ).ConvertToUint64();
#endif
It's a very ugly fix and I'm still trying to see if it breaks anything.
Update
For this to work in the latest codebase, in date of August 2 2010, 2 lines must be fixed in the file "src\game\client\swarm\asw_medal_store.cpp"
Replace Line 54 with this :
AssertMsg( false, "SteamCloud not available." ); //<--Line 54
//psycommando : Fix for NO_STEAM
char szMedalFile[ 256 ];
Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc.dat");
Replace Line 332 with this :
//psycommando : Fix for NO_STEAM
#ifdef NO_STEAM
Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc.dat" );
#else
Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc_%s.dat", pSteamUser->GetSteamID().Render() );
#endif
However, with the new update, you must use the "-dev" parameter at launch absolutely, or you won't be able to do anything, because the main menu gets modified when NO_STEAM is used.
Server Fixes
Ok, next on, we set NO_STEAM on the server, we do the same thing we did on the client, in the server's project properties. So add NO_STEAM to the SERVER project's properties->Configuration Properties->C/C++->Preprocessor->preprocessor Definition
Now, there's a debugging macro left by valve that for some reason has code to access the steam api in it...
"src\public\engine\thinktracecounter.h" - Line 39
Replace this :
static bool bIsPublic = steamapicontext->SteamUtils() != NULL && steamapicontext->SteamUtils()->GetConnectedUniverse() == k_EUniversePublic;
with this :
#ifndef NO_STEAM
static bool bIsPublic = steamapicontext->SteamUtils() != NULL && steamapicontext->SteamUtils()->GetConnectedUniverse() == k_EUniversePublic;
#else
static bool bIsPublic = false;
#endif
Another ugly fix. Just recompile your code, and then that's it, at least it work for me...