C# Class BeardedManStudios.Network.NetworkingManager

This is a singleton manager for all of the networked behaviors
Inheritance: SimpleNetworkedMonoBehavior
ファイルを表示 Open project: drakelinglabs/unityarmada Class Usage Examples

Public Properties

Property Type Description
allClientsLoaded NetWorker.BasicEvent
frameInterval int
networkInstantiates UnityEngine.GameObject[]
resourcesDirectory string
setupActions List
startNetworkedSceneBehaviors BeardedManStudios.Network.SimpleNetworkedMonoBehavior[]
updateTimeInterval float

Public Methods

Method Description
Disconnect ( ) : void
GetAllSimpleMonoBehaviors ( GameObject o ) : BeardedManStudios.Network.SimpleNetworkedMonoBehavior[]
GetFrameCountFromTime ( double milliseconds ) : byte
Instantiate ( NetworkReceivers receivers, string obj, Vector3 position, Quaternion rotation, int callbackCounter ) : void

This is the main instantiate method that is proxyed through the Networking.Instantiate method

PollPlayerList ( Action callback = null ) : void

Get the latest list of players from the server

Populate ( BeardedManStudios.Network.NetWorker socket ) : bool

This method is used to do all of the initial setup of objects

PullObject ( string name, string fallback = "" ) : GameObject

Get a game object of a given name in the NetworkingManager

SetName ( string newName ) : void

Set the player name for the current running client or server

TryPullIdFromObject ( string obj, ulong &uniqueId ) : bool

Protected Methods

Method Description
NetworkStart ( ) : void

Private Methods

Method Description
Awake ( ) : void
CreateUnityEventObject ( ) : void
DeserializeManualProperties ( NetworkingPlayer player, NetworkingStream stream ) : void
DestroyOnNetwork ( ulong networkId ) : void
InitializeObject ( ulong startObjectId, int count ) : void
NetworkInstantiate ( ulong ownerId, ulong startNetworkId, string name, Vector3 position, Quaternion rotation, int callbackId ) : void
OnLevelWasLoaded ( int level ) : void
PlayerLoadedLevel ( NetworkingPlayer player, NetworkingStream stream ) : void
PollPlayers ( ) : void
PollPlayersResponse ( NetworkingPlayer sender, NetworkingStream stream ) : void
ReadTransportObject ( NetworkingPlayer player, NetworkingStream stream ) : void
SetPlayerName ( string newName ) : void
SkipResetOnDestroy ( ) : void
TellServerLevelLoaded ( int level ) : void
Update ( ) : void
UpdateServerTime ( float time ) : void

Method Details

Disconnect() public method

public Disconnect ( ) : void
return void

GetAllSimpleMonoBehaviors() public static method

public static GetAllSimpleMonoBehaviors ( GameObject o ) : BeardedManStudios.Network.SimpleNetworkedMonoBehavior[]
o UnityEngine.GameObject
return BeardedManStudios.Network.SimpleNetworkedMonoBehavior[]

GetFrameCountFromTime() public method

public GetFrameCountFromTime ( double milliseconds ) : byte
milliseconds double
return byte

Instantiate() public static method

This is the main instantiate method that is proxyed through the Networking.Instantiate method
public static Instantiate ( NetworkReceivers receivers, string obj, Vector3 position, Quaternion rotation, int callbackCounter ) : void
receivers NetworkReceivers The receivers that will get this instantiate command
obj string The name of the object that is to be instantiated
position Vector3 The position where the object will be instantiated at
rotation UnityEngine.Quaternion The rotation that the object will have when instantiated
callbackCounter int The id for the callback that is to be called when this object is instantiated
return void

NetworkStart() protected method

protected NetworkStart ( ) : void
return void

PollPlayerList() public method

Get the latest list of players from the server
public PollPlayerList ( Action callback = null ) : void
callback Action The method to call once the player list has been received
return void

Populate() public method

This method is used to do all of the initial setup of objects
public Populate ( BeardedManStudios.Network.NetWorker socket ) : bool
socket BeardedManStudios.Network.NetWorker
return bool

PullObject() public method

Get a game object of a given name in the NetworkingManager
public PullObject ( string name, string fallback = "" ) : GameObject
name string Name of the game object to pull
fallback string
return UnityEngine.GameObject

SetName() public method

Set the player name for the current running client or server
public SetName ( string newName ) : void
newName string
return void

TryPullIdFromObject() public static method

public static TryPullIdFromObject ( string obj, ulong &uniqueId ) : bool
obj string
uniqueId ulong
return bool

Property Details

allClientsLoaded public_oe property

public NetWorker.BasicEvent allClientsLoaded
return NetWorker.BasicEvent

frameInterval public_oe property

public int frameInterval
return int

networkInstantiates public_oe property

All game objects to be instantiated whenever necessary
public GameObject[],UnityEngine networkInstantiates
return UnityEngine.GameObject[]

resourcesDirectory public_oe property

This is the resources directory where network prefabs are to be loaded from
public string resourcesDirectory
return string

setupActions public_oe static_oe property

The list of all setup actions for when an object is instantiated
public static List setupActions
return List

startNetworkedSceneBehaviors public_oe property

This is a list of all of the behaviors in the scene that need to be setup on the network
public SimpleNetworkedMonoBehavior[],BeardedManStudios.Network startNetworkedSceneBehaviors
return BeardedManStudios.Network.SimpleNetworkedMonoBehavior[]

updateTimeInterval public_oe property

The amount of time in seconds to update the time from the server
public float updateTimeInterval
return float