Skip to content

Commit

Permalink
Update csharp.md to indicate ConnectAsync is deprecated (#3866)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update site/content/en/docs/Guides/Client SDKs/csharp.md

Co-authored-by: igooch <[email protected]>

* Expiry feature flag also hides remarks about ConnectAsync

* Update csharp.md

Co-authored-by: igooch <[email protected]>

---------

Co-authored-by: igooch <[email protected]>
  • Loading branch information
aallbrig and igooch authored Jun 21, 2024
1 parent da257e0 commit 2c60194
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
12 changes: 0 additions & 12 deletions sdks/csharp/sdk/AgonesSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,6 @@ public IAgonesBetaSDK Beta()
return beta;
}



/// <summary>
/// Connect the underlying gRPC channel.
/// </summary>
/// <returns>Always return true</returns>
[Obsolete("No need to call ConnectAsync anymore")]
public async Task<bool> ConnectAsync()
{
return true;
}

/// <summary>
/// Tells Agones that the Game Server is ready to take player connections
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion sdks/csharp/sdk/IAgonesSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace Agones
{
public interface IAgonesSDK : IDisposable
{
Task<bool> ConnectAsync();
Task<Status> ReadyAsync();
Task<Status> AllocateAsync();
Task<Status> ReserveAsync(long seconds);
Expand Down
12 changes: 8 additions & 4 deletions site/content/en/docs/Guides/Client SDKs/csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2c60194

Please sign in to comment.