• Articles
  • Api Documentation
Show / Hide Table of Contents
  • DDSLoader
    • DDSImage
    • DDSImage.DDSHeader
    • DDSImage.DDSPixelFormat
    • DDSImage.HeaderFlags
    • DDSImage.PixelFormatFlags
    • DDSUnityExtensions
    • FourCC
  • LLBML
    • BallApi
    • CharacterApi
    • GraphicUtils
    • InputApi
    • LLBMLPlugin
    • LoadingInfo
    • LoadingScreen
    • PluginInfos
    • ProgressApi
    • ScreenApi
    • StateApi
  • LLBML.Audio
    • AudioAsset
    • AudioCache
    • AudioInfo
    • AudioUtils
  • LLBML.External
    • IntHelpers
    • Murmur3
  • LLBML.GameEvents
    • GameEvents
    • GameStateEvents
    • LobbyEventArgs
    • LobbyEvents
    • LobbyReadyArgs
    • MenuEvents
    • OnLobbyEnteredHandler
    • OnLobbyReadyHandler
    • OnMainMenuEnteredArgs
    • OnMainMenuEnteredHandler
    • OnMainMenuFirstEnteredHandler
    • OnPlayerJoinArgs
    • OnPlayerJoinHandler
    • OnStateChangeArgs
    • OnStateChangeHandler
    • OnUnlinkFromPlayerArgs
    • OnUnlinkFromPlayerHandler
    • OnUserCharacterPickArgs
    • OnUserCharacterPickHandler
    • OnUserSkinClickArgs
    • OnUserSkinClickHandler
  • LLBML.Graphic
    • Draw
    • Draw.Alignment
  • LLBML.Math
    • BinaryUtils
    • Boundsf
    • Floatf
    • Vector2f
    • Vector2i
  • LLBML.Messages
    • CustomMessage
    • MessageActions
    • MessageApi
    • MessageApi.OnReceiveMessageHandler
    • MessageEventArgs
  • LLBML.Networking
    • Channel
    • EnvelopeApi
    • EnvelopeApi.OnReceiveEnvelopeHandler
    • EnvelopeEventArgs
    • EP2PSend
    • EP2PSend.Enum
    • EP2PSend.Enum_Mapping
    • NetworkApi
    • Transaction
    • TransactionCode
    • TransactionState
  • LLBML.Players
    • Player
    • PlayerStatus
    • PlayerStatus.Enum
    • PlayerStatus.Enum_Mappings
    • Team
    • Team.Enum
    • Team.Enum_Mappings
  • LLBML.Settings
    • GameSettings
  • LLBML.States
    • GameState
    • GameState.Enum
    • GameState.Enum_Mapping
    • GameStates
    • GameStatesGameUtils
    • GameStatesLobbyUtils
    • PlayerLobbyState
  • LLBML.Texture
    • TextureUtils
  • LLBML.UI
    • Dialogs
  • LLBML.Utils
    • ArrayExtension
    • BepInRef
    • ControlledRandom
    • DebugUtils
    • EnumWrapper<T>
    • GenericCache<K, T>
    • GenericUtils
    • Hash<T>
    • IByteable
    • ModDependenciesUtils
    • ModdingFolder
    • PatchUtils
    • StringUtils

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()
Namespace: LLBML.Networking
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.

Remarks

Curently not failsafe, game has it as -1 in some occasions, and localPeer is initialized before the Player is

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

GetCurrentPlatform()

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[]>)

Register a method to receive binary data sent by SendModPacket(PluginInfo, Player, 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[])

Sends binary data in a special p2p channel. Receive data with RegisterModPacketCallback(PluginInfo, Action<Peer, 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

Remarks

Maximum size is 1MB.

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
In This Article
Back to top Generated by DocFX