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

OwnerClientId Recycling and disconnection issues #2469

Closed
liambilly9 opened this issue Mar 23, 2023 · 3 comments
Closed

OwnerClientId Recycling and disconnection issues #2469

liambilly9 opened this issue Mar 23, 2023 · 3 comments
Labels
stat:awaiting response Status - Awaiting response from author. stat:awaiting triage Status - Awaiting triage from the Netcode team. type:support Questions or other support

Comments

@liambilly9
Copy link

liambilly9 commented Mar 23, 2023

Description

currently when i disconnect a client e.g with ownerclientid 1 when another client connects instead of being assigned the disconnected id of 1 he is assigned id 2

Reproduce Steps

  1. starthost
  2. connectclient
  3. disconnectclient
  4. reconnectclient

Actual Outcome

the reconnected client gets an incremented OwnerClientID

Expected Outcome

the reconnected client should use the previous disconnected clientid

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • OS: [windows10 pro]
  • Unity Version: [e.g. 2021.3]
  • Netcode Version: [e.g. 1.1.0-]

Additional Context

this also causes trouble when switching scenes as the destroyed playerobject when the client disconnected the first time and a script is trying to be access it

@liambilly9 liambilly9 added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Mar 23, 2023
@ShadauxCat
Copy link
Collaborator

We don't currently support any sort of connection ID recycling, and I don't think we will want to add that. I think it would cause more issues than it would solve. For example, if user Bob is connected with ID of 1, and disconnects, and then user Alice connects, Alice would get the ID that was assigned to Bob. If game code is considering IDs to be equivalent to people (which is reasonable) and still has data structures around that correlate ID 1 to Bob, this could cause issues.

Could you explain why you would want Alice to reuse Bob's ID in this case?

Note: We don't yet have reconnect support to allow Bob to resume a previous session. In the current version, users need to implement that at the user code level using RPCs so that a reconnecting user can send the server identifying information and allow the server to switch those data structures over to be associated with the new connection ID.

@NoelStephensUnity
Copy link
Contributor

@liambilly9
Just to follow up, persisting user information and/or connection state is covered in the session management section on the NGO documentation site.

@NoelStephensUnity NoelStephensUnity added the stat:awaiting response Status - Awaiting response from author. label Apr 6, 2023
@mtarzwell mtarzwell added type:support Questions or other support and removed type:bug Bug Report labels Apr 12, 2023
@NoelStephensUnity NoelStephensUnity closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
@liambilly9
Copy link
Author

a little bit to answer this, but the reason is because, when a player disconnects, he is leaving a null value in the connectedclientsdictionary e.g alice disconnected the dictionarywill read <ulong,networkclient> 1,missing which will later cause null refferences in the game,,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author. stat:awaiting triage Status - Awaiting triage from the Netcode team. type:support Questions or other support
Projects
None yet
Development

No branches or pull requests

4 participants