-
Notifications
You must be signed in to change notification settings - Fork 62
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
base: master
Are you sure you want to change the base?
Jnorberg party join request #44
Conversation
Joining a party checks blocked friends. (heroiclabs#42)
Paginate blocked friends, improve error messages. (heroiclabs#43)
online_party_system/party_match.go
Outdated
} | ||
|
||
// Everyone else must be approved by the party leader (in a timely manner) | ||
s.joinRequests[presence.GetUserId()] = time.Now().Add(p.config.JoinRequestDuration) |
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.
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.
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.
Good call, removed all time.now() from this file
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 { |
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.
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?
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.
Are you now expecting the user to join again once they're on the approved list?
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.
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.
|
1 similar comment
|
This change expects a new Member in "type Environment struct":
Since that would be a change outside the "nakama-unreal", I'm not sure this would be acceptable