diff --git a/Assets/Mirror/Tests/Runtime/HostSetup.cs b/Assets/Mirror/Tests/Runtime/HostSetup.cs index 1e1f40d04..65f368aad 100644 --- a/Assets/Mirror/Tests/Runtime/HostSetup.cs +++ b/Assets/Mirror/Tests/Runtime/HostSetup.cs @@ -18,6 +18,16 @@ public class HostSetup protected virtual void afterStartHost() { } protected virtual void beforeStopHost() { } + protected static void FakeSpawnServerClientIdentity(NetworkIdentity serverNI, NetworkIdentity clientNI) + { + serverNI.OnStartServer(); + serverNI.RebuildObservers(true); + + clientNI.netId = serverNI.netId; + NetworkIdentity.spawned[serverNI.netId] = clientNI; + clientNI.OnStartClient(); + } + [UnitySetUp] public IEnumerator SetupHost() {