mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServerTest: ReadyMessageSetsClientReady cleanup
This commit is contained in:
parent
092ff4538a
commit
26e18d7e87
@ -427,7 +427,6 @@ public void ReadyMessageSetsClientReady()
|
||||
{
|
||||
// listen
|
||||
NetworkServer.Listen(1);
|
||||
Assert.That(NetworkServer.connections.Count, Is.EqualTo(0));
|
||||
|
||||
// add connection
|
||||
CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, out _);
|
||||
@ -437,17 +436,12 @@ public void ReadyMessageSetsClientReady()
|
||||
connectionToClient.isAuthenticated = true;
|
||||
|
||||
// serialize a ready message into an arraysegment
|
||||
ReadyMessage message = new ReadyMessage();
|
||||
NetworkWriter writer = new NetworkWriter();
|
||||
MessagePacking.Pack(message, writer);
|
||||
ArraySegment<byte> segment = writer.ToArraySegment();
|
||||
byte[] message = MessagePackingTest.PackToByteArray(new ReadyMessage());
|
||||
|
||||
// call transport.OnDataReceived with the message
|
||||
// -> calls NetworkServer.OnClientReadyMessage
|
||||
// -> calls SetClientReady(conn)
|
||||
transport.OnServerDataReceived.Invoke(0, segment, 0);
|
||||
|
||||
// ready?
|
||||
transport.OnServerDataReceived.Invoke(0, new ArraySegment<byte>(message), 0);
|
||||
Assert.That(connectionToClient.isReady, Is.True);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user