From 2f24d9aa2bba34f7486e32bc9e55e4a319f59a98 Mon Sep 17 00:00:00 2001 From: MrGadget1024 Date: Thu, 10 Dec 2020 14:50:49 -0500 Subject: [PATCH] fix: Added OnStopServer to NetworkMatchChecker --- Assets/Mirror/Components/NetworkMatchChecker.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/Mirror/Components/NetworkMatchChecker.cs b/Assets/Mirror/Components/NetworkMatchChecker.cs index 6aa459cbf..dc91fc083 100644 --- a/Assets/Mirror/Components/NetworkMatchChecker.cs +++ b/Assets/Mirror/Components/NetworkMatchChecker.cs @@ -83,6 +83,14 @@ public override void OnStartServer() // identity.RebuildObservers is called right after this from NetworkServer.SpawnObject } + public override void OnStopServer() + { + if (currentMatch == Guid.Empty) return; + + if (matchPlayers.ContainsKey(currentMatch) && matchPlayers[currentMatch].Remove(netIdentity)) + RebuildMatchObservers(currentMatch); + } + void RebuildMatchObservers(Guid specificMatch) { foreach (NetworkIdentity networkIdentity in matchPlayers[specificMatch])