C# Class BeardedManStudios.Network.SimpleNetworkedMonoBehavior

Inheritance: UnityEngine.MonoBehaviour, INetworkingSerialized
Afficher le fichier Open project: drakelinglabs/unityarmada Class Usage Examples

Méthodes publiques

Свойство Type Description
allowOwnershipChange bool
destroyOnDisconnect bool
dontDestroyOnLoad bool
networkedBehaviors SimpleNetworkedMonoBehavior>.Dictionary
networkedBehaviorsMutex object

Protected Properties

Свойство Type Description
rpcStack List

Méthodes publiques

Méthode Description
AuthoritativeRPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, bool runOnServer ) : void

Used for the server to call an RPC method on a NetWorker(Socket) on a particular player

AuthoritativeURPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, bool runOnServer ) : void

Used for the server to call an URPC method on a NetWorker(Socket) on a particular player

ChangeOwner ( ulong newOwnerPlayerId ) : void
Cleanup ( ) : void
Deserialize ( NetworkingStream stream ) : void

Deserialize the Networking Stream

Disconnect ( ) : void

Used to do final cleanup when disconnecting. This gets called currently on application quit and scene resets

ExecuteRPCStack ( ) : void
GenerateUniqueId ( ) : ulong

Get a generated Unique ID for the next simple networked mono behavior or its derivitive

GetRPC ( int id ) : MethodInfo
GetSceneNetworkedId ( ) : int
Initialize ( BeardedManStudios.Network.NetWorker socket ) : void

An initial setup to make sure that a networking manager exists before running any core logic

InvokeRPC ( NetworkingStreamRPC stream ) : bool

To Invoke an RPC on a given Networking Stream RPC

Locate ( ulong id ) : SimpleNetworkedMonoBehavior

Locate a Simple Networked Monobehavior given a ID

NetworkDestroy ( ulong networkId ) : bool

Destroy a Simple Networked Monobehavior or any of its derivitives with the given Network ID

OfflineStart ( ) : void
QueueRPCForInstantiate ( ulong id, NetworkingStream stream ) : void
RPC ( string methodName ) : void

Call an RPC method with arguments

RPC ( string methodName, BeardedManStudios.Network.NetWorker socket ) : void

Call an RPC method with a NetWorker(Socket) and arguments

RPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers ) : void

Call an RPC method on a NetWorker(Socket) with receivers and arguments

RPC ( string methodName, NetworkReceivers rpcMode ) : void

Call an RPC method with a receiver and arguments

ResetAll ( ) : void
ResetBufferClear ( ) : void

Resets the buffer to be clear again so that it can start buffering

ResetForScene ( List skip ) : void
Serialized ( ) : BMSByte

Serialize the Simple Networked Monobehavior

SetSceneNetworkedId ( int id ) : void
Setup ( BeardedManStudios.Network.NetWorker owningSocket, bool isOwner, ulong networkId, ulong ownerId ) : void

Setup the Simple Networked Monobehavior stack with a NetWorker, owner, network id, and owner id

Setup ( BeardedManStudios.Network.NetWorker owningSocket, bool isOwner, ulong networkId, ulong ownerId, bool isSceneObject = false ) : void
SetupObjects ( SimpleNetworkedMonoBehavior behaviors, BeardedManStudios.Network.NetWorker owningSocket ) : void

Setup the Simple Networked Monobehavior stack with a NetWorker

URPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers ) : void

Call an Unreliable RPC method on a NetWorker(Socket) with receivers and arguments

URPC ( string methodName, NetworkReceivers rpcMode ) : void

Call an Unreliable RPC method with a receiver and arguments

Méthodes protégées

Méthode Description
NetworkDisconnect ( ) : void
NetworkStart ( ) : void

A start method that is called after the object has been setup on the network

NonOwnerFixedUpdate ( ) : void
NonOwnerUpdate ( ) : void
OnApplicationQuit ( ) : void
OnDestroy ( ) : void
OwnerFixedUpdate ( ) : void
OwnerUpdate ( ) : void
Reflect ( ) : void

Get the RPC's of the simple networked monobehavior

UnityFixedUpdate ( ) : void
UnityUpdate ( ) : void

Private Methods

Méthode Description
AssignNewOwner ( ulong newOwnerPlayerId ) : void
AuthRPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, bool runOnServer, string uniqueIdentifier, bool reliable ) : void
DelayedInitialize ( BeardedManStudios.Network.NetWorker socket ) : void
DoOwnerFixedUpdate ( ) : void
DoOwnerUpdate ( ) : void
GetStreamRPC ( string methodName, NetworkReceivers receivers ) : int

