mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 22:55:55 +03:00
Server Initialize fixes
This commit is contained in:
parent
1630aaae22
commit
4daf43891a
@ -58,23 +58,17 @@ public static void Init( uint appid, bool asyncCallbacks = true )
|
||||
internal static void AddInterface<T>() where T : SteamClass, new()
|
||||
{
|
||||
var t = new T();
|
||||
t.InitializeInterface();
|
||||
openInterfaces.Add( t );
|
||||
}
|
||||
|
||||
static List<SteamInterface> openInterfaces = new List<SteamInterface>();
|
||||
|
||||
internal static void WatchInterface( SteamInterface steamInterface )
|
||||
{
|
||||
if ( openInterfaces.Contains( steamInterface ) )
|
||||
throw new System.Exception( "openIterfaces already contains interface!" );
|
||||
|
||||
openInterfaces.Add( steamInterface );
|
||||
}
|
||||
static List<SteamClass> openInterfaces = new List<SteamClass>();
|
||||
|
||||
internal static void ShutdownInterfaces()
|
||||
{
|
||||
foreach ( var e in openInterfaces )
|
||||
{
|
||||
e.ShutdownInterface();
|
||||
e.DestroyInterface();
|
||||
}
|
||||
|
||||
openInterfaces.Clear();
|
||||
|
@ -85,7 +85,7 @@ public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks
|
||||
throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" );
|
||||
}
|
||||
|
||||
Install
|
||||
AddInterface<SteamServer>();
|
||||
|
||||
//
|
||||
// Initial settings
|
||||
@ -107,24 +107,23 @@ public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||
|
||||
internal static void WatchInterface( SteamInterface steamInterface )
|
||||
internal static void AddInterface<T>() where T : SteamClass, new()
|
||||
{
|
||||
if ( openIterfaces.Contains( steamInterface ) )
|
||||
throw new System.Exception( "openIterfaces already contains interface!" );
|
||||
|
||||
openIterfaces.Add( steamInterface );
|
||||
var t = new T();
|
||||
t.InitializeInterface();
|
||||
openInterfaces.Add( t );
|
||||
}
|
||||
|
||||
static List<SteamClass> openInterfaces = new List<SteamClass>();
|
||||
|
||||
internal static void ShutdownInterfaces()
|
||||
{
|
||||
foreach ( var e in openIterfaces )
|
||||
foreach ( var e in openInterfaces )
|
||||
{
|
||||
e.ShutdownInterface();
|
||||
e.DestroyInterface();
|
||||
}
|
||||
|
||||
openIterfaces.Clear();
|
||||
openInterfaces.Clear();
|
||||
}
|
||||
|
||||
public static void Shutdown()
|
||||
|
@ -31,7 +31,7 @@ internal void ShutdownInterface()
|
||||
public abstract class SteamClass
|
||||
{
|
||||
internal abstract void InitializeInterface();
|
||||
internal void DestroyInterface()
|
||||
internal virtual void DestroyInterface()
|
||||
{
|
||||
Interface.ShutdownInterface();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user