mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-14 15:48:06 +03:00
Throw exceptions if trying to use client interfaces with no client
This commit is contained in:
parent
a7666d7d51
commit
3c2eeb7f2f
@ -200,5 +200,14 @@ namespace Steamworks
|
||||
return SteamAPI.RestartAppIfNecessary( appid );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called in interfaces that rely on this being initialized
|
||||
/// </summary>
|
||||
internal static void ValidCheck()
|
||||
{
|
||||
if ( !IsValid )
|
||||
throw new System.Exception( "SteamClient isn't initialized" );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -17,6 +17,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamFriends();
|
||||
|
@ -12,6 +12,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamInput();
|
||||
|
@ -24,6 +24,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamMatchmaking();
|
||||
|
@ -20,6 +20,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamMusic();
|
||||
|
@ -17,6 +17,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamParentalSettings();
|
||||
|
@ -17,6 +17,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamScreenshots();
|
||||
|
@ -20,6 +20,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamUser();
|
||||
|
@ -14,6 +14,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamUserStats();
|
||||
|
@ -17,6 +17,8 @@ namespace Steamworks
|
||||
{
|
||||
get
|
||||
{
|
||||
SteamClient.ValidCheck();
|
||||
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamVideo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user