C# Class Luz.ULib.Net.UnityNetwork

This is a helper class for testing only. It implements the same IBasicNetwork interface as WebRTCNetwork but works on all Unity platforms. You can use this class to test your network in Unity without having to build a browser version. This class will be replaced by a C++ WebRTC library in the future, until then you won't be able to connect to browsers from the editor! This class isn't very well designed and uses the old deprecated unity network.
Inheritance: UnityEngine.MonoBehaviour, IBasicNetwork
Afficher le fichier Open project: devluz/webrtcnetwork Class Usage Examples

Méthodes publiques

Свойство Type Description
UserIdAll int
UserIdError int
sName String
uActualAverageSendRate float
uTargetSendRate float
uUnityConfigSendRate float

Private Properties

Свойство Type Description
AddClientSide void
AddServerSide void
Awake void
DeliverMessage void
InitializeConnection void
NetworkPlayerToConnectionId ConnectionId
NextConnectionId ConnectionId
OnConnectedToServer void
OnDestroy void
OnDisconnectedFromServer void
OnFailedToConnect void
OnPlayerConnected void
OnPlayerDisconnected void
OnServerInitialized void

Méthodes publiques

Méthode Description
Connect ( string address ) : ConnectionId
ConnectToGuid ( string guid ) : void
Dequeue ( NetworkEvent &evt ) : bool
Disconnect ( ConnectionId id ) : void
Flush ( ) : void
Get ( ) : UnityNetwork
IsAvailable ( ) : bool
SendData ( ConnectionId userId, byte data, int offset, int length, bool reliable ) : void
Shutdown ( ) : void
SingleEndpoint_OnSerialize ( BitStream stream, NetworkPlayer senderOrReceiver ) : void
StartServer ( ) : void
StartServer ( int port ) : void
TakeSession ( ) : void

Used to initialize the UnityNetwork class after the server was started or the client connected.

Update ( ) : void

Private Methods

Méthode Description
AddClientSide ( NetworkViewID recieverId, NetworkMessageInfo info ) : void
AddServerSide ( NetworkViewID id, NetworkMessageInfo info ) : void
Awake ( ) : void
DeliverMessage ( byte data, NetworkMessageInfo info ) : void
InitializeConnection ( NetworkPlayer player ) : void
NetworkPlayerToConnectionId ( NetworkPlayer pl ) : ConnectionId
NextConnectionId ( ) : ConnectionId
OnConnectedToServer ( ) : void
OnDestroy ( ) : void
OnDisconnectedFromServer ( NetworkDisconnection info ) : void
OnFailedToConnect ( NetworkConnectionError error ) : void
OnPlayerConnected ( NetworkPlayer player ) : void
OnPlayerDisconnected ( NetworkPlayer player ) : void
OnServerInitialized ( ) : void

Method Details

Connect() public méthode

public Connect ( string address ) : ConnectionId
address string
Résultat ConnectionId

ConnectToGuid() public méthode

public ConnectToGuid ( string guid ) : void
guid string
Résultat void

Dequeue() public méthode

public Dequeue ( NetworkEvent &evt ) : bool
evt NetworkEvent
Résultat bool

Disconnect() public méthode

public Disconnect ( ConnectionId id ) : void
id ConnectionId
Résultat void

Flush() public méthode

public Flush ( ) : void
Résultat void

Get() public static méthode

public static Get ( ) : UnityNetwork
Résultat UnityNetwork

IsAvailable() public static méthode

public static IsAvailable ( ) : bool
Résultat bool

SendData() public méthode

public SendData ( ConnectionId userId, byte data, int offset, int length, bool reliable ) : void
userId ConnectionId
data byte
offset int
length int
reliable bool
Résultat void

Shutdown() public méthode

public Shutdown ( ) : void
Résultat void

SingleEndpoint_OnSerialize() public méthode

public SingleEndpoint_OnSerialize ( BitStream stream, NetworkPlayer senderOrReceiver ) : void
stream UnityEngine.BitStream
senderOrReceiver UnityEngine.NetworkPlayer
Résultat void

StartServer() public méthode

public StartServer ( ) : void
Résultat void

StartServer() public méthode

public StartServer ( int port ) : void
port int
Résultat void

TakeSession() public méthode

Used to initialize the UnityNetwork class after the server was started or the client connected.
public TakeSession ( ) : void
Résultat void

Update() public méthode

public Update ( ) : void
Résultat void

Property Details

UserIdAll public_oe static_oe property

public static int UserIdAll
Résultat int

UserIdError public_oe static_oe property

public static int UserIdError
Résultat int

sName public_oe static_oe property

public static String sName
Résultat String

uActualAverageSendRate public_oe property

public float uActualAverageSendRate
Résultat float

uTargetSendRate public_oe property

public float uTargetSendRate
Résultat float

uUnityConfigSendRate public_oe property

public float uUnityConfigSendRate
Résultat float