C# 클래스 UnityEngine.Networking.NetworkMigrationManager

상속: UnityEngine.MonoBehaviour
파일 보기 프로젝트 열기: CarlosHBC/UnityDecompiled 1 사용 예제들

공개 메소드들

메소드 설명
BecomeNewHost ( int port ) : bool

This causes a client that has been disconnected from the host to become the new host of the game.

DisablePlayerObjects ( ) : void

This causes objects for known players to be disabled.

FindNewHost ( PeerInfoMessage &newHostInfo, bool &youAreNewHost ) : bool
Initialize ( NetworkClient newClient, MatchInfo newMatchInfo ) : void

Used to initialize the migration manager with client and match information.

LostHostOnClient ( NetworkConnection conn ) : bool

This should be called on a client when it has lost its connection to the host.

LostHostOnHost ( ) : void

This should be called on a host when it has has been shutdown.

ReconnectObjectForConnection ( NetworkConnection newConnection, GameObject oldObject, int oldConnectionId ) : bool

This re-establishes a non-player object with client authority with a client that is reconnected. It is similar to NetworkServer.SpawnWithClientAuthority().

ReconnectPlayerForConnection ( NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId ) : bool

This re-establishes a player object with a client that is reconnected. It is similar to NetworkServer.AddPlayerForConnection(). The player game object will become the player object for the new connection.

Reset ( int reconnectId ) : void

Resets the migration manager, and sets the ClientScene's ReconnectId.

SendPeerInfo ( ) : void

This sends the set of peers in the game to all the peers in the game.

보호된 메소드들

메소드 설명
OnAuthorityUpdated ( GameObject go, int connectionId, bool authorityState ) : void

A virtual function that is called when the authority of a non-player object changes.

OnClientDisconnectedFromHost ( NetworkConnection conn, SceneChangeOption &sceneChange ) : void
OnPeersUpdated ( PeerListMessage peers ) : void

A virtual function that is called when the set of peers in the game changes.

OnServerHostShutdown ( ) : void

A virtual function that is called when the host is shutdown.

OnServerReconnectObject ( NetworkConnection newConnection, GameObject oldObject, int oldConnectionId ) : void

A virtual function that is called for non-player objects with client authority on the new host when a client from the old host reconnects to the new host.

OnServerReconnectPlayer ( NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId ) : void

A virtual function that is called on the new host when a client from the old host reconnects to the new host.

OnServerReconnectPlayer ( NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId, NetworkReader extraMessageReader ) : void

A virtual function that is called on the new host when a client from the old host reconnects to the new host.

비공개 메소드들

메소드 설명
AddPendingPlayer ( GameObject obj, int connectionId, NetworkInstanceId netId, short playerControllerId ) : void
AssignAuthorityCallback ( NetworkConnection conn, NetworkIdentity uv, bool authorityState ) : void
FindPendingPlayer ( int connectionId, NetworkInstanceId netId, short playerControllerId ) : GameObject
OnGUI ( ) : void
OnGUIClient ( ) : void
OnGUIHost ( ) : void
OnPeerClientAuthority ( NetworkMessage netMsg ) : void
OnPeerInfo ( NetworkMessage netMsg ) : void
OnServerReconnectPlayerMessage ( NetworkMessage netMsg ) : void
RemovePendingPlayer ( int connectionId ) : void
Start ( ) : void

메소드 상세

BecomeNewHost() 공개 메소드

This causes a client that has been disconnected from the host to become the new host of the game.

public BecomeNewHost ( int port ) : bool
port int The network port to listen on.
리턴 bool

DisablePlayerObjects() 공개 메소드

This causes objects for known players to be disabled.

public DisablePlayerObjects ( ) : void
리턴 void

FindNewHost() 공개 메소드

public FindNewHost ( PeerInfoMessage &newHostInfo, bool &youAreNewHost ) : bool
newHostInfo UnityEngine.Networking.NetworkSystem.PeerInfoMessage
youAreNewHost bool
리턴 bool

Initialize() 공개 메소드

Used to initialize the migration manager with client and match information.

public Initialize ( NetworkClient newClient, MatchInfo newMatchInfo ) : void
newClient NetworkClient The NetworkClient being used to connect to the host.
newMatchInfo UnityEngine.Networking.Match.MatchInfo Information about the match being used. This may be null if there is no match.
리턴 void

