C# 클래스 UnityEngine.Networking.NetworkManager

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

공개 프로퍼티들

프로퍼티 타입 설명
client NetworkClient
isNetworkActive bool
matchInfo MatchInfo
matchMaker NetworkMatch
matches List
networkSceneName string
singleton NetworkManager

Private Properties

프로퍼티 타입 설명
Awake void
CleanupNetworkIdentities void
ClientChangeScene void
ConnectLocalClient NetworkClient
FinishLoadScene void
InitializeSingleton void
OnClientConnectInternal void
OnClientDisconnectInternal void
OnClientErrorInternal void
OnClientNotReadyMessageInternal void
OnClientSceneInternal void
OnDestroy void
OnDomainReload void
OnServerAddPlayerInternal void
OnServerAddPlayerMessageInternal void
OnServerConnectInternal void
OnServerDisconnectInternal void
OnServerErrorInternal void
OnServerReadyMessageInternal void
OnServerRemovePlayerMessageInternal void
OnValidate void
RegisterClientMessages void
RegisterServerMessages void
StartServer bool
UpdateScene void

공개 메소드들

메소드 설명
GetStartPosition ( ) : Transform

This finds a spawn position based on NetworkStartPosition objects in the scene.

IsClientConnected ( ) : bool

This checks if the NetworkManager has a client and that it is connected to a server.

NetworkManager ( ) : System
OnClientConnect ( NetworkConnection conn ) : void

Called on the client when connected to a server.

OnClientDisconnect ( NetworkConnection conn ) : void

Called on clients when disconnected from a server.

OnClientError ( NetworkConnection conn, int errorCode ) : void

Called on clients when a network error occurs.

OnClientNotReady ( NetworkConnection conn ) : void

Called on clients when a servers tells the client it is no longer ready.

OnClientSceneChanged ( NetworkConnection conn ) : void

Called on clients when a scene has completed loaded, when the scene load was initiated by the server.

OnDestroyMatch ( bool success, string extendedInfo ) : void

Callback that happens when a NetworkMatch.DestroyMatch request has been processed on the server.

OnDropConnection ( bool success, string extendedInfo ) : void

Callback that happens when a NetworkMatch.DropConnection match request has been processed on the server.

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

Callback that happens when a NetworkMatch.CreateMatch request has been processed on the server.

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

Callback that happens when a NetworkMatch.JoinMatch request has been processed on the server.

OnMatchList ( bool success, string extendedInfo, List matchList ) : void
OnServerAddPlayer ( NetworkConnection conn, short playerControllerId ) : void

Called on the server when a client adds a new player with ClientScene.AddPlayer.

OnServerAddPlayer ( NetworkConnection conn, short playerControllerId, NetworkReader extraMessageReader ) : void
OnServerConnect ( NetworkConnection conn ) : void

Called on the server when a new client connects.

OnServerDisconnect ( NetworkConnection conn ) : void

Called on the server when a client disconnects.

OnServerError ( NetworkConnection conn, int errorCode ) : void

Called on the server when a network error occurs for a client connection.

OnServerReady ( NetworkConnection conn ) : void

Called on the server when a client is ready.

OnServerRemovePlayer ( NetworkConnection conn, PlayerController player ) : void

Called on the server when a client removes a player.

OnServerSceneChanged ( string sceneName ) : void

Called on the server when a scene is completed loaded, when the scene load was initiated by the server with ServerChangeScene().

OnSetMatchAttributes ( bool success, string extendedInfo ) : void

Callback that happens when a NetworkMatch.SetMatchAttributes has been processed on the server.

OnStartClient ( NetworkClient client ) : void

This is a hook that is invoked when the client is started.

OnStartHost ( ) : void

This hook is invoked when a host is started.

OnStartServer ( ) : void

This hook is invoked when a server is started - including when a host is started.

OnStopClient ( ) : void

This hook is called when a client is stopped.

OnStopHost ( ) : void

This hook is called when a host is stopped.

OnStopServer ( ) : void

This hook is called when a server is stopped - including when a host is stopped.

RegisterStartPosition ( Transform start ) : void

Registers the transform of a game object as a player spawn location.

ServerChangeScene ( string newSceneName ) : void

This causes the server to switch scenes and sets the networkSceneName.

SetMatchHost ( string newHost, int port, bool https ) : void

This sets the address of the MatchMaker service.

SetupMigrationManager ( NetworkMigrationManager man ) : void

This sets up a NetworkMigrationManager object to work with this NetworkManager.

Shutdown ( ) : void

Shuts down the NetworkManager completely and destroy the singleton.

StartClient ( ) : NetworkClient

