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.

61 lines
1.7 KiB

  1. //========= Copyright 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 "baseclient.h"
  12. #include "utlvector.h"
  13. #include "netadr.h"
  14. #include "steam/steam_api.h"
  15. class CSteam3Client : public CSteamAPIContext
  16. {
  17. public:
  18. CSteam3Client();
  19. ~CSteam3Client();
  20. void Activate();
  21. void Shutdown();
  22. void GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, uint32 unIP, uint16 usPort, uint64 unGSSteamID, bool bSecure );
  23. void CancelAuthTicket();
  24. bool BGSSecure() { return m_bGSSecure; }
  25. void RunFrame();
  26. #if !defined(NO_STEAM)
  27. STEAM_CALLBACK( CSteam3Client, OnClientGameServerDeny, ClientGameServerDeny_t, m_CallbackClientGameServerDeny );
  28. STEAM_CALLBACK( CSteam3Client, OnGameServerChangeRequested, GameServerChangeRequested_t, m_CallbackGameServerChangeRequested );
  29. STEAM_CALLBACK( CSteam3Client, OnGameOverlayActivated, GameOverlayActivated_t, m_CallbackGameOverlayActivated );
  30. STEAM_CALLBACK( CSteam3Client, OnPersonaUpdated, PersonaStateChange_t, m_CallbackPersonaStateChanged );
  31. STEAM_CALLBACK( CSteam3Client, OnLowBattery, LowBatteryPower_t, m_CallbackLowBattery );
  32. #endif
  33. private:
  34. //
  35. // Cached data for active ticket, if any
  36. //
  37. HAuthTicket m_hAuthTicket;
  38. uint32 m_unIP;
  39. uint16 m_usPort;
  40. bool m_bActive;
  41. bool m_bGSSecure;
  42. CSteamID m_steamIDGS;
  43. uint32 m_nTicketSize;
  44. unsigned char m_arbTicketData[ 1024 ];
  45. };
  46. #ifndef SWDS
  47. // singleton accessor
  48. CSteam3Client &Steam3Client();
  49. #endif // SWDS
  50. #endif // CL_STEAMUAUTH_H