mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkClient.OnConnected/DisconnectEvent: remove redundant NetworkConnection parameter. It's always NetworkClient.connection anyway.
This commit is contained in:
parent
f38d29b61c
commit
5bf7be143c
@ -81,7 +81,7 @@ internal void Update()
|
||||
if (connectedEventPending)
|
||||
{
|
||||
connectedEventPending = false;
|
||||
NetworkClient.OnConnectedEvent?.Invoke(this);
|
||||
NetworkClient.OnConnectedEvent?.Invoke();
|
||||
}
|
||||
|
||||
// process internal messages so they are applied at the correct time
|
||||
@ -99,7 +99,7 @@ internal void Update()
|
||||
if (disconnectedEventPending)
|
||||
{
|
||||
disconnectedEventPending = false;
|
||||
NetworkClient.OnDisconnectedEvent?.Invoke(this);
|
||||
NetworkClient.OnDisconnectedEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,8 @@ public static class NetworkClient
|
||||
// invoked. this introduced a bug where external clients could send
|
||||
// Connected/Disconnected messages over the network causing undefined
|
||||
// behaviour.
|
||||
internal static Action<NetworkConnection> OnConnectedEvent;
|
||||
internal static Action<NetworkConnection> OnDisconnectedEvent;
|
||||
internal static Action OnConnectedEvent;
|
||||
internal static Action OnDisconnectedEvent;
|
||||
|
||||
/// <summary>Registered spawnable prefabs by assetId.</summary>
|
||||
public static readonly Dictionary<Guid, GameObject> prefabs =
|
||||
@ -262,7 +262,7 @@ static void OnConnected()
|
||||
// thus we should set the connected state before calling the handler
|
||||
connectState = ConnectState.Connected;
|
||||
NetworkTime.UpdateClient();
|
||||
OnConnectedEvent?.Invoke(connection);
|
||||
OnConnectedEvent?.Invoke();
|
||||
}
|
||||
else Debug.LogError("Skipped Connect message handling because connection is null.");
|
||||
}
|
||||
@ -281,7 +281,7 @@ static void OnDisconnected()
|
||||
connectState = ConnectState.Disconnected;
|
||||
ready = false;
|
||||
|
||||
if (connection != null) OnDisconnectedEvent?.Invoke(connection);
|
||||
if (connection != null) OnDisconnectedEvent?.Invoke();
|
||||
}
|
||||
|
||||
static void OnError(Exception exception) => Debug.LogException(exception);
|
||||
|
@ -1113,19 +1113,19 @@ void OnServerAddPlayerInternal(NetworkConnection conn, AddPlayerMessage msg)
|
||||
OnServerAddPlayer(conn);
|
||||
}
|
||||
|
||||
void OnClientConnectInternal(NetworkConnection conn)
|
||||
void OnClientConnectInternal()
|
||||
{
|
||||
//Debug.Log("NetworkManager.OnClientConnectInternal");
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
// we have an authenticator - let it handle authentication
|
||||
authenticator.OnClientAuthenticate(conn);
|
||||
authenticator.OnClientAuthenticate(NetworkClient.connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
// authenticate immediately
|
||||
OnClientAuthenticated(conn);
|
||||
OnClientAuthenticated(NetworkClient.connection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1151,10 +1151,10 @@ void OnClientAuthenticated(NetworkConnection conn)
|
||||
}
|
||||
}
|
||||
|
||||
void OnClientDisconnectInternal(NetworkConnection conn)
|
||||
void OnClientDisconnectInternal()
|
||||
{
|
||||
//Debug.Log("NetworkManager.OnClientDisconnectInternal");
|
||||
OnClientDisconnect(conn);
|
||||
OnClientDisconnect(NetworkClient.connection);
|
||||
}
|
||||
|
||||
void OnClientNotReadyMessageInternal(NetworkConnection conn, NotReadyMessage msg)
|
||||
|
Loading…
Reference in New Issue
Block a user