mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
test to reproduce #2797
This commit is contained in:
parent
b0be4a3540
commit
9351c3bb99
@ -320,6 +320,28 @@ public void DisconnectAllTest_LocalConnection()
|
||||
Assert.That(NetworkServer.localConnection, Is.Null);
|
||||
}
|
||||
|
||||
// test to reproduce https://github.com/vis2k/Mirror/pull/2797
|
||||
[Test]
|
||||
public void Destroy_HostMode_CallsOnStopAuthority()
|
||||
{
|
||||
// listen & connect a HOST client
|
||||
NetworkServer.Listen(1);
|
||||
ConnectHostClientBlocking();
|
||||
|
||||
// create & spawn an object
|
||||
// with host connection so we have authority
|
||||
CreateNetworkedAndSpawn(out GameObject go, out NetworkIdentity identity,
|
||||
out StopAuthorityCalledNetworkBehaviour comp,
|
||||
NetworkServer.localConnection);
|
||||
|
||||
// need to have authority for this test
|
||||
Assert.That(identity.hasAuthority, Is.True);
|
||||
|
||||
// destroy should call OnStopAuthority
|
||||
NetworkServer.Destroy(go);
|
||||
Assert.That(comp.called, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
// send a message all the way from client to server
|
||||
[Test]
|
||||
public void Send_ClientToServerMessage()
|
||||
|
Loading…
Reference in New Issue
Block a user