1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +08:00
hl2sdk/public/OfflineMode.h
2010-07-22 01:46:14 -05:00

30 lines
957 B
C

//========= Copyright © 1996-2005, 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());
}