mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
Added ServerRequest.OnServerResponded, OnFinished
This commit is contained in:
parent
4ba430601a
commit
c6bd69092a
@ -91,6 +91,8 @@ internal bool Update( SteamNative.SteamMatchmakingServers servers, Action<SteamN
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Action OnUpdate;
|
public Action OnUpdate;
|
||||||
|
public Action<Server> OnServerResponded;
|
||||||
|
public Action OnFinished;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of servers that responded. If you're only interested in servers that responded since you
|
/// A list of servers that responded. If you're only interested in servers that responded since you
|
||||||
@ -181,6 +183,8 @@ private void Update()
|
|||||||
{
|
{
|
||||||
Finished = true;
|
Finished = true;
|
||||||
client.OnUpdate -= Update;
|
client.OnUpdate -= Update;
|
||||||
|
|
||||||
|
OnFinished?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +195,10 @@ private void OnServer( SteamNative.gameserveritem_t info )
|
|||||||
if ( Filter != null && !Filter.Test( info ) )
|
if ( Filter != null && !Filter.Test( info ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Responded.Add( Server.FromSteam( client, info ) );
|
var s = Server.FromSteam( client, info );
|
||||||
|
Responded.Add( s );
|
||||||
|
|
||||||
|
OnServerResponded?.Invoke( s );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user