Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update csharp.md to indicate ConnectAsync is deprecated #3866

Merged
merged 8 commits into from
Jun 21, 2024
Merged
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 %}}
aallbrig marked this conversation as resolved.
Show resolved Hide resolved
{{% 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
Loading