This starts a network client. It uses the networkAddress and networkPort properties as the address to connect to.

StartClient ( MatchInfo matchInfo ) : NetworkClient
StartClient ( MatchInfo info, ConnectionConfig config ) : NetworkClient
StartHost ( ) : NetworkClient

This starts a network "host" - a server and client in the same application.

StartHost ( ConnectionConfig config, int maxConnections ) : NetworkClient
StartHost ( MatchInfo info ) : NetworkClient
StartMatchMaker ( ) : void

This starts MatchMaker for the NetworkManager.

StartServer ( ) : bool

This starts a new server.

StartServer ( ConnectionConfig config, int maxConnections ) : bool
StartServer ( MatchInfo info ) : bool
StopClient ( ) : void

Stops the client that the manager is using.

StopHost ( ) : void

This stops both the client and the server that the manager is using.

StopMatchMaker ( ) : void

Stops the MatchMaker that the NetworkManager is using.

StopServer ( ) : void

Stops the server that the manager is using.

UnRegisterStartPosition ( Transform start ) : void

Unregisters the transform of a game object as a player spawn location.

UseExternalClient ( NetworkClient externalClient ) : void

This allows the NetworkManager to use a client object created externally to the NetworkManager instead of using StartClient().

비공개 메소드들

메소드 설명
Awake ( ) : void
CleanupNetworkIdentities ( ) : void
ClientChangeScene ( string newSceneName, bool forceReload ) : void
ConnectLocalClient ( ) : NetworkClient
FinishLoadScene ( ) : void
InitializeSingleton ( ) : void
OnClientConnectInternal ( NetworkMessage netMsg ) : void
OnClientDisconnectInternal ( NetworkMessage netMsg ) : void
OnClientErrorInternal ( NetworkMessage netMsg ) : void
OnClientNotReadyMessageInternal ( NetworkMessage netMsg ) : void
OnClientSceneInternal ( NetworkMessage netMsg ) : void
OnDestroy ( ) : void
OnDomainReload ( ) : void
OnServerAddPlayerInternal ( NetworkConnection conn, short playerControllerId ) : void
OnServerAddPlayerMessageInternal ( NetworkMessage netMsg ) : void
OnServerConnectInternal ( NetworkMessage netMsg ) : void
OnServerDisconnectInternal ( NetworkMessage netMsg ) : void
OnServerErrorInternal ( NetworkMessage netMsg ) : void
OnServerReadyMessageInternal ( NetworkMessage netMsg ) : void
OnServerRemovePlayerMessageInternal ( NetworkMessage netMsg ) : void
OnValidate ( ) : void
RegisterClientMessages ( NetworkClient client ) : void
RegisterServerMessages ( ) : void
StartServer ( MatchInfo info, ConnectionConfig config, int maxConnections ) : bool
UpdateScene ( ) : void

메소드 상세

GetStartPosition() 공개 메소드

This finds a spawn position based on NetworkStartPosition objects in the scene.

public GetStartPosition ( ) : Transform
리턴 UnityEngine.Transform

IsClientConnected() 공개 메소드

This checks if the NetworkManager has a client and that it is connected to a server.

public IsClientConnected ( ) : bool
리턴 bool

NetworkManager() 공개 메소드

public NetworkManager ( ) : System
리턴 System

OnClientConnect() 공개 메소드

Called on the client when connected to a server.

public OnClientConnect ( NetworkConnection conn ) : void
conn NetworkConnection Connection to the server.
리턴 void

OnClientDisconnect() 공개 메소드

Called on clients when disconnected from a server.

public OnClientDisconnect ( NetworkConnection conn ) : void
conn NetworkConnection Connection to the server.
리턴 void

OnClientError() 공개 메소드

Called on clients when a network error occurs.

public OnClientError ( NetworkConnection conn, int errorCode ) : void
conn NetworkConnection Connection to a server.
errorCode int Error code.
리턴 void

OnClientNotReady() 공개 메소드

Called on clients when a servers tells the client it is no longer ready.

public OnClientNotReady ( NetworkConnection conn ) : void
conn NetworkConnection Connection to a server.
리턴 void

OnClientSceneChanged() 공개 메소드

Called on clients when a scene has completed loaded, when the scene load was initiated by the server.

public OnClientSceneChanged ( NetworkConnection conn ) : void
conn NetworkConnection The network connection that the scene change message arrived on.
리턴 void

OnDestroyMatch() 공개 메소드

Callback that happens when a NetworkMatch.DestroyMatch request has been processed on the server.

public OnDestroyMatch ( bool success, string extendedInfo ) : void
success bool Indicates if the request succeeded.
extendedInfo string A text description for the error if success is false.
리턴 void

