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.

29 lines
928 B

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include <vgui/ISystem.h>
  7. #include <vgui_controls/Controls.h>
  8. #define STEAM_OFFLINE_MODE "HKEY_CURRENT_USER\\Software\\Valve\\Steam\\Offline"
  9. #define STEAM_AFS_MODE "HKEY_CURRENT_USER\\Software\\Valve\\Steam\\OfflineAFS"
  10. #define OFFLINE_FILE "Steam\\cached\\offline_" // first part of filename
  11. inline bool IsSteamInOfflineMode()
  12. {
  13. int offline = 0;
  14. vgui::system()->GetRegistryInteger( STEAM_OFFLINE_MODE, offline );
  15. return ( offline == 1 );
  16. }inline bool IsSteamInAuthenticationFailSafeMode()
  17. {
  18. int offline = 0;
  19. vgui::system()->GetRegistryInteger( STEAM_AFS_MODE, offline );
  20. return ( offline == 1 );
  21. }
  22. inline bool IsSteamGameServerBrowsingEnabled()
  23. {
  24. return (IsSteamInAuthenticationFailSafeMode() || !IsSteamInOfflineMode());
  25. }