From c6bd69092a990e7930019288795b8433b6700777 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 17 Aug 2017 13:21:22 +0100 Subject: [PATCH] Added ServerRequest.OnServerResponded, OnFinished --- Facepunch.Steamworks/Client/ServerList.Request.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client/ServerList.Request.cs b/Facepunch.Steamworks/Client/ServerList.Request.cs index 503ef1f..f3da876 100644 --- a/Facepunch.Steamworks/Client/ServerList.Request.cs +++ b/Facepunch.Steamworks/Client/ServerList.Request.cs @@ -91,6 +91,8 @@ internal bool Update( SteamNative.SteamMatchmakingServers servers, Action OnServerResponded; + public Action OnFinished; /// /// 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; client.OnUpdate -= Update; + + OnFinished?.Invoke(); } } @@ -191,7 +195,10 @@ private void OnServer( SteamNative.gameserveritem_t info ) if ( Filter != null && !Filter.Test( info ) ) return; - Responded.Add( Server.FromSteam( client, info ) ); + var s = Server.FromSteam( client, info ); + Responded.Add( s ); + + OnServerResponded?.Invoke( s ); } else {