summaryrefslogtreecommitdiff
path: root/public/OfflineMode.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/OfflineMode.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/OfflineMode.h')
-rw-r--r--public/OfflineMode.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/public/OfflineMode.h b/public/OfflineMode.h
new file mode 100644
index 0000000..d4c1f2c
--- /dev/null
+++ b/public/OfflineMode.h
@@ -0,0 +1,29 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include <vgui/ISystem.h>
+#include <vgui_controls/Controls.h>
+
+#define STEAM_OFFLINE_MODE "HKEY_CURRENT_USER\\Software\\Valve\\Steam\\Offline"
+#define STEAM_AFS_MODE "HKEY_CURRENT_USER\\Software\\Valve\\Steam\\OfflineAFS"
+#define OFFLINE_FILE "Steam\\cached\\offline_" // first part of filename
+
+inline bool IsSteamInOfflineMode()
+{
+ int offline = 0;
+ vgui::system()->GetRegistryInteger( STEAM_OFFLINE_MODE, offline );
+ return ( offline == 1 );
+}inline bool IsSteamInAuthenticationFailSafeMode()
+{
+ int offline = 0;
+ vgui::system()->GetRegistryInteger( STEAM_AFS_MODE, offline );
+ return ( offline == 1 );
+}
+
+inline bool IsSteamGameServerBrowsingEnabled()
+{
+ return (IsSteamInAuthenticationFailSafeMode() || !IsSteamInOfflineMode());
+}