Creates a network stream for the method with the specified string name and returns the method info

ServerChangeOwner ( ulong newOwnerPlayerId ) : void
ThrowNetworkerException ( ) : void

Method Details

AuthoritativeRPC() public méthode

Used for the server to call an RPC method on a NetWorker(Socket) on a particular player
public AuthoritativeRPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, bool runOnServer ) : void
methodName string Method(Function) name to call
socket BeardedManStudios.Network.NetWorker The NetWorker(Socket) being used
player NetworkingPlayer The NetworkingPlayer who will execute this RPC
runOnServer bool
Résultat void

AuthoritativeURPC() public méthode

Used for the server to call an URPC method on a NetWorker(Socket) on a particular player
public AuthoritativeURPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkingPlayer player, bool runOnServer ) : void
methodName string Method(Function) name to call
socket BeardedManStudios.Network.NetWorker The NetWorker(Socket) being used
player NetworkingPlayer The NetworkingPlayer who will execute this RPC
runOnServer bool
Résultat void

ChangeOwner() public méthode

public ChangeOwner ( ulong newOwnerPlayerId ) : void
newOwnerPlayerId ulong
Résultat void

Cleanup() public méthode

public Cleanup ( ) : void
Résultat void

Deserialize() public méthode

Deserialize the Networking Stream
public Deserialize ( NetworkingStream stream ) : void
stream NetworkingStream Stream to be deserialized
Résultat void

Disconnect() public méthode

Used to do final cleanup when disconnecting. This gets called currently on application quit and scene resets
public Disconnect ( ) : void
Résultat void

ExecuteRPCStack() public méthode

public ExecuteRPCStack ( ) : void
Résultat void

GenerateUniqueId() public static méthode

Get a generated Unique ID for the next simple networked mono behavior or its derivitive
public static GenerateUniqueId ( ) : ulong
Résultat ulong

GetRPC() public méthode

public GetRPC ( int id ) : MethodInfo
id int
Résultat System.Reflection.MethodInfo

GetSceneNetworkedId() public méthode

public GetSceneNetworkedId ( ) : int
Résultat int

Initialize() public static méthode

An initial setup to make sure that a networking manager exists before running any core logic
public static Initialize ( BeardedManStudios.Network.NetWorker socket ) : void
socket BeardedManStudios.Network.NetWorker
Résultat void

InvokeRPC() public méthode

To Invoke an RPC on a given Networking Stream RPC
public InvokeRPC ( NetworkingStreamRPC stream ) : bool
stream NetworkingStreamRPC Networking Stream RPC to read from
Résultat bool

Locate() public static méthode

Locate a Simple Networked Monobehavior given a ID
public static Locate ( ulong id ) : SimpleNetworkedMonoBehavior
id ulong ID of the Simple Networked Monobehavior
Résultat SimpleNetworkedMonoBehavior

NetworkDestroy() public static méthode

Destroy a Simple Networked Monobehavior or any of its derivitives with the given Network ID
public static NetworkDestroy ( ulong networkId ) : bool
networkId ulong Network ID to be destroyed
Résultat bool

NetworkDisconnect() protected méthode

protected NetworkDisconnect ( ) : void
Résultat void

NetworkStart() protected méthode

A start method that is called after the object has been setup on the network
protected NetworkStart ( ) : void
Résultat void

NonOwnerFixedUpdate() protected méthode

protected NonOwnerFixedUpdate ( ) : void
Résultat void

NonOwnerUpdate() protected méthode

protected NonOwnerUpdate ( ) : void
Résultat void

OfflineStart() public méthode

public OfflineStart ( ) : void
Résultat void

OnApplicationQuit() protected méthode

protected OnApplicationQuit ( ) : void
Résultat void

OnDestroy() protected méthode

protected OnDestroy ( ) : void
Résultat void

OwnerFixedUpdate() protected méthode

protected OwnerFixedUpdate ( ) : void
Résultat void

OwnerUpdate() protected méthode

protected OwnerUpdate ( ) : void
Résultat void

QueueRPCForInstantiate() public static méthode

public static QueueRPCForInstantiate ( ulong id, NetworkingStream stream ) : void
id ulong
stream NetworkingStream
Résultat void

RPC() public méthode

Call an RPC method with arguments
public RPC ( string methodName ) : void
methodName string Method(Function) name to call
Résultat void

RPC() public méthode

