C# 클래스 BeardedManStudios.Network.Networking

파일 보기 프로젝트 열기: drakelinglabs/unityarmada 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
RunActionsInFixedLoop bool

공개 메소드들

메소드 설명
ChangeClientScene ( BeardedManStudios.Network.NetWorker netWorker, NetworkingPlayer targetPlayer, string sceneName ) : void

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does

ChangeClientScene ( BeardedManStudios.Network.NetWorker netWorker, string sceneName ) : void

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does

ChangeClientScene ( ushort port, NetworkingPlayer targetPlayer, string sceneName ) : void

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does

ChangeClientScene ( ushort port, string sceneName ) : void

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does

ClientReady ( BeardedManStudios.Network.NetWorker socket ) : void
Connect ( string ip, ushort port, TransportationProtocolType comType, bool winRT = false, bool useNat = false, bool standAlone = false ) : BeardedManStudios.Network.NetWorker

Create and connect a client to the specified server ip and port

Destroy ( SimpleNetworkedMonoBehavior netBehavior ) : void

Destroy a simple networked object

Disconnect ( ) : void

Disconnects all sockets and clients for this machine running under this system and removes them all from the lookup (calls Networking.NetworkingReset

Disconnect ( BeardedManStudios.Network.NetWorker socket ) : void

Disconnect the specified NetWorker (socket) and remove it from the Networking.Sockets lookup

Disconnect ( BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player ) : void

Disconnect a player on a given NetWorker(Socket)

Disconnect ( ushort port ) : void

Disconnects (on this machine) either a client or a server on the specified port

Disconnect ( ushort port, NetworkingPlayer player ) : void

Disconnects a player on a given port

DynamicCommand ( BeardedManStudios.Network.NetWorker socket, string command, bool relayOnServer = true, bool reliable = true ) : void
GetLocalIPAddress ( ) : string

Get the local Ip address

Host ( ushort port, TransportationProtocolType comType, int maxConnections, bool winRT = false, string overrideIP = null, bool allowWebplayerConnection = false, bool relayToAll = true, bool useNat = false, BeardedManStudios.Network.NetWorker errorCallback = null ) : BeardedManStudios.Network.NetWorker

Will setup a new server on this machine

InitializeFirewallCheck ( ushort port ) : void

This will force a firewall request by the users machine to allow for network communications with this particular application

Instantiate ( GameObject obj, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void

Instantiate an object on the network

Instantiate ( GameObject obj, Vector3 position, Quaternion rotation, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void

Instantiate an object on the network

Instantiate ( string obj, NetworkReceivers receivers, Action callback = null ) : void

Instantiate an object on the network

Instantiate ( string obj, Vector3 position, Quaternion rotation, NetworkReceivers receivers, Action callback = null ) : void

Instantiate an object on the network

InstantiateFromResources ( string resourcePath, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void

Instantiate an object on the network from the resources folder

InstantiateFromResources ( string resourcePath, Vector3 position, Quaternion rotation, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void

Instantiate an object on the network from the resources folder

IsConnected ( BeardedManStudios.Network.NetWorker socket ) : bool

Determine if a NetWorker(Socket) reference is connected, (Dumbly returns socket.Connected)

IsConnected ( ushort port ) : bool

Determine if a NetWorker(Socket) is connected on a given port

LanDiscovery ( ushort port, int listenWaitTime = 10000, TransportationProtocolType protocol = TransportationProtocolType.UDP, bool winRT = false ) : IPEndPoint
LanDiscovery ( ushort port, int listenWaitTime = 10000, TransportationProtocolType protocol = TransportationProtocolType.UDP, bool winRT = false ) : IPEndPointWinRT

Finds the first host on the network on the specified port number in the local area network and makes a connection to it

NetworkingReset ( ) : void

To reset the network by clearing the sockets and disconnecting them if possible

Ping ( HostInfo host, ushort pingFromPort = 35791 ) : void

Ping a particular host to get its response time in milliseconds

RunInstantiateCallback ( int index, SimpleNetworkedMonoBehavior spawn ) : bool
SetBareMetal ( bool isBareMetal ) : void

Tell the system if we are currently running it as Bare Metal or not - Mainly internal

SetMyMessageGroup ( BeardedManStudios.Network.NetWorker socket, ushort groupId ) : void

This will set the message group for the specified socket connection

SetPrimarySocket ( BeardedManStudios.Network.NetWorker netWorker ) : void

Used to assign the Networking.PrimarySocket object to the specified NetWorker

Write ( BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, NetworkingStream stream ) : void

Writes a NetworkingStream to a particular NetWorker directly to a player (if the port is a server)

Write ( ushort port, NetworkingPlayer player, NetworkingStream stream ) : void

Writes a NetworkingStream to a particular NetWorker that is running on a particular port directly to a player (if the port is a server)

WriteCustom ( uint id, BeardedManStudios.Network.NetWorker netWorker, BMSByte data, NetworkingPlayer target, bool reliableUDP = false ) : void

TODO

WriteCustom ( uint id, BeardedManStudios.Network.NetWorker netWorker, BMSByte data, bool reliableUDP = false, NetworkReceivers recievers = NetworkReceivers.All ) : void

This allows you to write custom data across the network and is useful for serializing entire classes if needed

WriteCustom ( uint id, ushort port, BMSByte data, NetworkReceivers recievers = NetworkReceivers.All ) : void

This allows you to write custom data across the network and is useful for serializing entire classes if needed

WriteRaw ( BeardedManStudios.Network.NetWorker netWorker, BMSByte data, string uniqueId, bool reliable ) : void

Write a custom raw byte message with a 1 byte header across the network

WriteRaw ( BeardedManStudios.Network.NetWorker netWorker, NetworkingPlayer targetPlayer, BMSByte data, string uniqueId, bool reliable = false ) : void

Allows the server to send a raw message to a particular player

WriteTCP ( BeardedManStudios.Network.NetWorker socket, NetworkingStream stream ) : void

Write to the TCP given a NetWorker(Socket) with a stream of data

WriteTCP ( ushort port, NetworkingStream stream ) : void

Write to the TCP given a NetWorker(Socket) with a stream of data

WriteUDP ( BeardedManStudios.Network.NetWorker socket, string identifier, NetworkingStream stream, bool reliable = false ) : void

Writes a NetworkingStream to a particular NetWorker

WriteUDP ( ushort port, string identifier, NetworkingStream stream, bool reliable = false ) : void

Writes a NetworkingStream to a particular NetWorker that is running on a particular port

비공개 메소드들

메소드 설명
CallInstantiate ( string obj, NetworkReceivers receivers, Action callback = null ) : void
CallInstantiate ( string obj, Vector3 position, Quaternion rotation, NetworkReceivers receivers, Action callback = null ) : void
ThreadPing ( object hostObj ) : void
ValidateNetworkedObject ( string name, SimpleNetworkedMonoBehavior &netBehavior ) : bool
WriteUDP ( string ip, ushort port, string updateidentifier, NetworkingStream stream, bool reliable = false ) : void

메소드 상세

ChangeClientScene() 공개 정적인 메소드

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does
public static ChangeClientScene ( BeardedManStudios.Network.NetWorker netWorker, NetworkingPlayer targetPlayer, string sceneName ) : void
netWorker BeardedManStudios.Network.NetWorker The current that will be sending the message
targetPlayer NetworkingPlayer The particular player that will be receiving this message
sceneName string The name of the scene in which the client should load
리턴 void

ChangeClientScene() 공개 정적인 메소드

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does
public static ChangeClientScene ( BeardedManStudios.Network.NetWorker netWorker, string sceneName ) : void
netWorker BeardedManStudios.Network.NetWorker
sceneName string The name of the scene in which the client should load
리턴 void

ChangeClientScene() 공개 정적인 메소드

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does
public static ChangeClientScene ( ushort port, NetworkingPlayer targetPlayer, string sceneName ) : void
port ushort The port of the that is to send the message
targetPlayer NetworkingPlayer The particular player that will be receiving this message
sceneName string The name of the scene in which the client should load
리턴 void

ChangeClientScene() 공개 정적인 메소드

Tells the client to change their scene to the given scene. This is often called after the server has changed to that scene to ensure that the server will always load up the scene before the client does
public static ChangeClientScene ( ushort port, string sceneName ) : void
port ushort The port of the that is to send the message
sceneName string The name of the scene in which the client should load
리턴 void

ClientReady() 공개 정적인 메소드

public static ClientReady ( BeardedManStudios.Network.NetWorker socket ) : void
socket BeardedManStudios.Network.NetWorker
리턴 void

Connect() 공개 정적인 메소드

Create and connect a client to the specified server ip and port
public static Connect ( string ip, ushort port, TransportationProtocolType comType, bool winRT = false, bool useNat = false, bool standAlone = false ) : BeardedManStudios.Network.NetWorker
ip string The host (usually ip address or domain name) to connect to
port ushort The port for the particular server that this connection is attempting
comType TransportationProtocolType The transportation protocol type that is to be used
winRT bool If this is Windows Phone or Windows Store, this should be true, otherwise default to false
useNat bool
standAlone bool
리턴 BeardedManStudios.Network.NetWorker

Destroy() 공개 정적인 메소드

Destroy a simple networked object
public static Destroy ( SimpleNetworkedMonoBehavior netBehavior ) : void
netBehavior SimpleNetworkedMonoBehavior Networked behavior to destroy
리턴 void

Disconnect() 공개 정적인 메소드

Disconnects all sockets and clients for this machine running under this system and removes them all from the lookup (calls Networking.NetworkingReset
public static Disconnect ( ) : void
리턴 void

Disconnect() 공개 정적인 메소드

Disconnect the specified NetWorker (socket) and remove it from the Networking.Sockets lookup
public static Disconnect ( BeardedManStudios.Network.NetWorker socket ) : void
socket BeardedManStudios.Network.NetWorker The socket to be shut down
리턴 void

Disconnect() 공개 정적인 메소드

Disconnect a player on a given NetWorker(Socket)
Thrown when the on the specified port is not a server
public static Disconnect ( BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player ) : void
socket BeardedManStudios.Network.NetWorker NetWorker(Socket) to be disconnected from
player NetworkingPlayer The player reference to disconnect
리턴 void

Disconnect() 공개 정적인 메소드

Disconnects (on this machine) either a client or a server on the specified port
public static Disconnect ( ushort port ) : void
port ushort Port of the local server/client to be disconnected from
리턴 void

Disconnect() 공개 정적인 메소드

Disconnects a player on a given port
Thrown when there is not a on the supplied port Thrown when the on the specified port is not a server
public static Disconnect ( ushort port, NetworkingPlayer player ) : void
port ushort Port to disconnect from
player NetworkingPlayer Player to disconnect
리턴 void

DynamicCommand() 공개 정적인 메소드

public static DynamicCommand ( BeardedManStudios.Network.NetWorker socket, string command, bool relayOnServer = true, bool reliable = true ) : void
socket BeardedManStudios.Network.NetWorker
command string
relayOnServer bool
reliable bool
리턴 void

GetLocalIPAddress() 공개 정적인 메소드

Get the local Ip address
public static GetLocalIPAddress ( ) : string
리턴 string

Host() 공개 정적인 메소드

Will setup a new server on this machine
public static Host ( ushort port, TransportationProtocolType comType, int maxConnections, bool winRT = false, string overrideIP = null, bool allowWebplayerConnection = false, bool relayToAll = true, bool useNat = false, BeardedManStudios.Network.NetWorker errorCallback = null ) : BeardedManStudios.Network.NetWorker
port ushort This is the port you want to bind the server to
comType TransportationProtocolType The particular transportation protocol you wish to be used for this server
maxConnections int The maximum connections (players) allowed on the server at one point in time
winRT bool If this is Windows Phone or Windows Store, this should be true, otherwise default to false
overrideIP string
allowWebplayerConnection bool Allow web player connections to server
relayToAll bool Used to determine if messages should be relayed to client (normally true) - Mainly internal
useNat bool
errorCallback BeardedManStudios.Network.NetWorker
리턴 BeardedManStudios.Network.NetWorker

InitializeFirewallCheck() 공개 정적인 메소드

This will force a firewall request by the users machine to allow for network communications with this particular application
public static InitializeFirewallCheck ( ushort port ) : void
port ushort Port to be allowed
리턴 void

Instantiate() 공개 정적인 메소드

Instantiate an object on the network
public static Instantiate ( GameObject obj, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void
obj UnityEngine.GameObject Object to be instantiated by object name
receivers NetworkReceivers Recipients will receive this instantiate call (Default: All)
callback Action
리턴 void

Instantiate() 공개 정적인 메소드

Instantiate an object on the network
public static Instantiate ( GameObject obj, Vector3 position, Quaternion rotation, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void
obj UnityEngine.GameObject Object to be instantiated by object name
position Vector3 Position of instantiated object
rotation UnityEngine.Quaternion Rotation of instantiated object
receivers NetworkReceivers Recipients will receive this instantiate call (Default: All)
callback Action
리턴 void

Instantiate() 공개 정적인 메소드

Instantiate an object on the network
public static Instantiate ( string obj, NetworkReceivers receivers, Action callback = null ) : void
obj string Object to be instantiated by object name
receivers NetworkReceivers Recipients will receive this instantiate call
callback Action
리턴 void

Instantiate() 공개 정적인 메소드

Instantiate an object on the network
public static Instantiate ( string obj, Vector3 position, Quaternion rotation, NetworkReceivers receivers, Action callback = null ) : void
obj string Object to be instantiated by object name
position Vector3 Position of instantiated object
rotation UnityEngine.Quaternion Rotation of instantiated object
receivers NetworkReceivers Recipients will receive this instantiate call
callback Action
리턴 void

InstantiateFromResources() 공개 정적인 메소드

Instantiate an object on the network from the resources folder
public static InstantiateFromResources ( string resourcePath, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void
resourcePath string Location of the resource
receivers NetworkReceivers Recipients will receive this instantiate call (Default: All)
callback Action
리턴 void

InstantiateFromResources() 공개 정적인 메소드

Instantiate an object on the network from the resources folder
public static InstantiateFromResources ( string resourcePath, Vector3 position, Quaternion rotation, NetworkReceivers receivers = NetworkReceivers.All, Action callback = null ) : void
resourcePath string Location of the resource
position Vector3 Position of instantiated object
rotation UnityEngine.Quaternion Rotation of instantiated object
receivers NetworkReceivers Recipients will receive this instantiate call (Default: All)
callback Action
리턴 void

IsConnected() 공개 정적인 메소드

Determine if a NetWorker(Socket) reference is connected, (Dumbly returns socket.Connected)
public static IsConnected ( BeardedManStudios.Network.NetWorker socket ) : bool
socket BeardedManStudios.Network.NetWorker NetWorker(Socket) to be checked
리턴 bool

IsConnected() 공개 정적인 메소드

Determine if a NetWorker(Socket) is connected on a given port
public static IsConnected ( ushort port ) : bool
port ushort The port number that is to be checked for a connection create by this system
리턴 bool

LanDiscovery() 공개 정적인 메소드

public static LanDiscovery ( ushort port, int listenWaitTime = 10000, TransportationProtocolType protocol = TransportationProtocolType.UDP, bool winRT = false ) : IPEndPoint
port ushort
listenWaitTime int
protocol TransportationProtocolType
winRT bool
리턴 System.Net.IPEndPoint

LanDiscovery() 공개 정적인 메소드

Finds the first host on the network on the specified port number in the local area network and makes a connection to it
public static LanDiscovery ( ushort port, int listenWaitTime = 10000, TransportationProtocolType protocol = TransportationProtocolType.UDP, bool winRT = false ) : IPEndPointWinRT
port ushort The port to connect to
listenWaitTime int The time in milliseconds to wait for a discovery
protocol TransportationProtocolType The protocol type for the server
winRT bool If this is Windows Phone or Windows Store, this should be true, otherwise default to false
리턴 IPEndPointWinRT

NetworkingReset() 공개 정적인 메소드

To reset the network by clearing the sockets and disconnecting them if possible
public static NetworkingReset ( ) : void
리턴 void

Ping() 공개 정적인 메소드

Ping a particular host to get its response time in milliseconds
public static Ping ( HostInfo host, ushort pingFromPort = 35791 ) : void
host HostInfo The host object to ping
pingFromPort ushort
리턴 void

RunInstantiateCallback() 공개 정적인 메소드

public static RunInstantiateCallback ( int index, SimpleNetworkedMonoBehavior spawn ) : bool
index int
spawn SimpleNetworkedMonoBehavior
리턴 bool

SetBareMetal() 공개 정적인 메소드

Tell the system if we are currently running it as Bare Metal or not - Mainly internal
public static SetBareMetal ( bool isBareMetal ) : void
isBareMetal bool If this is a Bare Metal instance
리턴 void

SetMyMessageGroup() 공개 정적인 메소드

This will set the message group for the specified socket connection
public static SetMyMessageGroup ( BeardedManStudios.Network.NetWorker socket, ushort groupId ) : void
socket BeardedManStudios.Network.NetWorker The NetWorker to assign the message group for
groupId ushort The unique identifier for the message group
리턴 void

SetPrimarySocket() 공개 정적인 메소드

Used to assign the Networking.PrimarySocket object to the specified NetWorker
public static SetPrimarySocket ( BeardedManStudios.Network.NetWorker netWorker ) : void
netWorker BeardedManStudios.Network.NetWorker The NetWorker that will be the primary socket
리턴 void

Write() 공개 정적인 메소드

Writes a NetworkingStream to a particular NetWorker directly to a player (if the port is a server)
Thrown when there is not a on the supplied port Thrown when the on the specified port is not a server
public static Write ( BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, NetworkingStream stream ) : void
socket BeardedManStudios.Network.NetWorker NetWorker(Socket) to write with
player NetworkingPlayer Player to be written to server
stream NetworkingStream The stream of data to be written
리턴 void

Write() 공개 정적인 메소드

Writes a NetworkingStream to a particular NetWorker that is running on a particular port directly to a player (if the port is a server)
Thrown when there is not a on the supplied port Thrown when the on the specified port is not a server
public static Write ( ushort port, NetworkingPlayer player, NetworkingStream stream ) : void
port ushort The port that the is listening on
player NetworkingPlayer The player that this server will be writing this message to
stream NetworkingStream The data stream that is to be written to the player
리턴 void

WriteCustom() 공개 정적인 메소드

TODO
public static WriteCustom ( uint id, BeardedManStudios.Network.NetWorker netWorker, BMSByte data, NetworkingPlayer target, bool reliableUDP = false ) : void
id uint Unique identifier to be used
netWorker BeardedManStudios.Network.NetWorker The NetWorker(Socket) to write with
data BMSByte Data to send over
target NetworkingPlayer
reliableUDP bool If this be a reliable UDP
리턴 void

WriteCustom() 공개 정적인 메소드

This allows you to write custom data across the network and is useful for serializing entire classes if needed
public static WriteCustom ( uint id, BeardedManStudios.Network.NetWorker netWorker, BMSByte data, bool reliableUDP = false, NetworkReceivers recievers = NetworkReceivers.All ) : void
id uint Unique identifier to be used
netWorker BeardedManStudios.Network.NetWorker The NetWorker(Socket) to write with
data BMSByte Data to send over
reliableUDP bool If this be a reliable UDP
recievers NetworkReceivers
리턴 void

WriteCustom() 공개 정적인 메소드

This allows you to write custom data across the network and is useful for serializing entire classes if needed
public static WriteCustom ( uint id, ushort port, BMSByte data, NetworkReceivers recievers = NetworkReceivers.All ) : void
id uint Unique identifier to be used
port ushort Port to be written to
data BMSByte Data to send over
recievers NetworkReceivers
리턴 void

WriteRaw() 공개 정적인 메소드

Write a custom raw byte message with a 1 byte header across the network
public static WriteRaw ( BeardedManStudios.Network.NetWorker netWorker, BMSByte data, string uniqueId, bool reliable ) : void
netWorker BeardedManStudios.Network.NetWorker
data BMSByte
uniqueId string
reliable bool
리턴 void

WriteRaw() 공개 정적인 메소드

Allows the server to send a raw message to a particular player
public static WriteRaw ( BeardedManStudios.Network.NetWorker netWorker, NetworkingPlayer targetPlayer, BMSByte data, string uniqueId, bool reliable = false ) : void
netWorker BeardedManStudios.Network.NetWorker
targetPlayer NetworkingPlayer
data BMSByte
uniqueId string
reliable bool
리턴 void

WriteTCP() 공개 정적인 메소드

Write to the TCP given a NetWorker(Socket) with a stream of data
public static WriteTCP ( BeardedManStudios.Network.NetWorker socket, NetworkingStream stream ) : void
socket BeardedManStudios.Network.NetWorker The NetWorker(Socket) to write with
stream NetworkingStream The stream of data to be written
리턴 void

WriteTCP() 공개 정적인 메소드

Write to the TCP given a NetWorker(Socket) with a stream of data
public static WriteTCP ( ushort port, NetworkingStream stream ) : void
port ushort Port of the given NetWorker(Socket)
stream NetworkingStream The stream of data to be written
리턴 void

WriteUDP() 공개 정적인 메소드

Writes a NetworkingStream to a particular NetWorker
public static WriteUDP ( BeardedManStudios.Network.NetWorker socket, string identifier, NetworkingStream stream, bool reliable = false ) : void
socket BeardedManStudios.Network.NetWorker NetWorker(Socket) to write with
identifier string Unique identifier to be used
stream NetworkingStream The stream of data to be written
reliable bool If this be a reliable UDP
리턴 void

WriteUDP() 공개 정적인 메소드

Writes a NetworkingStream to a particular NetWorker that is running on a particular port
public static WriteUDP ( ushort port, string identifier, NetworkingStream stream, bool reliable = false ) : void
port ushort Port of the given NetWorker(Socket)
identifier string Unique identifier to be used
stream NetworkingStream The stream of data to be written
reliable bool If this be a reliable UDP
리턴 void

프로퍼티 상세

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

public static bool RunActionsInFixedLoop
리턴 bool