C# 클래스 NetworkDirector, PaperCowboys

상속: MonoBehaviour
파일 보기 프로젝트 열기: Gamieon/PaperCowboys 1 사용 예제들

Private Properties

프로퍼티 타입 설명
RPCOnMasterClientSwitched void
RPCOnMasterClientSwitched void
RPCOnNetworkPlayerConnected void
RPCOnNetworkPlayerConnected void
RPCOnNetworkPlayerDisconnected void
RPCOnNetworkPlayerDisconnected void
RPCSetPlayerCustomFloat void
RPCSetPlayerCustomFloat void
RPCSetPlayerCustomInt void
RPCSetPlayerCustomInt void
RPCSetPlayerCustomString void
RPCSetPlayerCustomString void
RPCValidationFinished void

공개 메소드들

메소드 설명
Awake ( ) : void
BroadcastCustomProperty ( RPCMode target, NetworkPlayer owner, string key, object data ) : void

Called by a client or a server to broadcast their custom property to all other players

BroadcastCustomProperty ( uLink target, uLink owner, string key, object data ) : void

Called by a client or a server to broadcast their custom property to all other players

ClearHostList ( ) : void

Clear the host list which was received by MasterServer.PollHostList.

Connect ( string IP, int remotePort ) : NetworkConnectionError

Connect the specified IP and remotePort.

Connect ( string IP, int remotePort ) : uLink.NetworkConnectionError

Connect the specified IP and remotePort.

Destroy ( GameObject go ) : void

Destroy the specified game object.

Disconnect ( ) : void

Disconnects from the server.

GetCustomPlayerProperty ( NetworkPlayer player, string key ) : object

Called by a server or a client to get a custom player property.

GetCustomPlayerProperty ( uLink player, string key ) : object

Called by a server or a client to get a custom player property.

InitializeServer ( string gameName, int connections, int listenPort ) : void

Initializes the server.

Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group ) : GameObject

Instantiates a game object and invokes a RPCNetworkInstantiate call if there are any additional arguments to send them to the object.

Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group ) : void

Instantiates a game object

InstantiateClientObject ( uLink owner, string prefabName, Vector3 position, Quaternion rotation, int group ) : void

Instantiates a game object

InstantiateSceneObject ( string prefabName, Vector3 position, Quaternion rotation, int group ) : GameObject

Instantiate a scene-owned prefab over the network. For Unity native networking purposes, this is a fancy way of telling the server to instantiate the object

Only the master client can Instantiate scene objects.

InstantiateSceneObject ( string prefabName, Vector3 position, Quaternion rotation, int group ) : void

Instantiate a "scene-owned" prefab over the network. The idea is that it would persist even if the master client left the game. Because we are an authoritative client-server model, however, this function is pretty much the same as Instantiate except it absolutely must be called by the server. (The Photon networking model had a standalone server that designated players as "masters" to be an authority on things).

Only the master client can Instantiate scene objects.

OnConnectedToServer ( ) : void

Called on the client when you have successfully connected to a server.

OnDisconnectedFromServer ( NetworkDisconnection info ) : void

Called on the client when the connection was lost or you disconnected from the server.

OnFailedToConnect ( NetworkConnectionError error ) : void

Called on the client when a connection attempt fails for some reason.

OnPlayerConnected ( NetworkPlayer player ) : void

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected ( NetworkPlayer player ) : void

Called on the server whenever a player is disconnected from the server.

OnServerInitialized ( ) : void

Called on the server whenever a Network.InitializeServer was invoked and has completed.

PollHostList ( ) : HostData[]

Check for the latest host list received by using MasterServer.RequestHostList.

PollHostList ( ) : uLink.HostData[]

Check for the latest host list received by using MasterServer.RequestHostList.

RequestHostList ( ) : void

Request a host list from the master server.

SetPlayerCustomProperties ( Hashtable ht ) : void

Called by a server or a client to set several custom properties for your own player

SetPlayerCustomProperties ( Hashtable ht, bool broadcast ) : void

Called by a server or a client to set several custom properties for your own player

SetPlayerCustomProperty ( NetworkPlayer player, string key, object data ) : void

Called by a server or a client to set the custom property for a player in the game.

SetPlayerCustomProperty ( uLink player, string key, object data ) : void

Called by a server or a client to set the custom property for a player in the game.

uLink_OnConnectedToServer ( ) : void

Called on the client when you have successfully connected to a server.

uLink_OnDisconnectedFromServer ( uLink info ) : void

Called on the client when the connection was lost or you disconnected from the server.

uLink_OnFailedToConnect ( uLink error ) : void

Called on the client when a connection attempt fails for some reason.

uLink_OnHandoverTimeout ( uLink player ) : void

Called on the server whenever a player fails to connect to the server in a timely manner

uLink_OnPlayerApproval ( uLink approval ) : void

Called on the server when approving a new player to join the game

uLink_OnPlayerConnected ( uLink player ) : void

Called on the server whenever a new player has successfully connected.

uLink_OnPlayerDisconnected ( uLink player ) : void

Called on the server whenever a player is disconnected from the server.

uLink_OnServerInitialized ( ) : void

Called on the server whenever a Network.InitializeServer was invoked and has completed.

uLink_OnServerUninitialized ( ) : void

Called on the server whenever a Disconnect was invoked and has completed.

비공개 메소드들

메소드 설명
RPCOnMasterClientSwitched ( NetworkPlayer player ) : void
RPCOnMasterClientSwitched ( uLink player ) : void
RPCOnNetworkPlayerConnected ( NetworkPlayer player ) : void
RPCOnNetworkPlayerConnected ( uLink player ) : void
RPCOnNetworkPlayerDisconnected ( NetworkPlayer player ) : void
RPCOnNetworkPlayerDisconnected ( uLink player ) : void
RPCSetPlayerCustomFloat ( NetworkPlayer player, string key, float data ) : void
RPCSetPlayerCustomFloat ( uLink player, string key, float data ) : void
RPCSetPlayerCustomInt ( NetworkPlayer player, string key, int data ) : void
RPCSetPlayerCustomInt ( uLink player, string key, int data ) : void
RPCSetPlayerCustomString ( NetworkPlayer player, string key, string data ) : void
RPCSetPlayerCustomString ( uLink player, string key, string data ) : void
RPCValidationFinished ( ) : void

메소드 상세

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

BroadcastCustomProperty() 공개 메소드

Called by a client or a server to broadcast their custom property to all other players
public BroadcastCustomProperty ( RPCMode target, NetworkPlayer owner, string key, object data ) : void
target RPCMode
owner NetworkPlayer
key string /// Key. ///
data object /// Data. ///
리턴 void

BroadcastCustomProperty() 공개 메소드

Called by a client or a server to broadcast their custom property to all other players
public BroadcastCustomProperty ( uLink target, uLink owner, string key, object data ) : void
target uLink
owner uLink
key string /// Key. ///
data object /// Data. ///
리턴 void

ClearHostList() 공개 정적인 메소드

Clear the host list which was received by MasterServer.PollHostList.
public static ClearHostList ( ) : void
리턴 void

Connect() 공개 정적인 메소드

Connect the specified IP and remotePort.
public static Connect ( string IP, int remotePort ) : NetworkConnectionError
IP string /// IP address. ///
remotePort int /// Connect to the specified host (ip or domain name) and server port. ///
리턴 NetworkConnectionError

Connect() 공개 정적인 메소드

Connect the specified IP and remotePort.
public static Connect ( string IP, int remotePort ) : uLink.NetworkConnectionError
IP string /// IP address. ///
remotePort int /// Connect to the specified host (ip or domain name) and server port. ///
리턴 uLink.NetworkConnectionError

Destroy() 공개 정적인 메소드

Destroy the specified game object.
public static Destroy ( GameObject go ) : void
go GameObject /// The game object ///
리턴 void

Disconnect() 공개 정적인 메소드

Disconnects from the server.
public static Disconnect ( ) : void
리턴 void

GetCustomPlayerProperty() 공개 정적인 메소드

Called by a server or a client to get a custom player property.
public static GetCustomPlayerProperty ( NetworkPlayer player, string key ) : object
player NetworkPlayer /// Player. ///
key string /// Key. ///
리턴 object

GetCustomPlayerProperty() 공개 정적인 메소드

Called by a server or a client to get a custom player property.
public static GetCustomPlayerProperty ( uLink player, string key ) : object
player uLink /// Player. ///
key string /// Key. ///
리턴 object

InitializeServer() 공개 정적인 메소드

Initializes the server.
public static InitializeServer ( string gameName, int connections, int listenPort ) : void
gameName string
connections int /// Connections. ///
listenPort int /// Listen port. ///
리턴 void

Instantiate() 공개 정적인 메소드

Instantiates a game object and invokes a RPCNetworkInstantiate call if there are any additional arguments to send them to the object.
public static Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group ) : GameObject
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this view.
리턴 GameObject

Instantiate() 공개 메소드

Instantiates a game object
public Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group ) : void
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this view.
리턴 void

InstantiateClientObject() 공개 메소드

Instantiates a game object
public InstantiateClientObject ( uLink owner, string prefabName, Vector3 position, Quaternion rotation, int group ) : void
owner uLink The owning client
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this view.
리턴 void

InstantiateSceneObject() 공개 정적인 메소드

Instantiate a scene-owned prefab over the network. For Unity native networking purposes, this is a fancy way of telling the server to instantiate the object
Only the master client can Instantiate scene objects.
public static InstantiateSceneObject ( string prefabName, Vector3 position, Quaternion rotation, int group ) : GameObject
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this view.
리턴 GameObject

InstantiateSceneObject() 공개 메소드

Instantiate a "scene-owned" prefab over the network. The idea is that it would persist even if the master client left the game. Because we are an authoritative client-server model, however, this function is pretty much the same as Instantiate except it absolutely must be called by the server. (The Photon networking model had a standalone server that designated players as "masters" to be an authority on things).
Only the master client can Instantiate scene objects.
public InstantiateSceneObject ( string prefabName, Vector3 position, Quaternion rotation, int group ) : void
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this view.
리턴 void

