Build 1.1.4.0

This commit is contained in:
Markus Isberg
2023-03-31 18:40:44 +03:00
parent efba17e0ff
commit 9470edead3
483 changed files with 17487 additions and 8548 deletions
@@ -11,7 +11,7 @@ namespace Steamworks.ServerList
{
#region ISteamMatchmakingServers
internal static ISteamMatchmakingServers Internal => SteamMatchmakingServers.Internal;
internal static ISteamMatchmakingServers? Internal => SteamMatchmakingServers.Internal;
#endregion
@@ -23,17 +23,17 @@ namespace Steamworks.ServerList
/// <summary>
/// When a new server is added, this function will get called
/// </summary>
public Action OnChanges;
public Action? OnChanges;
/// <summary>
/// Called for every responsive server
/// </summary>
public Action<ServerInfo> OnResponsiveServer;
public Action<ServerInfo>? OnResponsiveServer;
/// <summary>
/// Called for every unresponsive server
/// </summary>
public Action<ServerInfo> OnUnresponsiveServer;
public Action<ServerInfo>? OnUnresponsiveServer;
/// <summary>
/// A list of servers that responded. If you're only interested in servers that responded since you
@@ -98,7 +98,7 @@ namespace Steamworks.ServerList
return true;
}
public virtual void Cancel() => Internal.CancelQuery( request );
public virtual void Cancel() => Internal?.CancelQuery( request );
// Overrides
internal abstract void LaunchQuery();
@@ -117,8 +117,8 @@ namespace Steamworks.ServerList
#endregion
internal int Count => Internal.GetServerCount( request );
internal bool IsRefreshing => request.Value != IntPtr.Zero && Internal.IsRefreshing( request );
internal int Count => Internal?.GetServerCount( request ) ?? 0;
internal bool IsRefreshing => request.Value != IntPtr.Zero && Internal != null && Internal.IsRefreshing( request );
internal List<int> watchList = new List<int>();
internal int LastCount = 0;
@@ -134,7 +134,7 @@ namespace Steamworks.ServerList
if ( request.Value != IntPtr.Zero )
{
Cancel();
Internal.ReleaseRequest( request );
Internal?.ReleaseRequest( request );
request = IntPtr.Zero;
}
}
@@ -166,6 +166,8 @@ namespace Steamworks.ServerList
{
watchList.RemoveAll( x =>
{
if (Internal is null) { return true; }
var info = Internal.GetServerDetails( request, x );
if ( info.HadSuccessfulResponse )
{
@@ -181,6 +183,8 @@ namespace Steamworks.ServerList
{
watchList.RemoveAll( x =>
{
if (Internal is null) { return true; }
var info = Internal.GetServerDetails( request, x );
OnServer( ServerInfo.From( info ), info.HadSuccessfulResponse );
return true;