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

feat(NetworkIdentity): Reuse Network IDs #3734

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

MrGadget1024
Copy link
Collaborator

@MrGadget1024 MrGadget1024 commented Jan 12, 2024

  • Uses a Queue (FIFO) with delay time in seconds
  • Configurable in Network Manager (Enabled & Delay)
  • Queue shown in NI Info Panel

image

image

- Uses a Queue (FIFO) with delay time in seconds
- Configurable in Network Manager (Enabled & Delay)
- Pool shown in NI Info Panel
@MrGadget1024 MrGadget1024 added enhancement New feature or request Awaiting Review labels Jan 12, 2024
@MrGadget1024 MrGadget1024 requested a review from miwarnec January 12, 2024 16:40
@Ikalou
Copy link

Ikalou commented Feb 23, 2024

I realized talking to someone on Discord this PR may have an effect on the guarantee that OnStartClient be called on the client during initial spawn in the order in which objects where spawned on the server:

foreach (NetworkIdentity identity in spawned.Values.OrderBy(uv => uv.netId))
. I don't know how important that is I just thought I'd mention it.

@MrGadget1024
Copy link
Collaborator Author

on the guarantee that OnStartClient be called on the client during initial spawn in the order in which objects where spawned on the server

Wouldn't make any difference than current state of affairs today...scene objects would still be the lowest ID's because they get theirs first before spawned objects and players. Obviously if a scene object got unspawned or destroyed, the ID would be recycled with this PR, and given to the next spawned thing, and if the scene object were respawned it would get a much higher ID in either case, separating it from the initial block of ID's of the remaining scene objects.

Also, if player objects are carried through a scene change in DDOL, the scene objects in the new scene would all have ID's higher than that of the player object in current Mirror and would be more likely to get lower ID's if recycled.

Bottom line is that while that OrderBy attempts to spawn players after scene objects so attempts to get references to them from the player object succeed, that is breakable by circumstances described above, with or without this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants