LethalNetworkAPI.LethalClientEvent Class
OBSOLETE
This class is deprecated. Please use LNetworkEvent instead.
public sealed class LethalClientEvent : LethalNetworkAPI.LNetworkEventDepricated
Inheritance
↳ System.Object
↳ LethalNetworkAPI.Old.LethalNetworkDeprecated
↳ LethalNetworkAPI.LNetworkEventDepricated
↳ LethalNetworkAPI.LethalClientEvent
Constructors
LethalClientEvent(string, Action, Action<ulong>) DEPRECATED
Create a new network event for clients.
Declaration
public LethalClientEvent(string identifier, Action? onReceived = null, Action<ulong>? onReceivedFromClient = null)
Parameters
Type | Name | Description |
---|---|---|
string | identifier | An identifier for the event. |
Action? | onReceived | [Opt.] The method to run when an event is received from the server. |
Action<ulong>? | onReceivedFromClient | [Opt.] The method to run when an event is received from another client. |
Remarks
Identifiers are specific to a per-mod basis.
Methods
ClearSubscriptions() DEPRECATED
Declaration
public void ClearSubscriptions()
InvokeAllClients(bool, bool) DEPRECATED
Invoke event to all clients.
Declaration
public void InvokeAllClients(bool includeLocalClient = true, bool waitForServerResponse = false)
Parameters
Type | Name | Description |
---|---|---|
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.
InvokeAllClientsSynced() DEPRECATED
Invoke synchronized event to all clients.
Declaration
public void InvokeAllClientsSynced()
InvokeServer() DEPRECATED
Invoke event to the server/host.
Declaration
public void InvokeServer()
Events
OnReceived DEPRECATED
The callback to invoke when an event is received from the server.
Declaration
public event Action? OnReceived;
OnReceivedFromClient DEPRECATED
The callback to invoke when an event is received from another client.
Declaration
public event Action<ulong>? OnReceivedFromClient;
Type Parameters
Type | Description |
---|---|
ulong | The origin client ID. |