LethalNetworkAPI.LethalServerMessage<TData> Class
OBSOLETE
This class is deprecated. Please use LNetworkMessage<TData> instead.
csharp
public sealed class LethalServerMessage<TData> : LethalNetworkAPI.LNetworkMessageDeprecated
Type Parameters
Type | Description |
---|---|
TData | The serializable data type of the message. |
Inheritance
↳ System.Object
↳ LethalNetworkAPI.Old.LethalNetworkDeprecated
↳ LethalNetworkAPI.LNetworkMessageDeprecated
↳ LethalNetworkAPI.LethalServerMessage<TData>
Constructors
LethalServerMessage(string, Action<TData,ulong>) DEPRECATED
Create a new network message for the server.
Declaration
csharp
public LethalServerMessage(string identifier, Action<TData, ulong>? onReceived = null)
Parameters
Type | Name | Description |
---|---|---|
string | identifier | An identifier for the message. |
Action<TData, ulong>? | onReceived | [Opt.] The method to run when a message is received from a client. |
Remarks
Identifiers are specific to a per-mod basis.
Methods
ClearSubscriptions() DEPRECATED
Declaration
csharp
public void ClearSubscriptions()
SendAllClients(TData, bool) DEPRECATED
Send data to all clients.
Declaration
csharp
public void SendAllClients(TData data, bool receiveOnHost = true)
Parameters
Type | Name | Description |
---|---|---|
TData | data | The data to send. |
bool | receiveOnHost | [Opt.] Whether the host client should receive as well. |
SendClient(TData, ulong) DEPRECATED
Send data to a specified client.
Declaration
csharp
public void SendClient(TData data, ulong clientId)
Parameters
Type | Name | Description |
---|---|---|
TData | data | The data to send. |
ulong | clientId | The client to send the data to. |
SendClients(TData, IEnumerable<ulong>) DEPRECATED
Send data to the specified clients.
Declaration
csharp
public void SendClients(TData data, IEnumerable<ulong> clientIds)
Parameters
Type | Name | Description |
---|---|---|
TData | data | The data to send. |
IEnumerable<ulong> | clientIds | The clients to send the data to. |
Events
OnReceived DEPRECATED
The callback to invoke when a message is received.
Declaration
csharp
public event Action<TData, ulong>? OnReceived;
Type Parameters
Type | Description |
---|---|
TData | The received data. |
ulong | The origin client ID. |