-
Notifications
You must be signed in to change notification settings - Fork 446
Clearing NetworkList Offline #2969
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
Comments
Hi @KreutzerCode, My assumption is that the NetworkList is on an in-scene placed |
That is correct. It is a “GameManager” game object that is loaded in the first scene of the game, this game object is DontDestroyOnLoad and accompanies the player throughout the game. |
@NoelStephensUnity is this part of the answer to my question? If so, I would appreciate a brief explanation of the process ^^ |
@KreutzerCode Since this kind of functionality would only apply to in-scene placed NetworkObjects and any pooled NetworkObjects used for dynamically spawning, I need to run through a review process for this kind of change. My recommendation (for now) would be to use the "hybrid approach using dynamic spawning of a non-pooled network prefab" where your in-scene placed NetworkObject is (if not already) converted to a network prefab and then in place of the in-scene placed GameManager you have a "GameManagerSpawner" that dynamically spawns the GameManager. This way when the game session completely ends there are no remaining artifacts (if that is an issue for your project). If not... and you were truly curious as to why you can't do this... it was a decision made like 2+ years ago that I think deserves to be revisited but (unfortunately) it will be awhile as it does require an internal review process and then scheduling for this. |
@NoelStephensUnity Just for my interest, will this behaviour be changed in the future as you described? The issue can therefore be closed. Thanks again! |
@KreutzerCode Until we get to that type of update, have you thought about doing the following:
Just letting you know we are tracking this particular issues related to the root issue of not being able to modify |
This is already being tracked in #2539. Closing it as a duplicate. |
Setup:
Unity 2023.2.7f1
Netcode for Gameobjects v1.8.1
Question:
Hi, I have a simple but confusing question about NetworkList variables.
When I was testing the state of my clients when they connect and disconnect a game, I noticed something strange regarading the data of the NetworkList.
Steps:
Now the client can still read the data of the old game session from the NetworkList, but it cannot clear the list because of missing permissions and remains stuck with the old session data. The data is only overwritten when the client joins a new session as a client or host.
I have looked at the documentation and implementation of Networklist and have come to the conclusion that this is an intended behaviour. My question is WHY, and how is it intended to get rid of the old session data when offline?
TLDR: The client cannot delete old data from the NetworkList when the connection to a session is terminated.
If I have overlooked something or am still missing important information to understand my question, please let me know. Many thanks in advance!
The text was updated successfully, but these errors were encountered: