mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-04-16 06:12:28 +03:00
ServerList timeout option
This commit is contained in:
parent
920ea6ce6b
commit
c5e507fb15
@ -66,8 +66,10 @@ namespace Steamworks
|
|||||||
/// Query the server list. Task result will be true when finished
|
/// Query the server list. Task result will be true when finished
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<bool> RunQueryAsync()
|
public async Task<bool> RunQueryAsync( float timeoutSeconds = 10 )
|
||||||
{
|
{
|
||||||
|
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
LaunchQuery();
|
LaunchQuery();
|
||||||
|
|
||||||
@ -92,6 +94,9 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
OnChanges?.Invoke();
|
OnChanges?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovePendingToUnresponsive();
|
MovePendingToUnresponsive();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user