-
Notifications
You must be signed in to change notification settings - Fork 811
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
PlayerConnect/Disconnect & related Go SDK functions #1519
PlayerConnect/Disconnect & related Go SDK functions #1519
Conversation
sdks/go/alpha.go
Outdated
} | ||
|
||
// PlayerDisconnect Decreases the SDK’s stored player count by one, and removes the playerID from status.players.id | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line could be removed
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
sdks/go/alpha.go
Outdated
// This is always accurate, even if the value hasn’t been updated to the GameServer status yet. | ||
func (a *Alpha) IsPlayerConnected(id string) (bool, error) { | ||
ok, err := a.client.IsPlayerConnected(context.Background(), &alpha.PlayerID{PlayerID: id}) | ||
return ok.Bool, errors.Wrap(err, "could not get if played is connection") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ok.Bool, errors.Wrap(err, "could not get if played is connection") | |
return ok.Bool, errors.Wrap(err, "could not get if the player is connected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! much better!
@@ -36,26 +36,66 @@ func TestAlphaGetAndSetPlayerCapacity(t *testing.T) { | |||
capacity, err := a.GetPlayerCapacity() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be FeaturePlayerTracking
enabled for this test:
err := runtime.ParseFeatures(string(runtime.FeaturePlayerTracking) + "=true")
assert.NoError(t, err)
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to disagree. This is testing against a mock, of which there is only very light logic, that's also not controlled by a feature flag.
There is no need for feature flags at the SDK level either, since this is all controlled by the backing SDK Server.
So I don't see any reason to have this here? Unless I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Agree with you.
Build Succeeded 👏 Build Id: 7ca3e4e8-08fb-481c-aa65-dbaa86cff148 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Includes implementations and unit tests for PlayerConnect, PlayerDisconnect, GetPlayerCount, IsPlayerConnected and GetConnectedPlayers. Conformance tests will come in the next PR. Work on googleforgames#1507
11bd744
to
ca56940
Compare
Build Failed 😱 Build Id: b51b45e5-4230-49f9-9c76-9286fb4dd7cb To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: f6c4f92a-74ff-42e4-a4ce-6548cb3e7725 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed my nits thanks.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aLekSer, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Build Failed 😱 Build Id: 3c064849-ae00-4119-a813-38c3c6f9ba87 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 77334584-3c45-404f-8096-15c428bd1f39 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
) Includes implementations and unit tests for PlayerConnect, PlayerDisconnect, GetPlayerCount, IsPlayerConnected and GetConnectedPlayers. Conformance tests will come in the next PR. Work on googleforgames#1507 Co-authored-by: Alexander Apalikov <alexander.apalikov@globant.com>
What type of PR is this?
/kind feature
What this PR does / Why we need it:
Includes implementations and unit tests for PlayerConnect, PlayerDisconnect, GetPlayerCount, IsPlayerConnected and GetConnectedPlayers.
Conformance tests will come in the next PR.
Which issue(s) this PR fixes:
Work on #1507
Special notes for your reviewer: