mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServerTest: use CreateNetworkedAndSpawnPlayer
This commit is contained in:
parent
a55c75b945
commit
88112e7778
@ -328,13 +328,11 @@ public void Destroy_HostMode_CallsOnStopAuthority()
|
||||
NetworkServer.Listen(1);
|
||||
ConnectHostClientBlockingAuthenticatedAndReady();
|
||||
|
||||
// add player object.
|
||||
// spawn a player(!) object
|
||||
// otherwise client wouldn't receive spawn / authority messages
|
||||
CreateNetworked(out _, out NetworkIdentity player, out StopAuthorityCalledNetworkBehaviour comp);
|
||||
NetworkServer.AddPlayerForConnection(NetworkServer.localConnection, player.gameObject);
|
||||
|
||||
// AddPlayer sends spawn message. process it so NotifyAuthority is called.
|
||||
ProcessMessages();
|
||||
CreateNetworkedAndSpawnPlayer(out _, out NetworkIdentity player,
|
||||
out StopAuthorityCalledNetworkBehaviour comp,
|
||||
NetworkServer.localConnection);
|
||||
|
||||
// need to have authority for this test
|
||||
Assert.That(player.hasAuthority, Is.True);
|
||||
|
Loading…
Reference in New Issue
Block a user