Photon Bolt Engine API  1.2.7
Public Member Functions | Static Private Member Functions | List of all members
BoltInternal.GlobalEventListenerBase Class Reference
Inheritance diagram for BoltInternal.GlobalEventListenerBase:
Bolt.GlobalEventListener

Public Member Functions

virtual void BoltShutdownBegin (Bolt.AddCallback registerDoneCallback)
 Callback triggered when the Bolt simulation is shutting down. More...
 
virtual void BoltShutdownBegin (Bolt.AddCallback registerDoneCallback, UdpConnectionDisconnectReason disconnectReason)
 Callback triggered when the Bolt simulation is shutting down. More...
 
virtual void BoltStartBegin ()
 Callback triggered before the Bolt simulation starts. More...
 
virtual void BoltStartDone ()
 Callback triggered after the Bolt simulation starts. More...
 
virtual void BoltStartFailed ()
 Callback triggered when Bolt was not able to initialize completely. More...
 
virtual void ConnectAttempt (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 Callback triggered when trying to connect to a remote endpoint More...
 
virtual void Connected (BoltConnection connection)
 Callback triggered when a client has become connected to this instance More...
 
virtual void ConnectFailed (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 Callback triggered when a connection to remote server has failed More...
 
virtual void ConnectRefused (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 Callback triggered when the connection to a remote server has been refused. More...
 
virtual void ConnectRequest (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 Callback triggered when this instance receives an incoming client connection More...
 
virtual void ControlOfEntityGained (BoltEntity entity)
 Callback triggered when this instance of bolt receieves control of a bolt entity More...
 
virtual void ControlOfEntityLost (BoltEntity entity)
 Callback triggered when this instance of Bolt loses control of a Bolt entity More...
 
virtual void Disconnected (BoltConnection connection)
 Callback triggered when disconnected from remote server More...
 
virtual void EntityAttached (BoltEntity entity)
 Callback triggered when a new entity is attached to the bolt simulation More...
 
virtual void EntityDetached (BoltEntity entity)
 Callback triggered when a new entity is detached from the bolt simulation More...
 
virtual void EntityFrozen (BoltEntity entity)
 Callback triggered when a bolt entity is frozen. More...
 
virtual void EntityReceived (BoltEntity entity)
 Callback triggered when a bolt entity is recieved from the network More...
 
virtual void EntityThawed (BoltEntity entity)
 Callback triggered when a bolt entity is thawed. More...
 
virtual bool PersistBetweenStartupAndShutdown ()
 Override this method and return true if you want the event listener to keep being attached to Bolt even when Bolt shuts down and starts again. More...
 
virtual void SceneLoadLocalBegin (string scene)
 Callback triggered before the new local scene is loaded. More...
 
virtual void SceneLoadLocalBegin (string scene, Bolt.IProtocolToken token)
 Callback triggered before the new local scene is loaded. More...
 
virtual void SceneLoadLocalDone (string scene)
 Callback triggered after the new local scene has been completely loaded. More...
 
virtual void SceneLoadLocalDone (string scene, Bolt.IProtocolToken token)
 Callback triggered after the new local scene has been completely loaded. More...
 
virtual void SceneLoadRemoteDone (BoltConnection connection)
 Callback triggered when a remote connection has completely loaded the current scene More...
 
virtual void SceneLoadRemoteDone (BoltConnection connection, Bolt.IProtocolToken token)
 Callback triggered when a remote connection has completely loaded the current scene More...
 
virtual void SessionConnectFailed (UdpSession session, Bolt.IProtocolToken token)
 Callback triggered when connecting to a session has failed. More...
 
virtual void SessionCreated (UdpSession session)
 Callback triggered when the requested session creation was successful. More...
 
virtual void SessionCreationFailed (UdpSession session)
 Callback triggered when the requested session creation has failed. More...
 
virtual void SessionListUpdated (Map< System.Guid, UdpSession > sessionList)
 Callback triggered when the session list is updated. More...
 
virtual void StreamDataReceived (BoltConnection connection, UdpStreamData data)
 Callback triggered when binary stream data is received. More...
 

Static Private Member Functions

static internal void BoltShutdownBeginInvoke (Bolt.AddCallback registerDoneCallback)
 
static internal void BoltShutdownBeginInvoke (Bolt.AddCallback registerDoneCallback, UdpConnectionDisconnectReason disconnectReason)
 
static internal void BoltStartBeginInvoke ()
 
static internal void BoltStartDoneInvoke ()
 
static internal void BoltStartFailedInvoke ()
 
static internal void ConnectAttemptInvoke (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 
static internal void ConnectedInvoke (BoltConnection connection)
 
static internal void ConnectFailedInvoke (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 
static internal void ConnectRefusedInvoke (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 
static internal void ConnectRequestInvoke (UdpEndPoint endpoint, Bolt.IProtocolToken token)
 
static internal void ControlOfEntityGainedInvoke (BoltEntity entity)
 
static internal void ControlOfEntityLostInvoke (BoltEntity entity)
 
static internal void DisconnectedInvoke (BoltConnection connection)
 
static internal void EntityAttachedInvoke (BoltEntity entity)
 
static internal void EntityDetachedInvoke (BoltEntity entity)
 
static internal void EntityFrozenInvoke (BoltEntity entity)
 
static internal void EntityReceivedInvoke (BoltEntity entity)
 
static internal void EntityThawedInvoke (BoltEntity entity)
 
static internal void SceneLoadLocalBeginInvoke (string scene)
 
static internal void SceneLoadLocalBeginInvoke (string scene, Bolt.IProtocolToken token)
 
static internal void SceneLoadLocalDoneInvoke (string scene)
 
static internal void SceneLoadLocalDoneInvoke (string scene, Bolt.IProtocolToken token)
 
static internal void SceneLoadRemoteDoneInvoke (BoltConnection connection)
 
static internal void SceneLoadRemoteDoneInvoke (BoltConnection connection, Bolt.IProtocolToken token)
 
static internal void SessionConnectFailedInvoke (UdpSession session, Bolt.IProtocolToken token)
 
static internal void SessionCreatedInvoke (UdpSession session)
 
static internal void SessionCreationFailedInvoke (UdpSession session)
 
static internal void SessionListUpdatedInvoke (Map< System.Guid, UdpSession > sessionList)
 
static internal void StreamDataReceivedInvoke (BoltConnection connection, UdpStreamData data)
 

Member Function Documentation

◆ BoltShutdownBegin() [1/2]

virtual void BoltInternal.GlobalEventListenerBase.BoltShutdownBegin ( Bolt.AddCallback  registerDoneCallback)
inlinevirtual

Callback triggered when the Bolt simulation is shutting down.

Example: Logging a message in the Bolt console when the server has shut down unexpectedly.

public override void BoltShutdown(Bolt.AddCallback registerDoneCallback) {
BoltLog.Warn("Bolt is shutting down");
registerDoneCallback(() =>
{
BoltLog.Warn("Bolt is down");
SceneManager.LoadScene(0);
});
}

◆ BoltShutdownBegin() [2/2]

virtual void BoltInternal.GlobalEventListenerBase.BoltShutdownBegin ( Bolt.AddCallback  registerDoneCallback,
UdpConnectionDisconnectReason  disconnectReason 
)
inlinevirtual

Callback triggered when the Bolt simulation is shutting down.

Example: Logging a message in the Bolt console when the server has shut down unexpectedly.

public override void BoltShutdown(Bolt.AddCallback registerDoneCallback, UdpConnectionDisconnectReason disconnectReason = UdpConnectionDisconnectReason.Disconnected) {
BoltLog.Warn("Bolt is shutting down");
registerDoneCallback(() =>
{
BoltLog.Warn("Bolt is down");
SceneManager.LoadScene(0);
});
}

◆ BoltShutdownBeginInvoke() [1/2]

static internal void BoltInternal.GlobalEventListenerBase.BoltShutdownBeginInvoke ( Bolt.AddCallback  registerDoneCallback)
inlinestaticprivate

◆ BoltShutdownBeginInvoke() [2/2]

static internal void BoltInternal.GlobalEventListenerBase.BoltShutdownBeginInvoke ( Bolt.AddCallback  registerDoneCallback,
UdpConnectionDisconnectReason  disconnectReason 
)
inlinestaticprivate

◆ BoltStartBegin()

virtual void BoltInternal.GlobalEventListenerBase.BoltStartBegin ( )
inlinevirtual

Callback triggered before the Bolt simulation starts.

Example: Logging a message in the console when Bolt is starting.

public override void BoltStartBegin() {
BoltLog.Debug("Warning: Bolt is Starting...");
}

◆ BoltStartBeginInvoke()

static internal void BoltInternal.GlobalEventListenerBase.BoltStartBeginInvoke ( )
inlinestaticprivate

◆ BoltStartDone()

virtual void BoltInternal.GlobalEventListenerBase.BoltStartDone ( )
inlinevirtual

Callback triggered after the Bolt simulation starts.

Example: Logging a message in the console when Bolt is already started.

public override void BoltStartDone() {
BoltLog.Debug("Warning: Bolt started...");
}

◆ BoltStartDoneInvoke()

static internal void BoltInternal.GlobalEventListenerBase.BoltStartDoneInvoke ( )
inlinestaticprivate

◆ BoltStartFailed()

virtual void BoltInternal.GlobalEventListenerBase.BoltStartFailed ( )
inlinevirtual

Callback triggered when Bolt was not able to initialize completely.

Example: Logging a message in the console when Bolt failed to start.

public override void BoltStartFailed() {
BoltLog.Debug("Warning: Bolt failed to start.");
}

◆ BoltStartFailedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.BoltStartFailedInvoke ( )
inlinestaticprivate

◆ ConnectAttempt()

virtual void BoltInternal.GlobalEventListenerBase.ConnectAttempt ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered when trying to connect to a remote endpoint

Parameters
endpointThe remote server address
tokenToken passed by the client when trying to connect to a server.

Example: Logging a message when initializing a connection to server.

public override void ConnectAttempt((UdpEndPoint endpoint) {
BoltLog.Info(string.Format("To Remote Server At ({0}:{1})", endpoint.Address, endpoint.Port);
}

◆ ConnectAttemptInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ConnectAttemptInvoke ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ Connected()

virtual void BoltInternal.GlobalEventListenerBase.Connected ( BoltConnection  connection)
inlinevirtual

Callback triggered when a client has become connected to this instance

Parameters
connectionEndpoint of the connected client

Example: Instantiating and configuring a player entity when a client connects to the server.

public override void Connected(BoltConnection connection) {
BoltLog.Info("Accept Token {0} using Connect Token {1}", connection.AcceptToken, connection.ConnectToken);
var player = BoltNetwork.Instantiate(BoltPrefabs.Player);
player.transform.position = spawnPoint.transform.position;
var initData = prototype.GetNewPlayer(GameLogic.PlayableClass.Mercenary);
Configure(player, initData);
player.AssignControl(connection);
}

◆ ConnectedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ConnectedInvoke ( BoltConnection  connection)
inlinestaticprivate

◆ ConnectFailed()

virtual void BoltInternal.GlobalEventListenerBase.ConnectFailed ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered when a connection to remote server has failed

Parameters
endpointThe remote address
tokenConnect token sent by the client when trying to connect.

Example: Logging an error message when the remote connection has failed.

public override void ConnectFailed(UdpEndPoint endpoint, Bolt.IProtocolToken token) {
BoltLog.Info(string.Format("Connection To ({0}:{1}) has failed", endpoint.Address.ToString(), endpoint.ToString()));
}

◆ ConnectFailedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ConnectFailedInvoke ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ ConnectRefused()

virtual void BoltInternal.GlobalEventListenerBase.ConnectRefused ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered when the connection to a remote server has been refused.

Parameters
endpointThe remote server endpoint
tokenData token sent by the refusing server

Example: Logging an error message when the remote connection has been refused using an error message token from the server.

public override void ConnectRefused(UdpEndPoint endpoint, Bolt.IProtocolToken token) {
ServerMessage.message = (ServerMessage)token;
BoltLog.Info(string.Format("Connection To ({0}:{1}) has been refused. Reason was {3}",
endpoint.Address.ToString(), endpoint.ToString(), serverMessage.errorDescription));
}

◆ ConnectRefusedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ConnectRefusedInvoke ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ ConnectRequest()

virtual void BoltInternal.GlobalEventListenerBase.ConnectRequest ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered when this instance receives an incoming client connection

Parameters
endpointThe incoming client endpoint
tokenA data token sent from the incoming client

Example: Accepting an incoming connection with user credentials in the data token.

public override void ConnectRequest(UdpEndPoint endpoint, Bolt.IProtocolToken token) {
UserCredentials creds = (UserCredentials)token);
if(Authenticate(creds.username, creds.password)) {
BoltNetwork.Accept(connection.remoteEndPoint);
}
}

◆ ConnectRequestInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ConnectRequestInvoke ( UdpEndPoint  endpoint,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ ControlOfEntityGained()

virtual void BoltInternal.GlobalEventListenerBase.ControlOfEntityGained ( BoltEntity  entity)
inlinevirtual

Callback triggered when this instance of bolt receieves control of a bolt entity

Parameters
entityThe controlled entity

Example: Setting up the game minimap and other components to use a specific entity as the player's controlled entity.

public override void ControlOfEntityGained(BoltEntity entity) {
GameInput.instance.SetControlledEntity(entity);
MiniMap.instance.SetControlledEntity(entity);
}

◆ ControlOfEntityGainedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ControlOfEntityGainedInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ ControlOfEntityLost()

virtual void BoltInternal.GlobalEventListenerBase.ControlOfEntityLost ( BoltEntity  entity)
inlinevirtual

Callback triggered when this instance of Bolt loses control of a Bolt entity

Parameters
entityThe controlled entity

Example: Setting up game components to no longer control an entity.

public override void ControlOfEntityLost(BoltEntity entity) {
BoltLog.Info("Control lost with Token {0}", entity.controlLostToken);
GameInput.instance.RemoveControlledEntity(entity);
MiniMap.instance.RemoveControlledEntity(entity);
}

◆ ControlOfEntityLostInvoke()

static internal void BoltInternal.GlobalEventListenerBase.ControlOfEntityLostInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ Disconnected()

virtual void BoltInternal.GlobalEventListenerBase.Disconnected ( BoltConnection  connection)
inlinevirtual

Callback triggered when disconnected from remote server

Parameters
connectionThe remote server endpoint

Example: Logging a disconnect message and returning to the main menu scene.

public override void Disconnected(BoltConnection connection) {
BoltLog.Info("Disconnected with Token {0}", connection.DisconnectToken);
BoltLog.Info("Returning to main menu...");
Application.LoadLevel("MainMenu");
}

◆ DisconnectedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.DisconnectedInvoke ( BoltConnection  connection)
inlinestaticprivate

◆ EntityAttached()

virtual void BoltInternal.GlobalEventListenerBase.EntityAttached ( BoltEntity  entity)
inlinevirtual

Callback triggered when a new entity is attached to the bolt simulation

Parameters
entityThe attached entity

Example: Setting up the game minimap to show a newly attached entity.

public override void EntityAttached(BoltEntity entity) {
MiniMap.instance.SetKnownEntity(entity);
}

◆ EntityAttachedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.EntityAttachedInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ EntityDetached()

virtual void BoltInternal.GlobalEventListenerBase.EntityDetached ( BoltEntity  entity)
inlinevirtual

Callback triggered when a new entity is detached from the bolt simulation

Parameters
entityThe detached entity

Example: Removing the newly detached entity from the game minimap.

public override void EntityDetached(BoltEntity entity) {
MiniMap.instance.RemoveKnownEntity(entity);
}

◆ EntityDetachedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.EntityDetachedInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ EntityFrozen()

virtual void BoltInternal.GlobalEventListenerBase.EntityFrozen ( BoltEntity  entity)
inlinevirtual

Callback triggered when a bolt entity is frozen.

Parameters
entityThe recieved bolt entity

Example: Loggging connections from remote players in the client bolt console

public override void EntityFrozen(BoltEntity entity) {
string name = entity.GetState<PlayerState>().Name;
BoltLog.Info(string.Format("{0} Has been frozen", name));
}

◆ EntityFrozenInvoke()

static internal void BoltInternal.GlobalEventListenerBase.EntityFrozenInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ EntityReceived()

virtual void BoltInternal.GlobalEventListenerBase.EntityReceived ( BoltEntity  entity)
inlinevirtual

Callback triggered when a bolt entity is recieved from the network

Parameters
entityThe recieved bolt entity

Example: Loggging connections from remote players in the client bolt console

public override void EntityReceived(BoltEntity entity) {
string name = entity.GetState<PlayerState>().Name;
BoltLog.Info(string.Format("{0} Has Connected", name));
}

◆ EntityReceivedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.EntityReceivedInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ EntityThawed()

virtual void BoltInternal.GlobalEventListenerBase.EntityThawed ( BoltEntity  entity)
inlinevirtual

Callback triggered when a bolt entity is thawed.

Parameters
entityThe recieved bolt entity

Example: Loggging connections from remote players in the client bolt console

public override void EntityThawed(BoltEntity entity) {
string name = entity.GetState<PlayerState>().Name;
BoltLog.Info(string.Format("{0} Has been thawed", name));
}

◆ EntityThawedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.EntityThawedInvoke ( BoltEntity  entity)
inlinestaticprivate

◆ PersistBetweenStartupAndShutdown()

virtual bool BoltInternal.GlobalEventListenerBase.PersistBetweenStartupAndShutdown ( )
inlinevirtual

Override this method and return true if you want the event listener to keep being attached to Bolt even when Bolt shuts down and starts again.

Returns
True/False

Example: Configuring the persistence behaviour to keep this listener alive between startup and shutdown.

public override bool PersistBetweenStartupAndShutdown() {
return true;
}

◆ SceneLoadLocalBegin() [1/2]

virtual void BoltInternal.GlobalEventListenerBase.SceneLoadLocalBegin ( string  scene)
inlinevirtual

Callback triggered before the new local scene is loaded.

Parameters
sceneName of scene being loaded

Example: Showing a splash screen when clients are loading the game scene.

public override void SceneLoadLocalBegin(string scene) {
if(BoltNetwork.isClient && scene.Equals("GameScene") {
SplashScreen.Show(SplashScreens.GameLoad);
}
}

◆ SceneLoadLocalBegin() [2/2]

virtual void BoltInternal.GlobalEventListenerBase.SceneLoadLocalBegin ( string  scene,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered before the new local scene is loaded.

Parameters
sceneName of scene being loaded
tokenToken passed by the Server when loading the new scene.

Example: Showing a splash screen when clients are loading the game scene.

public override void SceneLoadLocalBegin(string scene, Bolt.IProtocolToken token) {
if(BoltNetwork.isClient && map.Equals("GameScene") {
SplashScreen.Show(SplashScreens.GameLoad);
}
}

◆ SceneLoadLocalBeginInvoke() [1/2]

static internal void BoltInternal.GlobalEventListenerBase.SceneLoadLocalBeginInvoke ( string  scene)
inlinestaticprivate

◆ SceneLoadLocalBeginInvoke() [2/2]

static internal void BoltInternal.GlobalEventListenerBase.SceneLoadLocalBeginInvoke ( string  scene,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ SceneLoadLocalDone() [1/2]

virtual void BoltInternal.GlobalEventListenerBase.SceneLoadLocalDone ( string  scene)
inlinevirtual

Callback triggered after the new local scene has been completely loaded.

Parameters
sceneName of scene that has loaded

Example: Hiding a splash screen that was shown during loading.

public override void SceneLoadLocalDone(string scene) {
if(BoltNetwork.isClient && scene.Equals("GameScene") {
SplashScreen.Hide();
}
}

◆ SceneLoadLocalDone() [2/2]

virtual void BoltInternal.GlobalEventListenerBase.SceneLoadLocalDone ( string  scene,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered after the new local scene has been completely loaded.

Parameters
sceneName of scene that has loaded
tokenToken passed by the Server when loading the new scene.

Example: Hiding a splash screen that was shown during loading.

public override void SceneLoadLocalDone(string scene, Bolt.IProtocolToken token) {
if(BoltNetwork.isClient && scene.Equals("GameScene") {
SplashScreen.Hide();
}
}

◆ SceneLoadLocalDoneInvoke() [1/2]

static internal void BoltInternal.GlobalEventListenerBase.SceneLoadLocalDoneInvoke ( string  scene)
inlinestaticprivate

◆ SceneLoadLocalDoneInvoke() [2/2]

static internal void BoltInternal.GlobalEventListenerBase.SceneLoadLocalDoneInvoke ( string  scene,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ SceneLoadRemoteDone() [1/2]

virtual void BoltInternal.GlobalEventListenerBase.SceneLoadRemoteDone ( BoltConnection  connection)
inlinevirtual

Callback triggered when a remote connection has completely loaded the current scene

Parameters
connectionThe remote connection

Example: Instantiating and configuring a player entity on the server and then assigning control to the client.

public override void SceneLoadRemoteDone(BoltConnection connection) {
var player = BoltNetwork.Instantiate(BoltPrefabs.Player);
player.transform.position = spawnPoint.transform.position;
var initData = prototype.GetNewPlayer(GameLogic.PlayableClass.Mercenary);
Configure(player, initData);
player.AssignControl(connection);
}

◆ SceneLoadRemoteDone() [2/2]

virtual void BoltInternal.GlobalEventListenerBase.SceneLoadRemoteDone ( BoltConnection  connection,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered when a remote connection has completely loaded the current scene

Parameters
connectionThe remote connection
tokenToken passed by the Server when loading the new scene.

Example: Instantiating and configuring a player entity on the server and then assigning control to the client.

public override void SceneLoadRemoteDone(BoltConnection connection, Bolt.IProtocolToken token) {
var player = BoltNetwork.Instantiate(BoltPrefabs.Player);
player.transform.position = spawnPoint.transform.position;
var initData = prototype.GetNewPlayer(GameLogic.PlayableClass.Mercenary);
Configure(player, initData);
player.AssignControl(connection);
}

◆ SceneLoadRemoteDoneInvoke() [1/2]

static internal void BoltInternal.GlobalEventListenerBase.SceneLoadRemoteDoneInvoke ( BoltConnection  connection)
inlinestaticprivate

◆ SceneLoadRemoteDoneInvoke() [2/2]

static internal void BoltInternal.GlobalEventListenerBase.SceneLoadRemoteDoneInvoke ( BoltConnection  connection,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ SessionConnectFailed()

virtual void BoltInternal.GlobalEventListenerBase.SessionConnectFailed ( UdpSession  session,
Bolt.IProtocolToken  token 
)
inlinevirtual

Callback triggered when connecting to a session has failed.

Parameters
sessionThe session the client was trying to connect to
tokenConnection token

Example: Loggging

public override void SessionConnectFailed(UdpSession session, IProtocolToken token)
{
BoltLog.Error("Failed to connect to session {0} with token {1}", session, token);
}

◆ SessionConnectFailedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.SessionConnectFailedInvoke ( UdpSession  session,
Bolt.IProtocolToken  token 
)
inlinestaticprivate

◆ SessionCreated()

virtual void BoltInternal.GlobalEventListenerBase.SessionCreated ( UdpSession  session)
inlinevirtual

Callback triggered when the requested session creation was successful.

Parameters
sessionThe created session

Example: Loggging

public override void SessionCreated(UdpSession session)
{
BoltLog.Info("UdpSession {0} of type {1} was created", session.HostName, session.Source);
}

◆ SessionCreatedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.SessionCreatedInvoke ( UdpSession  session)
inlinestaticprivate

◆ SessionCreationFailed()

virtual void BoltInternal.GlobalEventListenerBase.SessionCreationFailed ( UdpSession  session)
inlinevirtual

Callback triggered when the requested session creation has failed.

Parameters
sessionThe failed session

Example: Loggging

public override void SessionCreationFailed(UdpSession session)
{
BoltLog.Info("UdpSession {0} of type {1} has failed to create", session.HostName, session.Source);
}

◆ SessionCreationFailedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.SessionCreationFailedInvoke ( UdpSession  session)
inlinestaticprivate

◆ SessionListUpdated()

virtual void BoltInternal.GlobalEventListenerBase.SessionListUpdated ( Map< System.Guid, UdpSession >  sessionList)
inlinevirtual

Callback triggered when the session list is updated.

Parameters
sessionListThe updated session list

Example: Loggging all sessions from the list.

public override void SessionListUpdated(Map<System.Guid, UdpSession> sessionList) {
BoltLog.Info("Session list updated: {0} total sessions", sessionList.Count);
foreach (var session in sessionList)
{
UdpSession udpSession = session.Value as UdpSession;
BoltLog.Info("UdpSession {0} Source: {1}", udpSession.HostName, udpSession.Source);
}
}

◆ SessionListUpdatedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.SessionListUpdatedInvoke ( Map< System.Guid, UdpSession >  sessionList)
inlinestaticprivate

◆ StreamDataReceived()

virtual void BoltInternal.GlobalEventListenerBase.StreamDataReceived ( BoltConnection  connection,
UdpStreamData  data 
)
inlinevirtual

Callback triggered when binary stream data is received.

Parameters
connectionThe sender connection
dataThe binary stream data

Example: Receiving a custom player icon.

public override void StreamDataReceived(BoltConnection connnection, UdpStreamData data) {
Texture2D icon = new Texture2D(4, 4);
icon.LoadImage(data.Data);
PlayerData playerData = (PlayerData)connection.userToken;
playerData.SetIcon(icon);
}

◆ StreamDataReceivedInvoke()

static internal void BoltInternal.GlobalEventListenerBase.StreamDataReceivedInvoke ( BoltConnection  connection,
UdpStreamData  data 
)
inlinestaticprivate