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.
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.
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.
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.
Are you now expecting the user to join again once they're on the approved list?
There was a problem hiding this comment.
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