C# Class LitDev.LDClient

Afficher le fichier Open project: litdev1/LitDev

Méthodes publiques

Méthode Description
CheckServer ( Primitive server ) : Primitive

Test if a server is available for connection. Do not call this method at a high frequency (> 1 per second).

Connect ( Primitive server, Primitive auto ) : Primitive

Connect to a server.

Disconnect ( ) : Primitive

Disconnect the client from the server.

GetClients ( ) : Primitive

Get a list of current connected clients.

SendMessage ( Primitive message ) : Primitive

Send a message to the server.

UpdateDynamic ( Primitive data ) : Primitive

Update client data when using the auto message passing. This is for small quantities of frequently changing data, like sprite coordinates. this method uses the last updated client data stored on the client and is therefore fast.

UpdateStatic ( Primitive data ) : Primitive

Update client data when using the auto message passing. This is for larger quantities of infrequently changing data, like client configuration. This method uses data stored and retrieved from the server so may be slower than UpdateDynamic since it waits for server retreived data, guaranteeing that all client data is fully synced.

Private Methods

Méthode Description
Listen ( ) : void
Send ( string message ) : string
ServerMessageDelegate ( string message ) : void

Method Details

CheckServer() public static méthode

Test if a server is available for connection. Do not call this method at a high frequency (> 1 per second).
public static CheckServer ( Primitive server ) : Primitive
server Primitive The server connection ip:port (e.g. "192.168.1.60:100"). /// This value is returned by LDServer.Start.
Résultat Primitive

Connect() public static méthode

Connect to a server.
public static Connect ( Primitive server, Primitive auto ) : Primitive
server Primitive The server connection ip:port (e.g. "192.168.1.60:100"). /// This value is returned by LDServer.Start.
auto Primitive Enable auto message passing "True" or "False". /// If this is used (recommended) then all client data is passed via server to all other clients, /// and no processing of send and receive events is required. /// The data is updated to arrays of data (indexed by client name) that is returned from the Update methods. /// The auto option should be the same for server and all clients.
Résultat Primitive

Disconnect() public static méthode

Disconnect the client from the server.
public static Disconnect ( ) : Primitive
Résultat Primitive

GetClients() public static méthode

Get a list of current connected clients.
public static GetClients ( ) : Primitive
Résultat Primitive

SendMessage() public static méthode

Send a message to the server.
public static SendMessage ( Primitive message ) : Primitive
message Primitive The message may be any variable including an array.
Résultat Primitive

UpdateDynamic() public static méthode

Update client data when using the auto message passing. This is for small quantities of frequently changing data, like sprite coordinates. this method uses the last updated client data stored on the client and is therefore fast.
public static UpdateDynamic ( Primitive data ) : Primitive
data Primitive The data for this client to propagate to other clients.
Résultat Primitive

UpdateStatic() public static méthode

Update client data when using the auto message passing. This is for larger quantities of infrequently changing data, like client configuration. This method uses data stored and retrieved from the server so may be slower than UpdateDynamic since it waits for server retreived data, guaranteeing that all client data is fully synced.
public static UpdateStatic ( Primitive data ) : Primitive
data Primitive The data for this client to propagate to other clients.
Résultat Primitive