mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
Throw exception if trying to initialize without destroying old instance
This commit is contained in:
parent
a6b440324b
commit
79f398da04
@ -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();
|
||||
|
||||
|
@ -26,6 +26,11 @@ public partial class Server : BaseSteamworks
|
||||
/// </summary>
|
||||
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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user