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

Custom implementation of the Unity Networking NetworkManager class. This script is responsible for connecting to the Matchmaker, spawning players and handling disconnects. More...

Inheritance diagram for NetworkManagerCustom:

Public Member Functions

override void OnMatchList (bool success, string extendedInfo, List< MatchInfoSnapshot > matchList)
 Override for the callback received when the list of matchmaker matches returns. This method decides if we can join a game or need to create our own session. More...
 
IEnumerator DiscoverNetwork ()
 Searches for other LAN games in the current network. More...
 
override void OnMatchCreate (bool success, string extendedInfo, MatchInfo matchInfo)
 Override for the callback received when a new match has been created. In this case the user is the host and has to initialize the server part. More...
 
override void OnMatchJoined (bool success, string extendedInfo, MatchInfo matchInfo)
 Override for the callback received when a match has been joined. In this case the user is the client and has to initialize the client part. More...
 
override void OnClientConnect (NetworkConnection conn)
 Override for callback received (on the server) when a new client joins the game. Same as in the UNET source, but modified AddPlayer method with more parameters. More...
 
override void OnClientSceneChanged (NetworkConnection conn)
 Override for the callback received when a client finished loading the game scene. Same as in the UNET source, but modified AddPlayer method with more parameters. More...
 
override void OnServerAddPlayer (NetworkConnection conn, short playerControllerId, NetworkReader extraMessageReader)
 Override for the callback received on the server when a client requests creating its player prefab. Nearly the same as in the UNET source OnServerAddPlayerInternal method, but reading out the message passed in, effectively handling user player prefab selection, assignment to a team and spawning it at the team area. More...
 
override void OnServerDisconnect (NetworkConnection conn)
 Override for the callback received on the server when a client disconnects from the game. Updates the game UI to correctly display the decreased team size. This is not called for the server itself, thus the workaround in GameManager's OnHostMigration method is needed. More...
 
override void OnStopClient ()
 Override for the callback received when a client disconnected. Eventual cleanup of internal high level API UNET variables. More...
 

Static Public Member Functions

static void StartMatch (NetworkMode mode)
 Starts initializing and connecting to a game. Depends on the selected network mode. More...
 

Events

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

Detailed Description

Custom implementation of the Unity Networking NetworkManager class. This script is responsible for connecting to the Matchmaker, spawning players and handling disconnects.

Member Function Documentation

IEnumerator DiscoverNetwork ( )

Searches for other LAN games in the current network.

override void OnClientConnect ( NetworkConnection  conn)

Override for callback received (on the server) when a new client joins the game. Same as in the UNET source, but modified AddPlayer method with more parameters.

override void OnClientSceneChanged ( NetworkConnection  conn)

Override for the callback received when a client finished loading the game scene. Same as in the UNET source, but modified AddPlayer method with more parameters.

override void OnMatchCreate ( bool  success,
string  extendedInfo,
MatchInfo  matchInfo 
)

Override for the callback received when a new match has been created. In this case the user is the host and has to initialize the server part.

override void OnMatchJoined ( bool  success,
string  extendedInfo,
MatchInfo  matchInfo 
)

Override for the callback received when a match has been joined. In this case the user is the client and has to initialize the client part.

override void OnMatchList ( bool  success,
string  extendedInfo,
List< MatchInfoSnapshot >  matchList 
)

Override for the callback received when the list of matchmaker matches returns. This method decides if we can join a game or need to create our own session.

override void OnServerAddPlayer ( NetworkConnection  conn,
short  playerControllerId,
NetworkReader  extraMessageReader 
)

Override for the callback received on the server when a client requests creating its player prefab. Nearly the same as in the UNET source OnServerAddPlayerInternal method, but reading out the message passed in, effectively handling user player prefab selection, assignment to a team and spawning it at the team area.

override void OnServerDisconnect ( NetworkConnection  conn)

Override for the callback received on the server when a client disconnects from the game. Updates the game UI to correctly display the decreased team size. This is not called for the server itself, thus the workaround in GameManager's OnHostMigration method is needed.

override void OnStopClient ( )

Override for the callback received when a client disconnected. Eventual cleanup of internal high level API UNET variables.

static void StartMatch ( NetworkMode  mode)
static

Starts initializing and connecting to a game. Depends on the selected network mode.

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: