Counter Strike : Global Offensive Source Code
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.

62 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: steam state machine that handles authenticating steam users
  4. //
  5. //=============================================================================//
  6. #ifndef CL_STEAMUAUTH_H
  7. #define CL_STEAMUAUTH_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "steam/steam_api.h"
  12. class CSteam3Client : public CSteamAPIContext
  13. {
  14. public:
  15. CSteam3Client();
  16. ~CSteam3Client();
  17. void Activate();
  18. void Shutdown();
  19. bool IsInitialized()const { return m_bInitialized; }
  20. void GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, uint64 unGSSteamID, bool bSecure );
  21. void CancelAuthTicket();
  22. bool BGSSecure() { return m_bGSSecure; }
  23. void RunFrame();
  24. bool IsGameOverlayActive()const { return m_bGameOverlayActive; }
  25. #if !defined(NO_STEAM)
  26. STEAM_CALLBACK( CSteam3Client, OnClientGameServerDeny, ClientGameServerDeny_t, m_CallbackClientGameServerDeny );
  27. STEAM_CALLBACK( CSteam3Client, OnGameServerChangeRequested, GameServerChangeRequested_t, m_CallbackGameServerChangeRequested );
  28. STEAM_CALLBACK( CSteam3Client, OnGameOverlayActivated, GameOverlayActivated_t, m_CallbackGameOverlayActivated );
  29. STEAM_CALLBACK( CSteam3Client, OnPersonaUpdated, PersonaStateChange_t, m_CallbackPersonaStateChanged );
  30. STEAM_CALLBACK( CSteam3Client, OnLowBattery, LowBatteryPower_t, m_CallbackLowBattery );
  31. STEAM_CALLBACK( CSteam3Client, OnSteamSocketStatus, SocketStatusCallback_t, m_CallbackSteamSocketStatus );
  32. #endif
  33. private:
  34. HAuthTicket m_hAuthTicket;
  35. bool m_bActive;
  36. bool m_bGSSecure;
  37. bool m_bGameOverlayActive;
  38. bool m_bInitialized;
  39. };
  40. #ifndef DEDICATED
  41. // singleton accessor
  42. CSteam3Client &Steam3Client();
  43. #endif
  44. inline bool IsSteam3ClientGameOverlayActive()
  45. {
  46. #ifndef DEDICATED
  47. return Steam3Client().IsGameOverlayActive();
  48. #else
  49. return false; // dedicated server has no overlays
  50. #endif
  51. }
  52. #endif // CL_STEAMUAUTH_H