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