Repository navigation
Conversation
…iltedphoques#368) An invitation rejected by the server, for example because the recipient already belongs to another party, left the sender's invite button disabled. Even after the recipient left that party, the sender had to leave and recreate their own party to invite them again. Server-side, invitation cleanup iterated a PartyComponent view that is never populated, invitations were keyed by Player pointers, and acceptance did not check the deadline. UI: keep per-player invite state with a short retry cooldown instead of a permanent flag, expire incoming invitations using the remaining time reported by the client, and clear them on join, leave and disconnect. Native client: forward the remaining time, drop invites that are already expired or arrive while in a party, and clear invitations on join and party teardown. Server: key invitations by player id, expire them from the player list, check the deadline when accepting and consume the invitation once, and revoke a player's outgoing invitations when they disconnect or stop leading a party. No new network messages. Adds server component tests (TPServerTests target behind the server_tests xmake option) and extends the party browser tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #368
What was wrong
An invitation that the server rejects, for example because the recipient already belongs to another party, still disabled the sender's invite button. Even after the recipient left that party, the sender had to leave and recreate their own party to invite them again.
Example: A leads a party, B has their own. A invites B and the server rejects it. B leaves their party. Before this change, A's invite button stays disabled and A must leave and recreate the party to invite B. After it, A can invite B again after a short cooldown and B can accept.
Underneath there were three server-side inconsistencies as well: invitation cleanup iterated a
PartyComponententity view that is never populated (player invitations live inPlayer::m_party), invitations were keyed byPlayer*, and acceptance did not check the deadline.What changes
player-list.service.ts,group.service.ts,client.service.ts,typings.d.ts, newmodels/party-invite.ts, mock): per-player invite state with a short retry cooldown instead of a permanent flag; incoming invitations expire using the remaining time reported by the native client; invitations are cleared on join, leave and disconnect; a rejected acceptance keeps other valid invitations.PartyService.cpp): forwards the remaining time to the overlay, drops invitations that are already expired or arrive while in a party, validates the deadline on accept, and clears invitations on join and party teardown.PartyComponent.h,PartyService.cpp/.h): invitations keyed by player id; cleanup walks the player manager;TryConsumeInvitationchecks the deadline on accept and consumes the invitation once;RevokeInvitationsremoves a player's outgoing invitations when they disconnect or stop leading a party.Code/tests/server/party_invitations.cpp) behind aTPServerTeststarget enabled by theserver_testsxmake option (off by default), and the party browser tests extended to ten cases.No new network messages or opcodes. The
TPServerTestsharness is the same one #891 adds for its object tests, minus the object sources; whichever PR lands second will be rebased on it.How it was checked
SkyrimTogetherServer,SkyrimTogetherClient,TPTestsandTPServerTests(117 assertions in 4 cases) build and pass on this branch.An earlier attempt at this issue, #371, was closed without merging in 2023. This PR is limited to invitations.