OnDropConnection() 공개 메소드

Callback that happens when a NetworkMatch.DropConnection match request has been processed on the server.

public OnDropConnection ( bool success, string extendedInfo ) : void
success bool Indicates if the request succeeded.
extendedInfo string A text description for the error if success is false.
리턴 void

OnMatchCreate() 공개 메소드

Callback that happens when a NetworkMatch.CreateMatch request has been processed on the server.

public OnMatchCreate ( bool success, string extendedInfo, MatchInfo matchInfo ) : void
success bool Indicates if the request succeeded.
extendedInfo string A text description for the error if success is false.
matchInfo UnityEngine.Networking.Match.MatchInfo The information about the newly created match.
리턴 void

OnMatchJoined() 공개 메소드

Callback that happens when a NetworkMatch.JoinMatch request has been processed on the server.

public OnMatchJoined ( bool success, string extendedInfo, MatchInfo matchInfo ) : void
success bool Indicates if the request succeeded.
extendedInfo string A text description for the error if success is false.
matchInfo UnityEngine.Networking.Match.MatchInfo The info for the newly joined match.
리턴 void

OnMatchList() 공개 메소드

public OnMatchList ( bool success, string extendedInfo, List matchList ) : void
success bool
extendedInfo string
matchList List
리턴 void

OnServerAddPlayer() 공개 메소드

Called on the server when a client adds a new player with ClientScene.AddPlayer.

public OnServerAddPlayer ( NetworkConnection conn, short playerControllerId ) : void
conn NetworkConnection Connection from client.
playerControllerId short Id of the new player.
리턴 void

OnServerAddPlayer() 공개 메소드

public OnServerAddPlayer ( NetworkConnection conn, short playerControllerId, NetworkReader extraMessageReader ) : void
conn NetworkConnection
playerControllerId short
extraMessageReader NetworkReader
리턴 void

OnServerConnect() 공개 메소드

Called on the server when a new client connects.

public OnServerConnect ( NetworkConnection conn ) : void
conn NetworkConnection Connection from client.
리턴 void

OnServerDisconnect() 공개 메소드

Called on the server when a client disconnects.

public OnServerDisconnect ( NetworkConnection conn ) : void
conn NetworkConnection Connection from client.
리턴 void

OnServerError() 공개 메소드

Called on the server when a network error occurs for a client connection.

public OnServerError ( NetworkConnection conn, int errorCode ) : void
conn NetworkConnection Connection from client.
errorCode int Error code.
리턴 void

OnServerReady() 공개 메소드

Called on the server when a client is ready.

public OnServerReady ( NetworkConnection conn ) : void
conn NetworkConnection Connection from client.
리턴 void

OnServerRemovePlayer() 공개 메소드

Called on the server when a client removes a player.

public OnServerRemovePlayer ( NetworkConnection conn, PlayerController player ) : void
conn NetworkConnection The connection to remove the player from.
player PlayerController The player controller to remove.
리턴 void

OnServerSceneChanged() 공개 메소드

Called on the server when a scene is completed loaded, when the scene load was initiated by the server with ServerChangeScene().

public OnServerSceneChanged ( string sceneName ) : void
sceneName string The name of the new scene.
리턴 void

OnSetMatchAttributes() 공개 메소드

Callback that happens when a NetworkMatch.SetMatchAttributes has been processed on the server.

public OnSetMatchAttributes ( bool success, string extendedInfo ) : void
success bool Indicates if the request succeeded.
extendedInfo string A text description for the error if success is false.
리턴 void

OnStartClient() 공개 메소드

This is a hook that is invoked when the client is started.

public OnStartClient ( NetworkClient client ) : void
client NetworkClient The NetworkClient object that was started.
리턴 void

OnStartHost() 공개 메소드

This hook is invoked when a host is started.

public OnStartHost ( ) : void
리턴 void

OnStartServer() 공개 메소드

This hook is invoked when a server is started - including when a host is started.

public OnStartServer ( ) : void
리턴 void

OnStopClient() 공개 메소드

This hook is called when a client is stopped.

public OnStopClient ( ) : void
리턴 void

OnStopHost() 공개 메소드

This hook is called when a host is stopped.

public OnStopHost ( ) : void
리턴 void

OnStopServer() 공개 메소드

This hook is called when a server is stopped - including when a host is stopped.

public OnStopServer ( ) : void
리턴 void

RegisterStartPosition() 공개 정적인 메소드

Registers the transform of a game object as a player spawn location.

public static RegisterStartPosition ( Transform start ) : void
start UnityEngine.Transform Transform to register.
리턴 void

ServerChangeScene() 공개 메소드

