mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(MultiplexTransportTest): Update tests to use OnServerConnectedWithAddress
This commit is contained in:
parent
1968ef9f9b
commit
8b6bc74629
@ -238,16 +238,16 @@ public void TestServerConnected()
|
||||
ArraySegment<byte> segment = new ArraySegment<byte>(data);
|
||||
|
||||
// on connect, send a message back
|
||||
void SendMessage(int connectionId)
|
||||
void SendMessage(int connectionId, string remoteClientAddress)
|
||||
{
|
||||
transport.ServerSend(connectionId, segment, 5);
|
||||
}
|
||||
|
||||
// set event and Start to give event to inner
|
||||
transport.OnServerConnected = SendMessage;
|
||||
transport.OnServerConnectedWithAddress = SendMessage;
|
||||
transport.ServerStart();
|
||||
|
||||
transport1.OnServerConnected.Invoke(1);
|
||||
transport1.OnServerConnectedWithAddress.Invoke(1, "");
|
||||
|
||||
transport1.Received().ServerSend(1, segment, 5);
|
||||
}
|
||||
@ -260,14 +260,14 @@ public void TestServerSend()
|
||||
transport.ServerStart();
|
||||
transport.ClientConnect("some.server.com");
|
||||
|
||||
transport.OnServerConnected = _ => {};
|
||||
transport.OnServerConnectedWithAddress = (_,_) => {};
|
||||
transport.OnServerDisconnected = _ => {};
|
||||
|
||||
// connect two connectionIds.
|
||||
// one of them very large to prevent
|
||||
// https://github.com/vis2k/Mirror/issues/3280
|
||||
transport1.OnServerConnected(10);
|
||||
transport2.OnServerConnected(int.MaxValue);
|
||||
transport1.OnServerConnectedWithAddress(10, "");
|
||||
transport2.OnServerConnectedWithAddress(int.MaxValue, "");
|
||||
|
||||
byte[] data = { 1, 2, 3 };
|
||||
ArraySegment<byte> segment = new ArraySegment<byte>(data);
|
||||
|
Loading…
Reference in New Issue
Block a user