Skip to content

Commit

Permalink
refactor: renaming remove observers
Browse files Browse the repository at this point in the history
BREAKING CHANGE: NetworkPlayer.RemoveObservers renamed to RemoveAllVisibleObjects
  • Loading branch information
James-Frowen committed Sep 8, 2021
1 parent d65d1e4 commit 12ffce7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Assets/Mirage/Runtime/INetworkPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface IVisibilityTracker
{
void AddToVisList(NetworkIdentity identity);
void RemoveFromVisList(NetworkIdentity identity);
void RemoveObservers();
void RemoveAllVisibleObjects();
}

/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion Assets/Mirage/Runtime/NetworkPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ public void RemoveFromVisList(NetworkIdentity identity)
visList.Remove(identity);
}

public void RemoveObservers()
/// <summary>
/// Removes all objects that this player can see
/// <para>This is called when loading a new scene</para>
/// </summary>
public void RemoveAllVisibleObjects()
{
foreach (NetworkIdentity identity in visList)
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Mirage/Runtime/ServerObjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public void SetClientNotReady(INetworkPlayer player)
{
if (logger.LogEnabled()) logger.Log("PlayerNotReady " + player);
player.SceneIsReady = false;
player.RemoveObservers();
player.RemoveAllVisibleObjects();

player.Send(new NotReadyMessage());
}
Expand Down

0 comments on commit 12ffce7

Please sign in to comment.