Method | 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.
|
Method | Description | |
---|---|---|
Listen ( ) : void | ||
Send ( string message ) : string | ||
ServerMessageDelegate ( string message ) : void |
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. |
return | Primitive |
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. |
return | Primitive |
public static SendMessage ( Primitive message ) : Primitive | ||
message | Primitive | The message may be any variable including an array. |
return | Primitive |
public static UpdateDynamic ( Primitive data ) : Primitive | ||
data | Primitive | The data for this client to propagate to other clients. |
return | Primitive |
public static UpdateStatic ( Primitive data ) : Primitive | ||
data | Primitive | The data for this client to propagate to other clients. |
return | Primitive |