diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index e46e5e4..32419bd 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -65,6 +65,11 @@ public partial class Client : BaseSteamworks public Client( uint appId ) { + if ( Instance != null ) + { + throw new System.Exception( "Only one Facepunch.Steamworks.Client can exist - dispose the old one before trying to create a new one." ); + } + Instance = this; native = new Interop.NativeInterface(); diff --git a/Facepunch.Steamworks/Server.cs b/Facepunch.Steamworks/Server.cs index da274e0..01c21d4 100644 --- a/Facepunch.Steamworks/Server.cs +++ b/Facepunch.Steamworks/Server.cs @@ -26,6 +26,11 @@ public partial class Server : BaseSteamworks /// public Server( uint appId, ServerInit init ) { + if ( Instance != null ) + { + throw new System.Exception( "Only one Facepunch.Steamworks.Server can exist - dispose the old one before trying to create a new one." ); + } + Instance = this; native = new Interop.NativeInterface();