User:Psycommando/Alien Swarm Disabling Steam Integration: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (this is not relevant anymore)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
{{warning | it's pretty pointless, and not recommended now...}}


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 :
Disable Steam integration


== Client ==


== Client Fixes ==
Add the define "NO_STEAM" in :
 
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
'''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...
That's essentially what the programmers had planned to turn off steam integration. But, it doesn't work like it should...
Line 25: Line 24:
</source>
</source>


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
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"
''"src\game\client\swarm\asw_medal_store.cpp"''


Replace  '''Line 54''' with this :  
Replace  '''Line 54''' with this :  
Line 48: Line 42:
     Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc.dat" );
     Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc.dat" );
#else
#else
Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc_%s.dat", pSteamUser->GetSteamID().Render() );
Q_snprintf( szMedalFile, sizeof( szMedalFile ), "cfg/clientc_%I64u.dat", pSteamUser->GetSteamID().ConvertToUint64() );
#endif
#endif
</source>
</source>


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.
== '''Update 2''' ==
Here is how to fix the menu when NO_STEAM is activated. To override that annoying feature just comment the following lines :
*''"src\game\client\swarm\gameui\swarm\vmainmenu.cpp"'' '''- Line 1037'''
 
<source lang="cpp">
//if ( !g_pMatchFramework->GetMatchSystem()->GetPlayerManager()->GetLocalPlayer( 0 ) ) //psycommando : disable fake menu
//{
// pSettings = "Resource/UI/BaseModUI/MainMenuStub.res";
//}
</source>
 
{{warning| Even though the menu will appear as usual, commands that calls the "matchmaking.dll" dll seems to fail, that means every default menu buttons that starts a game, as well as the single player tutorial, will crash the game. However you can still use the console command "map" to load maps just fine. Or you can re-code each buttons. }}


== Server Fixes ==
== Server ==


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
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
Line 78: Line 83:


Another ugly fix. Just recompile your code, and then that's it, at least it work for me...
Another ugly fix. Just recompile your code, and then that's it, at least it work for me...
[[Category:Alien Swarm]]
[[Category:Programming]]

Latest revision as of 22:17, 22 June 2011

Warning.pngWarning: it's pretty pointless, and not recommended now...

Disable Steam integration

Client

Add 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


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_%I64u.dat", pSteamUser->GetSteamID().ConvertToUint64() );
#endif

Update 2

Here is how to fix the menu when NO_STEAM is activated. To override that annoying feature just comment the following lines :

  • "src\game\client\swarm\gameui\swarm\vmainmenu.cpp" - Line 1037
 
	//if ( !g_pMatchFramework->GetMatchSystem()->GetPlayerManager()->GetLocalPlayer( 0 ) ) //psycommando : disable fake menu
	//{
	//	pSettings = "Resource/UI/BaseModUI/MainMenuStub.res";
	//}
Warning.pngWarning: Even though the menu will appear as usual, commands that calls the "matchmaking.dll" dll seems to fail, that means every default menu buttons that starts a game, as well as the single player tutorial, will crash the game. However you can still use the console command "map" to load maps just fine. Or you can re-code each buttons.

Server

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...