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

Jnorberg party join request #44

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jnorberg-zynga
Copy link
Contributor

This change expects a new Member in "type Environment struct":

PartyJoinRequestDuration   time.Duration `json:"party_join_request_duration"`

Since that would be a change outside the "nakama-unreal", I'm not sure this would be acceptable

@novabyte novabyte requested a review from zyro December 15, 2020 10:24
online_party_system/party_match.go Outdated Show resolved Hide resolved
}

// Everyone else must be approved by the party leader (in a timely manner)
s.joinRequests[presence.GetUserId()] = time.Now().Add(p.config.JoinRequestDuration)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using time where possible. Express the expiry as a tick number, something like tick + p.config.JoinRequestDuration / time.Second * TickRate (I think, double-check the logic) to get the tick number in the future when the request should expire.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, removed all time.now() from this file

online_party_system/party_match.go Outdated Show resolved Hide resolved
SendResponse(partyMsg, ResponseCodeInternalError, []runtime.Presence{message}, logger, dispatcher)
continue
}
if _, err := nk.StreamUserJoin(6, matchIdComponents[0], "", matchIdComponents[1], presence.GetUserId(), presence.GetSessionId(), false, false, ""); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the call to StreamUserJoin is a problem I think. This is (or was?) how pending join requests are placed into the match when accepted. Am I missing something with this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you now expecting the user to join again once they're on the approved list?

Copy link
Contributor Author

@jnorberg-zynga jnorberg-zynga Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. In my test the "StreamUserJoin" did not work. The "MatchJoinAttempt" or "JoinMatch" was not called. The approach here works fine. It does require the client to listen to and auto-respond to the "Approve" message.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants