LethalNetworkAPI.Utils.LNetworkUtils Class
public static class LNetworkUtils
Inheritance
↳ System.Object
↳ LNetworkUtils
Properties
AllConnectedClients
All connected clients' GUIDs. This will be empty if not connected to a server.
Declaration
public static ulong[] AllConnectedClients;
Returns
Type | Description |
---|---|
ulong[] | An array of all connect clients' NGO guids. |
IsConnected
Whether the client is connected to a server.
Declaration
public static bool IsConnected;
Returns
Type | Description |
---|---|
bool | True if the client is currently connected to a server (or hosting it) - otherwise False. |
IsHostOrServer
Whether the client is the host or server.
Declaration
public static bool IsHostOrServer;
Returns
Type | Description |
---|---|
bool | True if the client is hosting a lobby - otherwise False. |
OtherConnectedClients
All connected clients' GUIDs, except this client.
Declaration
public static ulong[] OtherConnectedClients;
Returns
Type | Description |
---|---|
ulong[] | An array of all connect clients' NGO guids - except the current client guid. |
Methods
AllConnectedClientsExcept(ulong)
All connected clients' GUIDs, except the specified client.
Declaration
public static ulong[] AllConnectedClientsExcept(ulong clientId)
Parameters
Type | Name | Description |
---|---|---|
ulong | clientId | The client to exclude. |
Returns
Type | Description |
---|---|
ulong[] | An array of all connect clients' NGO guids - except the given guid. |
Remarks
This will be empty if not connected to a server.
AllConnectedClientsExcept(ulong[])
All connected clients' GUIDs, except the specified client.
Declaration
public static ulong[] AllConnectedClientsExcept(params ulong[] clientIds)
Parameters
Type | Name | Description |
---|---|---|
ulong[] | clientIds | The clients to exclude. |
Returns
Type | Description |
---|---|
ulong[] | An array of all connect clients' NGO guids - except the given guids. |
Remarks
This will be empty if not connected to a server.
GetClientGuid(int)
Get the client's GUID from the player ID.
Declaration
public static ulong GetClientGuid(int playerId)
Parameters
Type | Name | Description |
---|---|---|
int | playerId | The in-game player ID. |
Returns
Type | Description |
---|---|
ulong | The client's NGO GUID. |
GetPlayerId(ulong)
Get the client's player ID from the client's GUID.
Declaration
public static int GetPlayerId(ulong clientGuid)
Parameters
Type | Name | Description |
---|---|---|
ulong | playerId | The client's NGO GUID. |
Returns
Type | Description |
---|---|
int | The client's in-game player ID. |
Events
OnNetworkStart
Called when the local client establishes a connection to, or starts up, a server.
Declaration
public static event Action<bool> OnNetworkStart;
Type Parameters
Type | Description |
---|---|
bool | Whether the local client is the server or not. |