Throw exception if trying to initialize multiple times

This commit is contained in:
Garry Newman 2020-02-25 12:42:09 +00:00
parent b45ac59a21
commit 59eabc1302
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,9 @@ namespace Steamworks
/// </summary>
public static void Init( uint appid, bool asyncCallbacks = true )
{
if ( initialized )
throw new System.Exception( "Calling SteamClient.Init but is already initialized" );
System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() );
System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() );

View File

@ -61,6 +61,9 @@ namespace Steamworks
/// </summary>
public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks = true )
{
if ( IsValid )
throw new System.Exception( "Calling SteamServer.Init but is already initialized" );
uint ipaddress = 0; // Any Port
if ( init.SteamPort == 0 )