From 2c60194a17a2768a89e1eb7c8217d704e2ee2e9d Mon Sep 17 00:00:00 2001 From: Andrew Allbright Date: Fri, 21 Jun 2024 13:10:07 -0400 Subject: [PATCH] Update csharp.md to indicate ConnectAsync is deprecated (#3866) * Update csharp.md to indicate ConnectAsync is deprecated * Removes ConnectionAsync from c# sdk * Update site/content/en/docs/Guides/Client SDKs/csharp.md Co-authored-by: igooch * Update site/content/en/docs/Guides/Client SDKs/csharp.md Co-authored-by: igooch * Expiry feature flag also hides remarks about ConnectAsync * Update csharp.md Co-authored-by: igooch --------- Co-authored-by: igooch --- sdks/csharp/sdk/AgonesSDK.cs | 12 ------------ sdks/csharp/sdk/IAgonesSDK.cs | 1 - site/content/en/docs/Guides/Client SDKs/csharp.md | 12 ++++++++---- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/sdks/csharp/sdk/AgonesSDK.cs b/sdks/csharp/sdk/AgonesSDK.cs index c40f9e6e51..d88dada544 100644 --- a/sdks/csharp/sdk/AgonesSDK.cs +++ b/sdks/csharp/sdk/AgonesSDK.cs @@ -103,18 +103,6 @@ public IAgonesBetaSDK Beta() return beta; } - - - /// - /// Connect the underlying gRPC channel. - /// - /// Always return true - [Obsolete("No need to call ConnectAsync anymore")] - public async Task ConnectAsync() - { - return true; - } - /// /// Tells Agones that the Game Server is ready to take player connections /// diff --git a/sdks/csharp/sdk/IAgonesSDK.cs b/sdks/csharp/sdk/IAgonesSDK.cs index 7237ee24d8..c1409a852e 100644 --- a/sdks/csharp/sdk/IAgonesSDK.cs +++ b/sdks/csharp/sdk/IAgonesSDK.cs @@ -21,7 +21,6 @@ namespace Agones { public interface IAgonesSDK : IDisposable { - Task ConnectAsync(); Task ReadyAsync(); Task AllocateAsync(); Task ReserveAsync(long seconds); diff --git a/site/content/en/docs/Guides/Client SDKs/csharp.md b/site/content/en/docs/Guides/Client SDKs/csharp.md index 22cfd0d56c..ee06dde088 100644 --- a/site/content/en/docs/Guides/Client SDKs/csharp.md +++ b/site/content/en/docs/Guides/Client SDKs/csharp.md @@ -74,16 +74,15 @@ To use the AgonesSDK, you will need to import the namespace by adding `using Ago var agones = new AgonesSDK(); ``` +{{% feature expiryVersion="1.42.0" %}} ### Connection -To connect to the SDK server, either locally or when running on Agones, run the `ConnectAsync()` method. -This will wait for up to 30 seconds if the SDK server has not yet started and the connection cannot be made, -and will return `false` if there was an issue connecting. +The `ConnectAsync()` method is an obsolete function that now always returns true. ```csharp bool ok = await agones.ConnectAsync(); ``` - +{{% /feature %}} ### Ready To mark the game server as [ready to receive player connections]({{< relref "_index.md#ready" >}}), call the async method `ReadyAsync()`. @@ -358,7 +357,12 @@ bool isConnected = await agones.Alpha().IsPlayerConnectedAsync(playerId); ``` ## Remarks +{{% feature expiryVersion="1.42.0" %}} - All requests other than `ConnectAsync` will wait for up to 15 seconds before giving up, time to wait can also be set in the constructor. +{{% /feature %}} +{{% feature publishVersion="1.42.0" %}} +- All requests will wait for up to 15 seconds before giving up. Time to wait can also be set in the constructor. +{{% /feature %}} - Default host & port are `localhost:9357` - Methods that do not return a data object such as `GameServer` will return a gRPC `Grpc.Core.Status` object. To check the state of the request, check `Status.StatusCode` & `Status.Detail`. Ex: