From 23c206918e62355af0407df76c0a87484edf2712 Mon Sep 17 00:00:00 2001 From: Andreas Winther Moen Date: Tue, 26 Nov 2024 09:09:24 +0100 Subject: [PATCH] Make timeout duration an optional argument --- sdks/unity/AgonesSdk.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdks/unity/AgonesSdk.cs b/sdks/unity/AgonesSdk.cs index e202110823..b8a8bf8a77 100644 --- a/sdks/unity/AgonesSdk.cs +++ b/sdks/unity/AgonesSdk.cs @@ -91,10 +91,11 @@ private void OnApplicationQuit() /// Async method that waits to connect to the SDK Server. Will timeout /// and return false after 30 seconds. /// + /// The number of seconds to wait before timing out. Defaults to 30 seconds. /// A task that indicated whether it was successful or not - public async Task Connect() + public async Task Connect(int timeoutSeconds = 30) { - for (var i = 0; i < 30; i++) + for (var i = 0; i < timeoutSeconds; i++) { Log($"Attempting to connect...{i + 1}"); try