C# Класс LitDev.LDClient

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
Listen ( ) : void
Send ( string message ) : string
ServerMessageDelegate ( string message ) : void

Описание методов

CheckServer() публичный статический Метод

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.
Результат Primitive

Connect() публичный статический Метод

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.
Результат Primitive

Disconnect() публичный статический Метод

Disconnect the client from the server.
public static Disconnect ( ) : Primitive
Результат Primitive

GetClients() публичный статический Метод

Get a list of current connected clients.
public static GetClients ( ) : Primitive
Результат Primitive

SendMessage() публичный статический Метод

Send a message to the server.
public static SendMessage ( Primitive message ) : Primitive
message Primitive The message may be any variable including an array.
Результат Primitive

UpdateDynamic() публичный статический Метод

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.
Результат Primitive

UpdateStatic() публичный статический Метод

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.
Результат Primitive