LostHostOnClient() 공개 메소드

This should be called on a client when it has lost its connection to the host.

public LostHostOnClient ( NetworkConnection conn ) : bool
conn NetworkConnection The connection of the client that was connected to the host.
리턴 bool

LostHostOnHost() 공개 메소드

This should be called on a host when it has has been shutdown.

public LostHostOnHost ( ) : void
리턴 void

OnAuthorityUpdated() 보호된 메소드

A virtual function that is called when the authority of a non-player object changes.

protected OnAuthorityUpdated ( GameObject go, int connectionId, bool authorityState ) : void
go UnityEngine.GameObject The game object whose authority has changed.
connectionId int The id of the connection whose authority changed for this object.
authorityState bool The new authority state for the object.
리턴 void

OnClientDisconnectedFromHost() 보호된 메소드

protected OnClientDisconnectedFromHost ( NetworkConnection conn, SceneChangeOption &sceneChange ) : void
conn NetworkConnection
sceneChange SceneChangeOption
리턴 void

OnPeersUpdated() 보호된 메소드

A virtual function that is called when the set of peers in the game changes.

protected OnPeersUpdated ( PeerListMessage peers ) : void
peers UnityEngine.Networking.NetworkSystem.PeerListMessage The set of peers in the game.
리턴 void

OnServerHostShutdown() 보호된 메소드

A virtual function that is called when the host is shutdown.

protected OnServerHostShutdown ( ) : void
리턴 void

OnServerReconnectObject() 보호된 메소드

A virtual function that is called for non-player objects with client authority on the new host when a client from the old host reconnects to the new host.

protected OnServerReconnectObject ( NetworkConnection newConnection, GameObject oldObject, int oldConnectionId ) : void
newConnection NetworkConnection The connection of the new client.
oldObject UnityEngine.GameObject The object with authority that is being reconnected.
oldConnectionId int The connectionId of this client on the old host.
리턴 void

OnServerReconnectPlayer() 보호된 메소드

A virtual function that is called on the new host when a client from the old host reconnects to the new host.

protected OnServerReconnectPlayer ( NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId ) : void
newConnection NetworkConnection The connection of the new client.
oldPlayer UnityEngine.GameObject The player object associated with this client.
oldConnectionId int The connectionId of this client on the old host.
playerControllerId short The playerControllerId of the player that is re-joining.
리턴 void

OnServerReconnectPlayer() 보호된 메소드

A virtual function that is called on the new host when a client from the old host reconnects to the new host.

protected OnServerReconnectPlayer ( NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId, NetworkReader extraMessageReader ) : void
newConnection NetworkConnection The connection of the new client.
oldPlayer UnityEngine.GameObject The player object associated with this client.
oldConnectionId int The connectionId of this client on the old host.
playerControllerId short The playerControllerId of the player that is re-joining.
extraMessageReader NetworkReader Additional message data (optional).
리턴 void

ReconnectObjectForConnection() 공개 메소드

This re-establishes a non-player object with client authority with a client that is reconnected. It is similar to NetworkServer.SpawnWithClientAuthority().

public ReconnectObjectForConnection ( NetworkConnection newConnection, GameObject oldObject, int oldConnectionId ) : bool
newConnection NetworkConnection The connection of the new client.
oldObject UnityEngine.GameObject The object with client authority that is being reconnected.
oldConnectionId int This client's connectionId on the old host.
리턴 bool

ReconnectPlayerForConnection() 공개 메소드

This re-establishes a player object with a client that is reconnected. It is similar to NetworkServer.AddPlayerForConnection(). The player game object will become the player object for the new connection.

public ReconnectPlayerForConnection ( NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId ) : bool
newConnection NetworkConnection The connection of the new client.
oldPlayer UnityEngine.GameObject The player object.
oldConnectionId int This client's connectionId on the old host.
playerControllerId short The playerControllerId of the player that is rejoining.
리턴 bool

Reset() 공개 메소드

Resets the migration manager, and sets the ClientScene's ReconnectId.

public Reset ( int reconnectId ) : void
reconnectId int The connectionId for the ClientScene to use when reconnecting.
리턴 void

SendPeerInfo() 공개 메소드

This sends the set of peers in the game to all the peers in the game.

public SendPeerInfo ( ) : void
리턴 void