This causes the server to switch scenes and sets the networkSceneName.

public ServerChangeScene ( string newSceneName ) : void
newSceneName string The name of the scene to change to. The server will change scene immediately, and a message will be sent to connected clients to ask them to change scene also.
리턴 void

SetMatchHost() 공개 메소드

This sets the address of the MatchMaker service.

public SetMatchHost ( string newHost, int port, bool https ) : void
newHost string Hostname of MatchMaker service.
port int Port of MatchMaker service.
https bool Protocol used by MatchMaker service.
리턴 void

SetupMigrationManager() 공개 메소드

This sets up a NetworkMigrationManager object to work with this NetworkManager.

public SetupMigrationManager ( NetworkMigrationManager man ) : void
man NetworkMigrationManager The migration manager object to use with the NetworkManager.
리턴 void

Shutdown() 공개 정적인 메소드

Shuts down the NetworkManager completely and destroy the singleton.

public static Shutdown ( ) : void
리턴 void

StartClient() 공개 메소드

This starts a network client. It uses the networkAddress and networkPort properties as the address to connect to.

public StartClient ( ) : NetworkClient
리턴 NetworkClient

StartClient() 공개 메소드

public StartClient ( MatchInfo matchInfo ) : NetworkClient
matchInfo UnityEngine.Networking.Match.MatchInfo
리턴 NetworkClient

StartClient() 공개 메소드

public StartClient ( MatchInfo info, ConnectionConfig config ) : NetworkClient
info UnityEngine.Networking.Match.MatchInfo
config ConnectionConfig
리턴 NetworkClient

StartHost() 공개 메소드

This starts a network "host" - a server and client in the same application.

public StartHost ( ) : NetworkClient
리턴 NetworkClient

StartHost() 공개 메소드

public StartHost ( ConnectionConfig config, int maxConnections ) : NetworkClient
config ConnectionConfig
maxConnections int
리턴 NetworkClient

StartHost() 공개 메소드

public StartHost ( MatchInfo info ) : NetworkClient
info UnityEngine.Networking.Match.MatchInfo
리턴 NetworkClient

StartMatchMaker() 공개 메소드

This starts MatchMaker for the NetworkManager.

public StartMatchMaker ( ) : void
리턴 void

StartServer() 공개 메소드

This starts a new server.

public StartServer ( ) : bool
리턴 bool

StartServer() 공개 메소드

public StartServer ( ConnectionConfig config, int maxConnections ) : bool
config ConnectionConfig
maxConnections int
리턴 bool

StartServer() 공개 메소드

public StartServer ( MatchInfo info ) : bool
info UnityEngine.Networking.Match.MatchInfo
리턴 bool

StopClient() 공개 메소드

Stops the client that the manager is using.

public StopClient ( ) : void
리턴 void

StopHost() 공개 메소드

This stops both the client and the server that the manager is using.

public StopHost ( ) : void
리턴 void

StopMatchMaker() 공개 메소드

Stops the MatchMaker that the NetworkManager is using.

public StopMatchMaker ( ) : void
리턴 void

StopServer() 공개 메소드

Stops the server that the manager is using.

public StopServer ( ) : void
리턴 void

UnRegisterStartPosition() 공개 정적인 메소드

Unregisters the transform of a game object as a player spawn location.

public static UnRegisterStartPosition ( Transform start ) : void
start UnityEngine.Transform
리턴 void

UseExternalClient() 공개 메소드

This allows the NetworkManager to use a client object created externally to the NetworkManager instead of using StartClient().

public UseExternalClient ( NetworkClient externalClient ) : void
externalClient NetworkClient The NetworkClient object to use.
리턴 void

프로퍼티 상세

client 공개적으로 프로퍼티

The current NetworkClient being used by the manager.

public NetworkClient,UnityEngine.Networking client
리턴 NetworkClient

isNetworkActive 공개적으로 프로퍼티

True if the NetworkServer or NetworkClient isactive.

public bool isNetworkActive
리턴 bool

matchInfo 공개적으로 프로퍼티

A MatchInfo instance that will be used when StartServer() or StartClient() are called.

public MatchInfo matchInfo
리턴 MatchInfo

matchMaker 공개적으로 프로퍼티

The UMatch MatchMaker object.

public NetworkMatch matchMaker
리턴 NetworkMatch

matches 공개적으로 프로퍼티

The list of matches that are available to join.

public List matches
리턴 List

networkSceneName 공개적으로 정적으로 프로퍼티

The name of the current network scene.

public static string networkSceneName
리턴 string

singleton 공개적으로 정적으로 프로퍼티

The NetworkManager singleton object.

public static NetworkManager singleton
리턴 NetworkManager