Class NetworkApi
Inheritance
System.Object
NetworkApi
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: LLBModdingLib.dll
Syntax
public static class NetworkApi
Fields
netIDSize
Declaration
public const int netIDSize = 4
Field Value
| Type |
Description |
| System.Int32 |
|
Properties
IsOnline
Gets a value indicating whether the current states are online.
Declaration
public static bool IsOnline { get; }
Property Value
| Type |
Description |
| System.Boolean |
true if is online; otherwise, false.
|
LocalPlayerNumber
Gets the current player number for the local player.
Declaration
[Obsolete("Deprecated, please use Player.LocalPlayerNumber instead.")]
public static int LocalPlayerNumber { get; }
Property Value
| Type |
Description |
| System.Int32 |
The current platform as a PlatformBase object.
|
OnlineMode
Gets the current online mode.
Declaration
public static OnlineMode OnlineMode { get; }
Property Value
| Type |
Description |
| OnlineMode |
The OnlineMode enum value for the current mode.
|
Methods
Gets the current platform.
Declaration
public static KIIIINKJKNI GetCurrentPlatform()
Returns
| Type |
Description |
| KIIIINKJKNI |
The current platform as a PlatformBase object.
|
GetNetworkIdentifier(String)
Declaration
public static byte[] GetNetworkIdentifier(string source)
Parameters
| Type |
Name |
Description |
| System.String |
source |
|
Returns
| Type |
Description |
| System.Byte[] |
|
GetOperatingSystem()
Gets the operating system the game is currently running on.
Declaration
public static OperatingSystem GetOperatingSystem()
Returns
| Type |
Description |
| OperatingSystem |
The operating system.
|
PeerIDToCSteamID(String)
Declaration
public static CSteamID PeerIDToCSteamID(string peerId)
Parameters
| Type |
Name |
Description |
| System.String |
peerId |
|
Returns
| Type |
Description |
| Steamworks.CSteamID |
|
PlayerNrToPeerID(Int32)
Declaration
public static string PlayerNrToPeerID(int playerNr)
Parameters
| Type |
Name |
Description |
| System.Int32 |
playerNr |
|
Returns
| Type |
Description |
| System.String |
|
RegisterModPacketCallback(PluginInfo, Action<Peer, Byte[]>)
Declaration
public static void RegisterModPacketCallback(PluginInfo pluginInfo, Action<Peer, byte[]> onReceivePacket)
Parameters
| Type |
Name |
Description |
| BepInEx.PluginInfo |
pluginInfo |
The BepInEx.PluginInfo of the requesting plugin
|
| System.Action<Multiplayer.Peer, System.Byte[]> |
onReceivePacket |
The method to call when receiving the packet
|
SendBytes(String, Byte[], Boolean)
Declaration
public static void SendBytes(string receiver, byte[] data, bool toVanilla = true)
Parameters
| Type |
Name |
Description |
| System.String |
receiver |
|
| System.Byte[] |
data |
|
| System.Boolean |
toVanilla |
|
SendEnvelope(Envelope)
Declaration
public static void SendEnvelope(Envelope envelope)
Parameters
| Type |
Name |
Description |
| Multiplayer.Envelope |
envelope |
|
SendMessageToPeer(String, Message)
Declaration
public static void SendMessageToPeer(string peerId, Message message)
Parameters
| Type |
Name |
Description |
| System.String |
peerId |
|
| Message |
message |
|
SendMessageToPlayer(Int32, Message)
Declaration
public static void SendMessageToPlayer(int playerNr, Message message)
Parameters
| Type |
Name |
Description |
| System.Int32 |
playerNr |
|
| Message |
message |
|
SendModPacket(PluginInfo, Player, Byte[])
Declaration
public static void SendModPacket(PluginInfo pluginInfo, Player player, byte[] data)
Parameters
| Type |
Name |
Description |
| BepInEx.PluginInfo |
pluginInfo |
The BepInEx.PluginInfo of the sending plugin
|
| Player |
player |
The player to send the packet to
|
| System.Byte[] |
data |
The data to send
|
SendP2PPacket(Player, Byte[], EP2PSend.Enum, Int32, Boolean)
Declaration
public static void SendP2PPacket(Player player, byte[] data, EP2PSend.Enum eP2PSendType = EP2PSend.Enum.k_EP2PSendUnreliable, int nChannel = 0, bool transactionSupport = true)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
| System.Byte[] |
data |
|
| EP2PSend.Enum |
eP2PSendType |
|
| System.Int32 |
nChannel |
|
| System.Boolean |
transactionSupport |
|
SendP2PPacket(CSteamID, Byte[], EP2PSend.Enum, Int32, Boolean)
Declaration
public static void SendP2PPacket(CSteamID steamIDRemote, byte[] data, EP2PSend.Enum eP2PSendType = EP2PSend.Enum.k_EP2PSendUnreliable, int nChannel = 0, bool transactionSupport = true)
Parameters
| Type |
Name |
Description |
| Steamworks.CSteamID |
steamIDRemote |
|
| System.Byte[] |
data |
|
| EP2PSend.Enum |
eP2PSendType |
|
| System.Int32 |
nChannel |
|
| System.Boolean |
transactionSupport |
|