aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/OfflineMode.h
blob: d4c1f2cdcfcb9d15641fb30b29a9ea75464dc278 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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());
}