Skip to main content

Interface INetworkPlayer

An object owned by a player that can: send/receive messages, have network visibility, be an object owner, authenticated permissions, and load scenes. May be from the server to client or from client to server

Syntax
public interface INetworkPlayer : IMessageSender, IVisibilityTracker, IObjectOwner, ISceneLoader

Properties

Connection

Declaration
IConnection Connection { get; }

Address

The IP address / URL / FQDN associated with the connection. Can be useful for a game master to do IP Bans etc.

Best used to get concrete Endpoint type based on the being used

Declaration
IEndPoint Address { get; }

IsConnecting

Connect called on client, but server has not replied yet

Declaration
bool IsConnecting { get; }

IsConnected

Server and Client are connected and can send messages

Declaration
bool IsConnected { get; }

Authentication

Declaration
PlayerAuthentication Authentication { get; }

IsAuthenticated

Declaration
bool IsAuthenticated { get; }

IsHost

True if this Player is the local player on the server or client

Declaration
bool IsHost { get; }

Methods

SetAuthentication(PlayerAuthentication, Boolean)

Declaration
void SetAuthentication(PlayerAuthentication authentication, bool allowReplace = false)
Parameters
TypeNameDescription
Mirage.Authentication.PlayerAuthenticationauthentication
System.BooleanallowReplace

Disconnect()

Declaration
void Disconnect()

MarkAsDisconnected()

Declaration
void MarkAsDisconnected()