Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Base presence implementation for PC
  4. //
  5. //=====================================================================================//
  6. #include "cbase.h"
  7. #include "basepresence.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. // Default global singleton. Mods should override this.
  11. static CBasePresence s_basePresence;
  12. IPresence *presence = NULL;
  13. //-----------------------------------------------------------------------------
  14. // Steam version of Rich Presence is a WIP, so PC implementation is stubbed for now.
  15. //-----------------------------------------------------------------------------
  16. bool CBasePresence::Init( void )
  17. {
  18. if ( !presence )
  19. {
  20. // Mod didn't override, default to base implementation
  21. presence = &s_basePresence;
  22. }
  23. return true;
  24. }
  25. void CBasePresence::Shutdown( void )
  26. {
  27. // TODO: Implement for PC
  28. }
  29. void CBasePresence::Update( float frametime )
  30. {
  31. // TODO: Implement for PC
  32. }
  33. void CBasePresence::UserSetContext( unsigned int nUserIndex, unsigned int nContextId, unsigned int nContextValue, bool bAsync )
  34. {
  35. // TODO: Implement for PC
  36. }
  37. void CBasePresence::UserSetProperty( unsigned int nUserIndex, unsigned int nPropertyId, unsigned int nBytes, const void *pvValue, bool bAsync )
  38. {
  39. // TODO: Implement for PC
  40. }
  41. void CBasePresence::SetupGameProperties( CUtlVector< XUSER_CONTEXT > &contexts, CUtlVector< XUSER_PROPERTY > &properties )
  42. {
  43. // TODO: Implement for PC
  44. }
  45. unsigned int CBasePresence::GetPresenceID( const char *pIDName )
  46. {
  47. return 0;
  48. }
  49. const char *CBasePresence::GetPropertyIdString( const uint id )
  50. {
  51. return NULL;
  52. }
  53. void CBasePresence::GetPropertyDisplayString( uint id, uint value, char *pOutput, int nBytes )
  54. {
  55. }
  56. void CBasePresence::StartStatsReporting( HANDLE handle, bool bArbitrated )
  57. {
  58. }
  59. void CBasePresence::SetStat( uint iPropertyId, int iPropertyValue, int dataType )
  60. {
  61. }
  62. void CBasePresence::UploadStats()
  63. {
  64. }
  65. //---------------------------------------------------------
  66. // Debug support
  67. //---------------------------------------------------------
  68. void CBasePresence::DebugUserSetContext( const CCommand &args )
  69. {
  70. if ( args.ArgC() == 3 )
  71. {
  72. UserSetContext( 0, atoi( args.Arg( 1 ) ), atoi( args.Arg( 2 ) ) );
  73. }
  74. else
  75. {
  76. Warning( "user_context <context id> <context value>\n" );
  77. }
  78. }
  79. void CBasePresence::DebugUserSetProperty( const CCommand &args )
  80. {
  81. if ( args.ArgC() == 3 )
  82. {
  83. UserSetProperty( 0, strtoul( args.Arg( 1 ), NULL, 0 ), sizeof(int), args.Arg( 2 ) );
  84. }
  85. else
  86. {
  87. Warning( "user_property <property id> <property value>\n" );
  88. }
  89. }