mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(EncryptionTransport): Implement OnServerConnectedWithAddress
This commit is contained in:
parent
aad625decc
commit
938cdc6c2a
@ -76,7 +76,9 @@ private void HandleInnerServerDataReceived(int connId, ArraySegment<byte> data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleInnerServerConnected(int connId)
|
private void HandleInnerServerConnected(int connId) => HandleInnerServerConnected(connId, inner.ServerGetClientAddress(connId));
|
||||||
|
|
||||||
|
private void HandleInnerServerConnected(int connId, string clientRemoteAddress)
|
||||||
{
|
{
|
||||||
Debug.Log($"[EncryptionTransport] New connection #{connId}");
|
Debug.Log($"[EncryptionTransport] New connection #{connId}");
|
||||||
EncryptedConnection ec = null;
|
EncryptedConnection ec = null;
|
||||||
@ -89,7 +91,8 @@ private void HandleInnerServerConnected(int connId)
|
|||||||
{
|
{
|
||||||
Debug.Log($"[EncryptionTransport] Connection #{connId} is ready");
|
Debug.Log($"[EncryptionTransport] Connection #{connId} is ready");
|
||||||
ServerRemoveFromPending(ec);
|
ServerRemoveFromPending(ec);
|
||||||
OnServerConnected?.Invoke(connId);
|
//OnServerConnected?.Invoke(connId);
|
||||||
|
OnServerConnectedWithAddress?.Invoke(connId, clientRemoteAddress);
|
||||||
},
|
},
|
||||||
(type, msg) =>
|
(type, msg) =>
|
||||||
{
|
{
|
||||||
@ -206,6 +209,7 @@ public override void ServerStart()
|
|||||||
_credentials = EncryptionCredentials.Generate();
|
_credentials = EncryptionCredentials.Generate();
|
||||||
}
|
}
|
||||||
inner.OnServerConnected = HandleInnerServerConnected;
|
inner.OnServerConnected = HandleInnerServerConnected;
|
||||||
|
inner.OnServerConnectedWithAddress = HandleInnerServerConnected;
|
||||||
inner.OnServerDataReceived = HandleInnerServerDataReceived;
|
inner.OnServerDataReceived = HandleInnerServerDataReceived;
|
||||||
inner.OnServerDataSent = (connId, bytes, channel) => OnServerDataSent?.Invoke(connId, bytes, channel);
|
inner.OnServerDataSent = (connId, bytes, channel) => OnServerDataSent?.Invoke(connId, bytes, channel);
|
||||||
inner.OnServerError = HandleInnerServerError;
|
inner.OnServerError = HandleInnerServerError;
|
||||||
|
Loading…
Reference in New Issue
Block a user