Added ServerRequest.OnServerResponded, OnFinished

This commit is contained in:
Garry Newman 2017-08-17 13:21:22 +01:00
parent 4ba430601a
commit c6bd69092a

View File

@ -91,6 +91,8 @@ internal bool Update( SteamNative.SteamMatchmakingServers servers, Action<SteamN
}
public Action OnUpdate;
public Action<Server> OnServerResponded;
public Action OnFinished;
/// <summary>
/// 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
{