Table of Contents

Interface INetwork.IManagedInterface

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

Represents the managed interface implemented by its unmanaged counterpart.

public interface INetwork.IManagedInterface : IUnmanagedInterface
Inherited Members

Methods

Ban(BanEntry, TimeSpan)

Bans a peer from the network.

void Ban(BanEntry entry, TimeSpan expire)

Parameters

entry BanEntry

The ban entry containing details about the ban.

expire TimeSpan

The duration of the ban before it expires.

BroadcastPacket(SpanLite<byte>, int, IPlayer, bool)

Broadcasts a packet to all peers on this network.

bool BroadcastPacket(SpanLite<byte> data, int channel, IPlayer exceptPeer = default, bool dispatchEvents = true)

Parameters

data SpanLite<byte>

The data span with the length in bits.

channel int

The channel to use for broadcasting the packet.

exceptPeer IPlayer

The peer to exclude from the broadcast.

dispatchEvents bool

Whether to dispatch packet-related events.

Returns

bool

true if the packet was broadcast successfully; otherwise, false.

BroadcastRPC(int, SpanLite<byte>, int, IPlayer, bool)

Broadcasts an RPC to all peers on this network.

bool BroadcastRPC(int id, SpanLite<byte> data, int channel, IPlayer exceptPeer = default, bool dispatchEvents = true)

Parameters

id int

The RPC ID for the current network.

data SpanLite<byte>

The data span with the length in bits.

channel int

The channel to use for broadcasting the RPC.

exceptPeer IPlayer

The peer to exclude from the broadcast.

dispatchEvents bool

Whether to dispatch RPC-related events.

Returns

bool

true if the RPC was broadcast successfully; otherwise, false.

Disconnect(IPlayer)

Disconnects a peer from the network.

void Disconnect(IPlayer peer)

Parameters

peer IPlayer

The network peer to disconnect.

GetEventDispatcher()

Gets the dispatcher which dispatches network events.

IEventDispatcher<INetworkEventHandler> GetEventDispatcher()

Returns

IEventDispatcher<INetworkEventHandler>

An event dispatcher for network events.

GetInEventDispatcher()

Gets the dispatcher which dispatches incoming network events.

IEventDispatcher<INetworkInEventHandler> GetInEventDispatcher()

Returns

IEventDispatcher<INetworkInEventHandler>

An event dispatcher for incoming network events.

GetNetworkType()

Gets the network type of the network.

ENetworkType GetNetworkType()

Returns

ENetworkType

The network type of the network.

GetOutEventDispatcher()

Gets the dispatcher which dispatches outgoing network events.

IEventDispatcher<INetworkOutEventHandler> GetOutEventDispatcher()

Returns

IEventDispatcher<INetworkOutEventHandler>

An event dispatcher for outgoing network events.

GetPerPacketInEventDispatcher()

Gets the dispatcher which dispatches incoming network events bound to a specific packet ID.

IIndexedEventDispatcher<ISingleNetworkInEventHandler> GetPerPacketInEventDispatcher()

Returns

IIndexedEventDispatcher<ISingleNetworkInEventHandler>

An indexed event dispatcher for incoming packet events.

GetPerPacketOutEventDispatcher()

Gets the dispatcher which dispatches outgoing network events bound to a specific packet ID.

IIndexedEventDispatcher<ISingleNetworkOutEventHandler> GetPerPacketOutEventDispatcher()

Returns

IIndexedEventDispatcher<ISingleNetworkOutEventHandler>

An indexed event dispatcher for outgoing packet events.

GetPerRPCInEventDispatcher()

Gets the dispatcher which dispatches incoming network events bound to a specific RPC ID.

IIndexedEventDispatcher<ISingleNetworkInEventHandler> GetPerRPCInEventDispatcher()

Returns

IIndexedEventDispatcher<ISingleNetworkInEventHandler>

An indexed event dispatcher for incoming RPC events.

GetPerRPCOutEventDispatcher()

Gets the dispatcher which dispatches outgoing network events bound to a specific RPC ID.

IIndexedEventDispatcher<ISingleNetworkOutEventHandler> GetPerRPCOutEventDispatcher()

Returns

IIndexedEventDispatcher<ISingleNetworkOutEventHandler>

An indexed event dispatcher for outgoing RPC events.

GetPing(IPlayer)

Gets the last ping for a peer on this network.

uint GetPing(IPlayer peer)

Parameters

peer IPlayer

The network peer to get the ping for.

Returns

uint

The last ping value, or 0 if the peer is not on this network.

GetStatistics(IPlayer)

Gets network statistics for a specific player or the entire network.

NetworkStats GetStatistics(IPlayer player = default)

Parameters

player IPlayer

The player to get statistics for, or default for the entire network.

Returns

NetworkStats

The network statistics.

SendPacket(IPlayer, SpanLite<byte>, int, bool)

Sends a packet to a network peer.

bool SendPacket(IPlayer peer, SpanLite<byte> data, int channel, bool dispatchEvents = true)

Parameters

peer IPlayer

The network peer to send the packet to.

data SpanLite<byte>

The data span with the length in bits.

channel int

The channel to use for sending the packet.

dispatchEvents bool

Whether to dispatch packet-related events.

Returns

bool

true if the packet was sent successfully; otherwise, false.

SendRPC(IPlayer, int, SpanLite<byte>, int, bool)

Sends an RPC to a network peer.

bool SendRPC(IPlayer peer, int id, SpanLite<byte> data, int channel, bool dispatchEvents = true)

Parameters

peer IPlayer

The network peer to send the RPC to.

id int

The RPC ID for the current network.

data SpanLite<byte>

The data span with the length in bits.

channel int

The channel to use for sending the RPC.

dispatchEvents bool

Whether to dispatch RPC-related events.

Returns

bool

true if the RPC was sent successfully; otherwise, false.

Unban(BanEntry)

Unbans a peer from the network.

void Unban(BanEntry entry)

Parameters

entry BanEntry

The ban entry to remove.

Update()

Updates server parameters.

void Update()