Call an RPC method with a NetWorker(Socket) and arguments
public RPC ( string methodName, BeardedManStudios.Network.NetWorker socket ) : void
methodName string Method(Function) name to call
socket BeardedManStudios.Network.NetWorker The NetWorker(Socket) being used
Résultat void

RPC() public méthode

Call an RPC method on a NetWorker(Socket) with receivers and arguments
public RPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers ) : void
methodName string Method(Function) name to call
socket BeardedManStudios.Network.NetWorker The NetWorker(Socket) being used
receivers NetworkReceivers Who shall receive the RPC
Résultat void

RPC() public méthode

Call an RPC method with a receiver and arguments
public RPC ( string methodName, NetworkReceivers rpcMode ) : void
methodName string Method(Function) name to call
rpcMode NetworkReceivers Who shall receive the RPC
Résultat void

Reflect() protected méthode

Get the RPC's of the simple networked monobehavior
protected Reflect ( ) : void
Résultat void

ResetAll() public static méthode

public static ResetAll ( ) : void
Résultat void

ResetBufferClear() public méthode

Resets the buffer to be clear again so that it can start buffering
public ResetBufferClear ( ) : void
Résultat void

ResetForScene() public static méthode

public static ResetForScene ( List skip ) : void
skip List
Résultat void

Serialized() public méthode

Serialize the Simple Networked Monobehavior
public Serialized ( ) : BMSByte
Résultat BMSByte

SetSceneNetworkedId() public méthode

public SetSceneNetworkedId ( int id ) : void
id int
Résultat void

Setup() public méthode

Setup the Simple Networked Monobehavior stack with a NetWorker, owner, network id, and owner id
public Setup ( BeardedManStudios.Network.NetWorker owningSocket, bool isOwner, ulong networkId, ulong ownerId ) : void
owningSocket BeardedManStudios.Network.NetWorker The NetWorker to be setup with
isOwner bool If this object is the owner
networkId ulong The NetworkID for this Simple Networked Monobehavior
ownerId ulong The OwnerID for this Simple Networked Monobehavior
Résultat void

Setup() public méthode

public Setup ( BeardedManStudios.Network.NetWorker owningSocket, bool isOwner, ulong networkId, ulong ownerId, bool isSceneObject = false ) : void
owningSocket BeardedManStudios.Network.NetWorker
isOwner bool
networkId ulong
ownerId ulong
isSceneObject bool
Résultat void

SetupObjects() public static méthode

Setup the Simple Networked Monobehavior stack with a NetWorker
public static SetupObjects ( SimpleNetworkedMonoBehavior behaviors, BeardedManStudios.Network.NetWorker owningSocket ) : void
behaviors SimpleNetworkedMonoBehavior
owningSocket BeardedManStudios.Network.NetWorker The NetWorker to be setup with
Résultat void

URPC() public méthode

Call an Unreliable RPC method on a NetWorker(Socket) with receivers and arguments
public URPC ( string methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers ) : void
methodName string Method(Function) name to call
socket BeardedManStudios.Network.NetWorker The NetWorker(Socket) being used
receivers NetworkReceivers Who shall receive the RPC
Résultat void

URPC() public méthode

Call an Unreliable RPC method with a receiver and arguments
public URPC ( string methodName, NetworkReceivers rpcMode ) : void
methodName string Method(Function) name to call
rpcMode NetworkReceivers Who shall receive the RPC
Résultat void

UnityFixedUpdate() protected méthode

protected UnityFixedUpdate ( ) : void
Résultat void

UnityUpdate() protected méthode

protected UnityUpdate ( ) : void
Résultat void

Property Details

allowOwnershipChange public_oe property

Determines if this object has the ability to change owners
public bool allowOwnershipChange
Résultat bool

destroyOnDisconnect public_oe property

If this is true, then a network destroy will be called on disconnect
public bool destroyOnDisconnect
Résultat bool

dontDestroyOnLoad public_oe property

If this is marked as true then this object will not be cleaned up by the network on level load
public bool dontDestroyOnLoad
Résultat bool

networkedBehaviors public_oe static_oe property

A list of all of the current networked behaviors
public static Dictionary networkedBehaviors
Résultat SimpleNetworkedMonoBehavior>.Dictionary

networkedBehaviorsMutex public_oe static_oe property

Used for when creating new networked behaviors
public static object networkedBehaviorsMutex
Résultat object

rpcStack protected_oe property

A list of RPC (remote methods) that are pending to be called for this object
protected List rpcStack
Résultat List