Skip to content

Mirror::NetworkAuthenticator

Base class for implementing component-based authentication during the Connect phase

Inherits from MonoBehaviour

Inherited by BasicAuthenticator, TimeoutAuthenticator

Public Functions

Name
virtual void OnStartServer()
Called on server from StartServer to initialize the Authenticator
virtual abstract void OnServerAuthenticate(NetworkConnection conn) =0
Called on server from OnServerAuthenticateInternal when a client needs to authenticate
virtual void OnStartClient()
Called on client from StartClient to initialize the Authenticator
virtual abstract void OnClientAuthenticate(NetworkConnection conn) =0
Called on client from OnClientAuthenticateInternal when a client needs to authenticate

Protected Functions

Name
void ServerAccept(NetworkConnection conn)
void ServerReject(NetworkConnection conn)
void ClientAccept(NetworkConnection conn)
void ClientReject(NetworkConnection conn)

Public Attributes

Name
UnityEventNetworkConnection OnServerAuthenticated
Notify subscribers on the server when a client is authenticated
UnityEventNetworkConnection OnClientAuthenticated
Notify subscribers on the client when the client is authenticated

Public Functions Documentation

function OnStartServer

inline virtual void OnStartServer()

Called on server from StartServer to initialize the Authenticator

Reimplemented by: Mirror::Authenticators::TimeoutAuthenticator::OnStartServer, Mirror::Authenticators::BasicAuthenticator::OnStartServer

Server message handlers should be registered in this method.

function OnServerAuthenticate

virtual abstract void OnServerAuthenticate(
    NetworkConnection conn
) =0

Called on server from OnServerAuthenticateInternal when a client needs to authenticate

Parameters:

  • conn Connection to client.

Reimplemented by: Mirror::Authenticators::TimeoutAuthenticator::OnServerAuthenticate, Mirror::Authenticators::BasicAuthenticator::OnServerAuthenticate

function OnStartClient

inline virtual void OnStartClient()

Called on client from StartClient to initialize the Authenticator

Reimplemented by: Mirror::Authenticators::TimeoutAuthenticator::OnStartClient, Mirror::Authenticators::BasicAuthenticator::OnStartClient

Client message handlers should be registered in this method.

function OnClientAuthenticate

virtual abstract void OnClientAuthenticate(
    NetworkConnection conn
) =0

Called on client from OnClientAuthenticateInternal when a client needs to authenticate

Parameters:

  • conn Connection of the client.

Reimplemented by: Mirror::Authenticators::TimeoutAuthenticator::OnClientAuthenticate, Mirror::Authenticators::BasicAuthenticator::OnClientAuthenticate

Protected Functions Documentation

function ServerAccept

inline void ServerAccept(
    NetworkConnection conn
)

function ServerReject

inline void ServerReject(
    NetworkConnection conn
)

function ClientAccept

inline void ClientAccept(
    NetworkConnection conn
)

function ClientReject

inline void ClientReject(
    NetworkConnection conn
)

Public Attributes Documentation

variable OnServerAuthenticated

UnityEventNetworkConnection OnServerAuthenticated = new [UnityEventNetworkConnection](/Documentation/Cops%20And%20Robbers/Classes/classMirror_1_1UnityEventNetworkConnection/)();

Notify subscribers on the server when a client is authenticated

variable OnClientAuthenticated

UnityEventNetworkConnection OnClientAuthenticated = new [UnityEventNetworkConnection](/Documentation/Cops%20And%20Robbers/Classes/classMirror_1_1UnityEventNetworkConnection/)();

Notify subscribers on the client when the client is authenticated


Updated on 18 January 2021 at 09:53:54 UTC