OnConnectedToServer() 공개 메소드

Called on the client when you have successfully connected to a server.
public OnConnectedToServer ( ) : void
리턴 void

OnDisconnectedFromServer() 공개 메소드

Called on the client when the connection was lost or you disconnected from the server.
public OnDisconnectedFromServer ( NetworkDisconnection info ) : void
info NetworkDisconnection /// Info. ///
리턴 void

OnFailedToConnect() 공개 메소드

Called on the client when a connection attempt fails for some reason.
public OnFailedToConnect ( NetworkConnectionError error ) : void
error NetworkConnectionError /// Error. ///
리턴 void

OnPlayerConnected() 공개 메소드

Called on the server whenever a new player has successfully connected.
public OnPlayerConnected ( NetworkPlayer player ) : void
player NetworkPlayer /// Player. ///
리턴 void

OnPlayerDisconnected() 공개 메소드

Called on the server whenever a player is disconnected from the server.
public OnPlayerDisconnected ( NetworkPlayer player ) : void
player NetworkPlayer /// Player. ///
리턴 void

OnServerInitialized() 공개 메소드

Called on the server whenever a Network.InitializeServer was invoked and has completed.
public OnServerInitialized ( ) : void
리턴 void

PollHostList() 공개 정적인 메소드

Check for the latest host list received by using MasterServer.RequestHostList.
public static PollHostList ( ) : HostData[]
리턴 HostData[]

PollHostList() 공개 정적인 메소드

Check for the latest host list received by using MasterServer.RequestHostList.
public static PollHostList ( ) : uLink.HostData[]
리턴 uLink.HostData[]

RequestHostList() 공개 정적인 메소드

Request a host list from the master server.
public static RequestHostList ( ) : void
리턴 void

SetPlayerCustomProperties() 공개 정적인 메소드

Called by a server or a client to set several custom properties for your own player
public static SetPlayerCustomProperties ( Hashtable ht ) : void
ht Hashtable /// A hashtable of properties to change ///
리턴 void

SetPlayerCustomProperties() 공개 정적인 메소드

Called by a server or a client to set several custom properties for your own player
public static SetPlayerCustomProperties ( Hashtable ht, bool broadcast ) : void
ht Hashtable /// A hashtable of properties to change ///
broadcast bool /// True if we should broadcast the properties to all players ///
리턴 void

SetPlayerCustomProperty() 공개 정적인 메소드

Called by a server or a client to set the custom property for a player in the game.
public static SetPlayerCustomProperty ( NetworkPlayer player, string key, object data ) : void
player NetworkPlayer /// The player who owns the proerty. ///
key string /// Key. ///
data object /// Data. ///
리턴 void

SetPlayerCustomProperty() 공개 정적인 메소드

Called by a server or a client to set the custom property for a player in the game.
public static SetPlayerCustomProperty ( uLink player, string key, object data ) : void
player uLink /// The player who owns the proerty. ///
key string /// Key. ///
data object /// Data. ///
리턴 void

uLink_OnConnectedToServer() 공개 메소드

Called on the client when you have successfully connected to a server.
public uLink_OnConnectedToServer ( ) : void
리턴 void

uLink_OnDisconnectedFromServer() 공개 메소드

Called on the client when the connection was lost or you disconnected from the server.
public uLink_OnDisconnectedFromServer ( uLink info ) : void
info uLink /// Info. ///
리턴 void

uLink_OnFailedToConnect() 공개 메소드

Called on the client when a connection attempt fails for some reason.
public uLink_OnFailedToConnect ( uLink error ) : void
error uLink /// Error. ///
리턴 void

uLink_OnHandoverTimeout() 공개 메소드

Called on the server whenever a player fails to connect to the server in a timely manner
public uLink_OnHandoverTimeout ( uLink player ) : void
player uLink /// Player. ///
리턴 void

uLink_OnPlayerApproval() 공개 메소드

Called on the server when approving a new player to join the game
public uLink_OnPlayerApproval ( uLink approval ) : void
approval uLink /// Approval. ///
리턴 void

uLink_OnPlayerConnected() 공개 메소드

Called on the server whenever a new player has successfully connected.
public uLink_OnPlayerConnected ( uLink player ) : void
player uLink /// Player. ///
리턴 void

uLink_OnPlayerDisconnected() 공개 메소드

Called on the server whenever a player is disconnected from the server.
public uLink_OnPlayerDisconnected ( uLink player ) : void
player uLink /// Player. ///
리턴 void

uLink_OnServerInitialized() 공개 메소드

Called on the server whenever a Network.InitializeServer was invoked and has completed.
public uLink_OnServerInitialized ( ) : void
리턴 void

uLink_OnServerUninitialized() 공개 메소드

Called on the server whenever a Disconnect was invoked and has completed.
public uLink_OnServerUninitialized ( ) : void
리턴 void