Table of Contents

Interface IPlayerPool.IManagedInterface

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

Represents the managed interface implemented by its unmanaged counterpart.

public interface IPlayerPool.IManagedInterface : IUnmanagedInterface
Inherited Members

Methods

AllowNickNameCharacter(char, bool)

Allows or disallows the use of a specific character in player names.

void AllowNickNameCharacter(char character, bool allow)

Parameters

character char

The character to allow or disallow.

allow bool

Whether to allow the character.

AsPool()

Converts this instance to a read-only player pool.

IReadOnlyPool<IPlayer> AsPool()

Returns

IReadOnlyPool<IPlayer>

A read-only player pool.

Bots()

Gets a set of all available bots only.

FlatPtrHashSet<IPlayer> Bots()

Returns

FlatPtrHashSet<IPlayer>

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

Broadcasts a packet to all players.

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

Parameters

data SpanLite<byte>

The data span with the length in bits.

channel int

The channel to use.

skipFrom IPlayer

The player to exclude from the broadcast.

dispatchEvents bool

Whether to dispatch packet-related events.

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

Broadcasts an RPC to all players.

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

Parameters

id int

The RPC ID.

data SpanLite<byte>

The data span with the length in bits.

channel int

The channel to use.

skipFrom IPlayer

The player to exclude from the broadcast.

dispatchEvents bool

Whether to dispatch RPC-related events.

CreateExplosionForAll(Vector3, int, float)

Creates an explosion for all players.

void CreateExplosionForAll(Vector3 vec, int type, float radius)

Parameters

vec Vector3

The position of the explosion.

type int

The type of explosion.

radius float

The radius of the explosion.

Entries()

Gets a set of all available players and bots (anything in the pool).

FlatPtrHashSet<IPlayer> Entries()

Returns

FlatPtrHashSet<IPlayer>

GetDefaultColour(int)

Gets the default colour assigned to a player ID when they first connect.

Colour GetDefaultColour(int pid)

Parameters

pid int

The player ID.

Returns

Colour

The default colour.

GetPlayerChangeDispatcher()

Gets a dispatcher for player data change events.

IEventDispatcher<IPlayerChangeEventHandler> GetPlayerChangeDispatcher()

Returns

IEventDispatcher<IPlayerChangeEventHandler>

GetPlayerCheckDispatcher()

Gets a dispatcher for player client check response events.

IEventDispatcher<IPlayerCheckEventHandler> GetPlayerCheckDispatcher()

Returns

IEventDispatcher<IPlayerCheckEventHandler>

GetPlayerClickDispatcher()

Gets a dispatcher for player clicking events.

IEventDispatcher<IPlayerClickEventHandler> GetPlayerClickDispatcher()

Returns

IEventDispatcher<IPlayerClickEventHandler>

GetPlayerConnectDispatcher()

Gets a dispatcher for player connection events.

IEventDispatcher<IPlayerConnectEventHandler> GetPlayerConnectDispatcher()

Returns

IEventDispatcher<IPlayerConnectEventHandler>

GetPlayerDamageDispatcher()

Gets a dispatcher for player damage and death events.

IEventDispatcher<IPlayerDamageEventHandler> GetPlayerDamageDispatcher()

Returns

IEventDispatcher<IPlayerDamageEventHandler>

GetPlayerShotDispatcher()

Gets a dispatcher for player shooting events.

IEventDispatcher<IPlayerShotEventHandler> GetPlayerShotDispatcher()

Returns

IEventDispatcher<IPlayerShotEventHandler>

GetPlayerSpawnDispatcher()

Gets a dispatcher for player spawn events.

IEventDispatcher<IPlayerSpawnEventHandler> GetPlayerSpawnDispatcher()

Returns

IEventDispatcher<IPlayerSpawnEventHandler>

GetPlayerStreamDispatcher()

Gets a dispatcher for player streaming events.

IEventDispatcher<IPlayerStreamEventHandler> GetPlayerStreamDispatcher()

Returns

IEventDispatcher<IPlayerStreamEventHandler>

GetPlayerTextDispatcher()

Gets a dispatcher for player text and command events.

IEventDispatcher<IPlayerTextEventHandler> GetPlayerTextDispatcher()

Returns

IEventDispatcher<IPlayerTextEventHandler>

GetPlayerUpdateDispatcher()

Gets a dispatcher for player update events.

IEventDispatcher<IPlayerUpdateEventHandler> GetPlayerUpdateDispatcher()

Returns

IEventDispatcher<IPlayerUpdateEventHandler>

GetPoolEventDispatcher()

Gets a dispatcher for player pool events.

IEventDispatcher<IPoolEventHandler<IPlayer>> GetPoolEventDispatcher()

Returns

IEventDispatcher<IPoolEventHandler<IPlayer>>

HideGameTextForAll(int)

Hides a game text message for all players.

void HideGameTextForAll(int style)

Parameters

style int

The style of the message to hide.

IsNameTaken(string, IPlayer)

Checks if a name is taken by any player, excluding a specific player.

bool IsNameTaken(string name, IPlayer skip)

Parameters

name string

The name to check.

skip IPlayer

The player to exclude from the check.

Returns

bool

true if the name is taken; otherwise, false.

IsNameValid(string)

Checks if a player name is valid.

bool IsNameValid(string name)

Parameters

name string

The name to validate.

Returns

bool

true if the name is valid; otherwise, false.

IsNickNameCharacterAllowed(char)

Checks if a specific character is allowed in player names.

bool IsNickNameCharacterAllowed(char character)

Parameters

character char

The character to check.

Returns

bool

true if the character is allowed; otherwise, false.

Players()

Gets a set of all available players only.

FlatPtrHashSet<IPlayer> Players()

Returns

FlatPtrHashSet<IPlayer>

RequestPlayer(ref PeerNetworkData, ref PeerRequestParams)

Requests a new player with the given network parameters.

(NewConnectionResult, IPlayer) RequestPlayer(ref PeerNetworkData netData, ref PeerRequestParams parms)

Parameters

netData PeerNetworkData

The network data for the player.

parms PeerRequestParams

The request parameters.

Returns

(NewConnectionResult, IPlayer)

A tuple containing the result of the connection and the player instance.

SendChatMessageToAll(IPlayer, string)

Sends a chat message to all players.

void SendChatMessageToAll(IPlayer from, string message)

Parameters

from IPlayer

The player sending the message.

message string

The message to send.

SendClientMessageToAll(ref Colour, string)

Sends a client message to all players.

void SendClientMessageToAll(ref Colour colour, string message)

Parameters

colour Colour

The colour of the message.

message string

The message to send.

SendDeathMessageToAll(IPlayer, IPlayer, int)

Sends a death message to all players.

void SendDeathMessageToAll(IPlayer killer, IPlayer killee, int weapon)

Parameters

killer IPlayer

The player who killed.

killee IPlayer

The player who was killed.

weapon int

The weapon used.

SendEmptyDeathMessageToAll()

Sends an empty death message to all players.

void SendEmptyDeathMessageToAll()

SendGameTextToAll(string, TimeSpan, int)

Sends a game text message to all players.

void SendGameTextToAll(string message, TimeSpan time, int style)

Parameters

message string

The message to display.

time TimeSpan

The duration to display the message.

style int

The style of the message.