LethalNetworkAPI.LethalClientMessage<TData> Class
OBSOLETE
This class is deprecated. Please use LNetworkMessage<TData> instead.
public sealed class LethalClientMessage<TData> : LethalNetworkAPI.LNetworkMessageDeprecated
Type Parameters
Type | Description |
---|---|
TData | The serializable data type of the message. |
Inheritance
↳ System.Object
↳ LethalNetworkAPI.Old.LethalNetworkDeprecated
↳ LethalNetworkAPI.LNetworkMessageDeprecated
↳ LethalNetworkAPI.LethalClientMessage<TData>
Constructors
LethalClientMessage(string, Action<TData>, Action<TData,ulong>) DEPRECATED
Create a new network message for clients.
Declaration
public LethalClientMessage(string identifier, Action<TData>? onReceived = null, Action<TData, ulong>? onReceivedFromClient = null)
Parameters
Type | Name | Description |
---|---|---|
string | identifier | An identifier for the message. |
Action<TData>? | onReceived | [Opt.] The method to run when a message is received from the server. |
Action<TData, ulong>? | onReceivedFromClient | [Opt.] The method to run when a message is received from another client. |
Remarks
Identifiers are specific to a per-mod basis.
Methods
ClearSubscriptions() DEPRECATED
Declaration
public void ClearSubscriptions()
SendAllClients(TData, bool, bool) DEPRECATED
Send data to the server/host.
Declaration
public void SendAllClients(TData data, bool includeLocalClient = true, bool waitForServerResponse = false)
Parameters
Type | Name | Description |
---|---|---|
TData | data | The data to send. |
bool | includeLocalClient | [Opt.] If the local client event should be invoked. |
bool | waitForServerResponse | [Opt.] If the local client should wait for a server response before invoking the OnReceivedFromClient event. |
Remarks
'waitForServerResponse' will only be considered if 'includeLocalClient' is set to true.
SendServer(TData) DEPRECATED
Invoke event to the server/host.
Declaration
public void SendServer(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data | The data to send. |
Events
OnReceived DEPRECATED
The callback to invoke when a message is received from the server.
Declaration
public event Action<TData>? OnReceived;
Type Parameters
Type | Description |
---|---|
TData | The received data. |
OnReceivedFromClient DEPRECATED
The callback to invoke when a message is received from another client.
Declaration
public event Action<TData, ulong>? OnReceivedFromClient;
Type Parameters
Type | Description |
---|---|
TData | The received data. |
ulong | The origin client ID. |