Tanks Multiplayer  1.5
Public Member Functions | Static Public Member Functions | Public Attributes | Events | List of all members
NetworkManagerCustom

Custom implementation of the most Photon callback handlers for network workflows. This script is responsible for connecting to Photon's Cloud, spawning players and handling disconnects. More...

Inheritance diagram for NetworkManagerCustom:

Public Member Functions

override void OnDisconnected (DisconnectCause cause)
 Called if a connect call to the Photon server failed before or after the connection was established. See the official Photon docs for more details. More...
 
override void OnConnectedToMaster ()
 Called after the connection to the master is established. See the official Photon docs for more details. More...
 
override void OnJoinRandomFailed (short returnCode, string message)
 Called when a joining a random room failed. See the official Photon docs for more details. More...
 
override void OnCreateRoomFailed (short returnCode, string message)
 Called when a creating a room failed. See the official Photon docs for more details. More...
 
override void OnCreatedRoom ()
 Called when this client created a room and entered it. See the official Photon docs for more details. More...
 
override void OnJoinedLobby ()
 Called on entering a lobby on the Master Server. See the official Photon docs for more details. More...
 
override void OnJoinedRoom ()
 Called when entering a room (by creating or joining it). See the official Photon docs for more details. More...
 
override void OnPlayerEnteredRoom (Photon.Realtime.Player player)
 Called when a remote player entered the room. See the official Photon docs for more details. More...
 
override void OnPlayerLeftRoom (Photon.Realtime.Player player)
 Called when a remote player left the room. See the official Photon docs for more details. More...
 
GameObject GetPlayerGameObject (Photon.Realtime.Player player)
 Finds the remotely controlled Player game object of a specific player, by iterating over all Player components and searching for the matching creator. More...
 

Static Public Member Functions

static NetworkManagerCustom GetInstance ()
 Returns a reference to this script instance. More...
 
static void StartMatch (NetworkMode mode)
 Starts initializing and connecting to a game. Depends on the selected network mode. Sets the current player name prior to connecting to the servers. More...
 

Public Attributes

int offlineSceneIndex = 0
 Scene index that gets loaded when disconnecting from a game. More...
 
int onlineSceneIndex = 1
 Scene index that gets loaded after a connection has been established. Will get overridden by random matching scene, when using GameMode filtering. More...
 
int maxPlayers = 12
 Maximum amount of players per room. More...
 
GameObject[] playerPrefabs
 References to the available player prefabs located in a Resources folder. More...
 

Events

static Action connectionFailedEvent
 Event fired when a connection to the matchmaker service failed. More...
 

Detailed Description

Custom implementation of the most Photon callback handlers for network workflows. This script is responsible for connecting to Photon's Cloud, spawning players and handling disconnects.

Member Function Documentation

static NetworkManagerCustom GetInstance ( )
static

Returns a reference to this script instance.

GameObject GetPlayerGameObject ( Photon.Realtime.Player  player)

Finds the remotely controlled Player game object of a specific player, by iterating over all Player components and searching for the matching creator.

override void OnConnectedToMaster ( )

Called after the connection to the master is established. See the official Photon docs for more details.

override void OnCreatedRoom ( )

Called when this client created a room and entered it. See the official Photon docs for more details.

override void OnCreateRoomFailed ( short  returnCode,
string  message 
)

Called when a creating a room failed. See the official Photon docs for more details.

override void OnDisconnected ( DisconnectCause  cause)

Called if a connect call to the Photon server failed before or after the connection was established. See the official Photon docs for more details.

override void OnJoinedLobby ( )

Called on entering a lobby on the Master Server. See the official Photon docs for more details.

override void OnJoinedRoom ( )

Called when entering a room (by creating or joining it). See the official Photon docs for more details.

override void OnJoinRandomFailed ( short  returnCode,
string  message 
)

Called when a joining a random room failed. See the official Photon docs for more details.

override void OnPlayerEnteredRoom ( Photon.Realtime.Player  player)

Called when a remote player entered the room. See the official Photon docs for more details.

override void OnPlayerLeftRoom ( Photon.Realtime.Player  player)

Called when a remote player left the room. See the official Photon docs for more details.

static void StartMatch ( NetworkMode  mode)
static

Starts initializing and connecting to a game. Depends on the selected network mode. Sets the current player name prior to connecting to the servers.

Member Data Documentation

int maxPlayers = 12

Maximum amount of players per room.

int offlineSceneIndex = 0

Scene index that gets loaded when disconnecting from a game.

int onlineSceneIndex = 1

Scene index that gets loaded after a connection has been established. Will get overridden by random matching scene, when using GameMode filtering.

GameObject [] playerPrefabs

References to the available player prefabs located in a Resources folder.

Event Documentation

Action connectionFailedEvent
static

Event fired when a connection to the matchmaker service failed.


The documentation for this class was generated from the following file: