Skip to content

fix: leaving lobby when connection denied #551

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

Merged

Conversation

LPLafontaineB
Copy link
Contributor

Description (*)

With this PR, the host removes clients from the lobby when their connection gets denied. Clients also leave on their side.

Related Pull Requests

Issue Number(s) (*)

Fixes issue(s): MTT-2796

Manual testing scenarios

  1. Start a host
  2. Join with clients normally
  3. Try to join with a client that gets their approval denied (currently not possible under normal circumstances, but can happen if you manually change CharSelectData.k_MaxLobbyPlayers to a value lower than the maximum number of players in the actual Lobby)
  4. See that when you try to join again, you are allowed to and do not receive the "Player is already a part of the lobby" message

Questions or comments

Something to note with this and with #515 is that if the host tries to remove a player at the same time as they are leaving, or vice-versa, it will generate an exception inside the Lobby service saying that it could not find the player. We may want to either catch and ignore that specific exception (not sure if it's a good idea) or maybe see with Lobby if a RemovePlayerAsync alternative could be added that doesn't generate exceptions in that case?

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

LPLafontaineB and others added 25 commits March 7, 2022 12:02
commit a44aeaa
Merge: d66f779 7c5f64e
Author: LPLafontaineB <[email protected]>
Date:   Fri Mar 11 10:30:44 2022 -0500

    Merge branch 'develop' into feature/replace-guid-with-auth-playerid

commit d66f779
Author: LPLafontaineB <[email protected]>
Date:   Fri Mar 11 10:27:22 2022 -0500

    Removed OnlineMode responsability from GameNetPortal

commit 346bb7f
Author: LPLafontaineB <[email protected]>
Date:   Fri Mar 11 09:30:11 2022 -0500

    Simplified ProfileManager property

commit 2973861
Author: LPLafontaineB <[email protected]>
Date:   Fri Mar 11 09:25:09 2022 -0500

    reverted unneeded change

commit 788eb23
Merge: d119ffb ee838ef
Author: Unity Netcode CI <[email protected]>
Date:   Thu Mar 10 18:46:55 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit d119ffb
Author: LPLafontaineB <[email protected]>
Date:   Thu Mar 10 09:56:47 2022 -0500

    cleanup using directives

commit d164192
Author: LPLafontaineB <[email protected]>
Date:   Thu Mar 10 09:53:19 2022 -0500

    refactored GetPlayerId to use AuthService's playerId when signed in on IP connections as well

commit f479872
Author: LPLafontaineB <[email protected]>
Date:   Thu Mar 10 09:45:24 2022 -0500

    Exctracted GetPlayerId to GameNetPortal

commit 9008d77
Merge: 41790b7 4063c42
Author: LPLafontaineB <[email protected]>
Date:   Wed Mar 9 17:47:47 2022 -0500

    Merge branch 'feature/replace-guid-with-auth-playerid' of https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop into feature/replace-guid-with-auth-playerid

commit 41790b7
Author: LPLafontaineB <[email protected]>
Date:   Wed Mar 9 17:47:30 2022 -0500

    Adding back GUID with IP connections

    When not using UGS, player id is now defined as GUID + profile string

commit 4063c42
Merge: 6f27732 fd74095
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 22:43:39 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 0d34e9c
Author: LPLafontaineB <[email protected]>
Date:   Wed Mar 9 17:08:01 2022 -0500

    Revert "Removed guid from ClientPrefs"

    This reverts commit 3d9ebfa.

commit 6f27732
Merge: f13fd7a 974b379
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 21:34:22 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit f13fd7a
Merge: 40d2f89 9978ce0
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 21:33:51 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 40d2f89
Merge: 8975d19 f346969
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 21:14:47 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 8975d19
Merge: 1babc3f 31736f3
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 20:01:35 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 1babc3f
Merge: 5296213 59434fd
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 19:02:29 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 5296213
Merge: 2d83fcf 4818892
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 15:56:06 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 2d83fcf
Merge: b974e90 cee7c1a
Author: Unity Netcode CI <[email protected]>
Date:   Wed Mar 9 15:53:54 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit b974e90
Merge: 77b939f d1c55fa
Author: Unity Netcode CI <[email protected]>
Date:   Tue Mar 8 22:47:44 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 77b939f
Merge: 0d874b5 b83d7b4
Author: Unity Netcode CI <[email protected]>
Date:   Tue Mar 8 19:53:32 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 0d874b5
Merge: 020cce1 be3c9c6
Author: Unity Netcode CI <[email protected]>
Date:   Tue Mar 8 18:48:01 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 020cce1
Merge: e6bb5d5 6b3fe09
Author: Unity Netcode CI <[email protected]>
Date:   Tue Mar 8 18:47:35 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit e6bb5d5
Merge: 47b02ba 891bcd8
Author: Unity Netcode CI <[email protected]>
Date:   Tue Mar 8 00:45:38 2022 +0000

    Merge develop into feature/replace-guid-with-auth-playerid

commit 47b02ba
Author: LPLafontaineB <[email protected]>
Date:   Thu Feb 24 15:28:48 2022 -0500

    cleaning up

commit 62d5ea7
Author: LPLafontaineB <[email protected]>
Date:   Thu Feb 24 15:24:44 2022 -0500

    Made ClientPrefs class static

commit 3d9ebfa
Author: LPLafontaineB <[email protected]>
Date:   Thu Feb 24 15:23:54 2022 -0500

    Removed guid from ClientPrefs

commit 5958c9b
Author: LPLafontaineB <[email protected]>
Date:   Thu Feb 24 15:21:13 2022 -0500

    Removed AddHostData method

commit 4ce6534
Author: LPLafontaineB <[email protected]>
Date:   Thu Feb 24 15:15:38 2022 -0500

    Removed code handling duplicate connections in debug builds

commit 97c2ee1
Author: LPLafontaineB <[email protected]>
Date:   Thu Feb 24 15:14:47 2022 -0500

    Replaced custom guid with playerid for session management

(cherry picked from commit 28e5fc5240050917f81f62107dccbc9b7ae2e856)
…l, and begin tracking after successful reconnect
…pt, and once again at the end if all attempts fail
* Replaced custom guid with playerid for session management when signed in through UGS's Authentication Service

* Removed code handling duplicate connections in debug builds

* When not using UGS, player id is now defined as GUID + profile string

(cherry picked from commit 46e2cef)
@LPLafontaineB LPLafontaineB added 1-Needs Review PR needs attention from the assignee and reviewers GDC-cherrypick labels Mar 14, 2022
@LPLafontaineB LPLafontaineB merged commit 7ec53d1 into release/GDC2022 Mar 15, 2022
@LPLafontaineB LPLafontaineB deleted the fix/leaving-lobby-when-connection-denied branch March 15, 2022 18:13
LPLafontaineB added a commit that referenced this pull request Mar 15, 2022
* client now leaves lobby if their connection gets denied

* host now removes client from lobby when denying connection

* Moved beginning of lobby tracking to after successful connection through ngo

(cherry picked from commit 7ec53d1)
SamuelBellomo pushed a commit that referenced this pull request Mar 15, 2022
* client now leaves lobby if their connection gets denied

* host now removes client from lobby when denying connection

* Moved beginning of lobby tracking to after successful connection through ngo

(cherry picked from commit 7ec53d1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-Needs Review PR needs attention from the assignee and reviewers GDC-cherrypick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants