FirstGearGames / FishNet

FishNet: Unity Networking Evolved.
Other
1.38k stars 148 forks source link

UnloadConnectionScenes with UnloadUnused doesn't respect scenes that are loading #816

Open FREEZX opened 1 week ago

FREEZX commented 1 week ago

Important

General Unity version: 2022.3.51 Fish-Networking version: 4.5.3 Discord link: https://discord.com/channels/424284635074134018/1296861541798514718/1306624506885836944

Description If the server triggers an additive scene load for a connection, and then subsequently tries to call unload on the same scene for another connection before the first client loads it, the server will actually unload the scene

Replication Steps to reproduce the behavior:

  1. ClientHost has some chunks loaded and is quickly moving to other chunks
  2. Client connects, requires the same chunks the ClientHost has already loaded
  3. ClientHost moves outside of these chunks, therefore it queues unload on these chunks for its own connection.
  4. RemoveOccupiedScenes does not remove the scenes as the client is not already in them, but is actually loading them So the ClientHost actually unloads these scenes, even though it should keep them for the newly connected client.

Expected behavior Server actually keeps the scene that is being loaded on the first client.

FirstGearGames commented 6 days ago

Resolved pending testing in 4.5.6