diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/basepresence.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/basepresence.cpp')
| -rw-r--r-- | game/client/basepresence.cpp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/game/client/basepresence.cpp b/game/client/basepresence.cpp new file mode 100644 index 0000000..ce4c7c7 --- /dev/null +++ b/game/client/basepresence.cpp @@ -0,0 +1,94 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Base presence implementation for PC +// +//=====================================================================================// + +#include "cbase.h" +#include "basepresence.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +// Default global singleton. Mods should override this. +static CBasePresence s_basePresence; +IPresence *presence = NULL; + +//----------------------------------------------------------------------------- +// Steam version of Rich Presence is a WIP, so PC implementation is stubbed for now. +//----------------------------------------------------------------------------- +bool CBasePresence::Init( void ) +{ + if ( !presence ) + { + // Mod didn't override, default to base implementation + presence = &s_basePresence; + } + return true; +} +void CBasePresence::Shutdown( void ) +{ + // TODO: Implement for PC +} +void CBasePresence::Update( float frametime ) +{ + // TODO: Implement for PC +} +void CBasePresence::UserSetContext( unsigned int nUserIndex, unsigned int nContextId, unsigned int nContextValue, bool bAsync ) +{ + // TODO: Implement for PC +} +void CBasePresence::UserSetProperty( unsigned int nUserIndex, unsigned int nPropertyId, unsigned int nBytes, const void *pvValue, bool bAsync ) +{ + // TODO: Implement for PC +} +void CBasePresence::SetupGameProperties( CUtlVector< XUSER_CONTEXT > &contexts, CUtlVector< XUSER_PROPERTY > &properties ) +{ + // TODO: Implement for PC +} +unsigned int CBasePresence::GetPresenceID( const char *pIDName ) +{ + return 0; +} +const char *CBasePresence::GetPropertyIdString( const uint id ) +{ + return NULL; +} +void CBasePresence::GetPropertyDisplayString( uint id, uint value, char *pOutput, int nBytes ) +{ +} +void CBasePresence::StartStatsReporting( HANDLE handle, bool bArbitrated ) +{ +} +void CBasePresence::SetStat( uint iPropertyId, int iPropertyValue, int dataType ) +{ +} +void CBasePresence::UploadStats() +{ +} + +//--------------------------------------------------------- +// Debug support +//--------------------------------------------------------- +void CBasePresence::DebugUserSetContext( const CCommand &args ) +{ + if ( args.ArgC() == 3 ) + { + UserSetContext( 0, atoi( args.Arg( 1 ) ), atoi( args.Arg( 2 ) ) ); + } + else + { + Warning( "user_context <context id> <context value>\n" ); + } +} +void CBasePresence::DebugUserSetProperty( const CCommand &args ) +{ + if ( args.ArgC() == 3 ) + { + UserSetProperty( 0, strtoul( args.Arg( 1 ), NULL, 0 ), sizeof(int), args.Arg( 2 ) ); + } + else + { + Warning( "user_property <property id> <property value>\n" ); + } +} |