mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(MiddlewareTransport): Implement OnServerConnectedWithAddress
This commit is contained in:
parent
8f6b01b0f4
commit
aad625decc
@ -292,13 +292,13 @@ public void TestClientExceptionCallback()
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
[TestCase(0)]
|
[TestCase(0, "")]
|
||||||
[TestCase(1)]
|
[TestCase(1, "")]
|
||||||
[TestCase(19)]
|
[TestCase(19, "")]
|
||||||
public void TestServerConnectedCallback(int id)
|
public void TestServerConnectedCallback(int id, string remoteClientAddress)
|
||||||
{
|
{
|
||||||
int called = 0;
|
int called = 0;
|
||||||
middleware.OnServerConnected = (i) =>
|
middleware.OnServerConnectedWithAddress = (i, remoteClientAddress) =>
|
||||||
{
|
{
|
||||||
called++;
|
called++;
|
||||||
Assert.That(i, Is.EqualTo(id));
|
Assert.That(i, Is.EqualTo(id));
|
||||||
@ -306,10 +306,10 @@ public void TestServerConnectedCallback(int id)
|
|||||||
// start to give callback to inner
|
// start to give callback to inner
|
||||||
middleware.ServerStart();
|
middleware.ServerStart();
|
||||||
|
|
||||||
inner.OnServerConnected.Invoke(id);
|
inner.OnServerConnectedWithAddress.Invoke(id, remoteClientAddress);
|
||||||
Assert.That(called, Is.EqualTo(1));
|
Assert.That(called, Is.EqualTo(1));
|
||||||
|
|
||||||
inner.OnServerConnected.Invoke(id);
|
inner.OnServerConnectedWithAddress.Invoke(id, remoteClientAddress);
|
||||||
Assert.That(called, Is.EqualTo(2));
|
Assert.That(called, Is.EqualTo(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ public override void ClientConnect(string address)
|
|||||||
public override void ServerStart()
|
public override void ServerStart()
|
||||||
{
|
{
|
||||||
inner.OnServerConnected = OnServerConnected;
|
inner.OnServerConnected = OnServerConnected;
|
||||||
|
inner.OnServerConnectedWithAddress = OnServerConnectedWithAddress;
|
||||||
inner.OnServerDataReceived = OnServerDataReceived;
|
inner.OnServerDataReceived = OnServerDataReceived;
|
||||||
inner.OnServerDisconnected = OnServerDisconnected;
|
inner.OnServerDisconnected = OnServerDisconnected;
|
||||||
inner.OnServerError = OnServerError;
|
inner.OnServerError = OnServerError;
|
||||||
|
Loading…
Reference in New Issue
Block a user