mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 07:05:50 +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()
|
internal static void AddInterface<T>() where T : SteamClass, new()
|
||||||
{
|
{
|
||||||
var t = new T();
|
var t = new T();
|
||||||
|
t.InitializeInterface();
|
||||||
|
openInterfaces.Add( t );
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SteamInterface> openInterfaces = new List<SteamInterface>();
|
static List<SteamClass> openInterfaces = new List<SteamClass>();
|
||||||
|
|
||||||
internal static void WatchInterface( SteamInterface steamInterface )
|
|
||||||
{
|
|
||||||
if ( openInterfaces.Contains( steamInterface ) )
|
|
||||||
throw new System.Exception( "openIterfaces already contains interface!" );
|
|
||||||
|
|
||||||
openInterfaces.Add( steamInterface );
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static void ShutdownInterfaces()
|
internal static void ShutdownInterfaces()
|
||||||
{
|
{
|
||||||
foreach ( var e in openInterfaces )
|
foreach ( var e in openInterfaces )
|
||||||
{
|
{
|
||||||
e.ShutdownInterface();
|
e.DestroyInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
openInterfaces.Clear();
|
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}\")" );
|
throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" );
|
||||||
}
|
}
|
||||||
|
|
||||||
Install
|
AddInterface<SteamServer>();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initial settings
|
// 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 AddInterface<T>() where T : SteamClass, new()
|
||||||
|
|
||||||
internal static void WatchInterface( SteamInterface steamInterface )
|
|
||||||
{
|
{
|
||||||
if ( openIterfaces.Contains( steamInterface ) )
|
var t = new T();
|
||||||
throw new System.Exception( "openIterfaces already contains interface!" );
|
t.InitializeInterface();
|
||||||
|
openInterfaces.Add( t );
|
||||||
openIterfaces.Add( steamInterface );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static List<SteamClass> openInterfaces = new List<SteamClass>();
|
||||||
|
|
||||||
internal static void ShutdownInterfaces()
|
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()
|
public static void Shutdown()
|
||||||
|
@ -31,7 +31,7 @@ internal void ShutdownInterface()
|
|||||||
public abstract class SteamClass
|
public abstract class SteamClass
|
||||||
{
|
{
|
||||||
internal abstract void InitializeInterface();
|
internal abstract void InitializeInterface();
|
||||||
internal void DestroyInterface()
|
internal virtual void DestroyInterface()
|
||||||
{
|
{
|
||||||
Interface.ShutdownInterface();
|
Interface.ShutdownInterface();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user