Interface IPlayerPool.IManagedInterface
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
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
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
dataSpanLite<byte>The data span with the length in bits.
channelintThe channel to use.
skipFromIPlayerThe player to exclude from the broadcast.
dispatchEventsboolWhether 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
idintThe RPC ID.
dataSpanLite<byte>The data span with the length in bits.
channelintThe channel to use.
skipFromIPlayerThe player to exclude from the broadcast.
dispatchEventsboolWhether to dispatch RPC-related events.
CreateExplosionForAll(Vector3, int, float)
Creates an explosion for all players.
void CreateExplosionForAll(Vector3 vec, int type, float radius)
Parameters
vecVector3The position of the explosion.
typeintThe type of explosion.
radiusfloatThe radius of the explosion.
Entries()
Gets a set of all available players and bots (anything in the pool).
FlatPtrHashSet<IPlayer> Entries()
Returns
GetDefaultColour(int)
Gets the default colour assigned to a player ID when they first connect.
Colour GetDefaultColour(int pid)
Parameters
pidintThe player ID.
Returns
- Colour
The default colour.
GetPlayerChangeDispatcher()
Gets a dispatcher for player data change events.
IEventDispatcher<IPlayerChangeEventHandler> GetPlayerChangeDispatcher()
Returns
GetPlayerCheckDispatcher()
Gets a dispatcher for player client check response events.
IEventDispatcher<IPlayerCheckEventHandler> GetPlayerCheckDispatcher()
Returns
GetPlayerClickDispatcher()
Gets a dispatcher for player clicking events.
IEventDispatcher<IPlayerClickEventHandler> GetPlayerClickDispatcher()
Returns
GetPlayerConnectDispatcher()
Gets a dispatcher for player connection events.
IEventDispatcher<IPlayerConnectEventHandler> GetPlayerConnectDispatcher()
Returns
GetPlayerDamageDispatcher()
Gets a dispatcher for player damage and death events.
IEventDispatcher<IPlayerDamageEventHandler> GetPlayerDamageDispatcher()
Returns
GetPlayerShotDispatcher()
Gets a dispatcher for player shooting events.
IEventDispatcher<IPlayerShotEventHandler> GetPlayerShotDispatcher()
Returns
GetPlayerSpawnDispatcher()
Gets a dispatcher for player spawn events.
IEventDispatcher<IPlayerSpawnEventHandler> GetPlayerSpawnDispatcher()
Returns
GetPlayerStreamDispatcher()
Gets a dispatcher for player streaming events.
IEventDispatcher<IPlayerStreamEventHandler> GetPlayerStreamDispatcher()
Returns
GetPlayerTextDispatcher()
Gets a dispatcher for player text and command events.
IEventDispatcher<IPlayerTextEventHandler> GetPlayerTextDispatcher()
Returns
GetPlayerUpdateDispatcher()
Gets a dispatcher for player update events.
IEventDispatcher<IPlayerUpdateEventHandler> GetPlayerUpdateDispatcher()
Returns
GetPoolEventDispatcher()
Gets a dispatcher for player pool events.
IEventDispatcher<IPoolEventHandler<IPlayer>> GetPoolEventDispatcher()
Returns
HideGameTextForAll(int)
Hides a game text message for all players.
void HideGameTextForAll(int style)
Parameters
styleintThe 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
Returns
- bool
trueif the name is taken; otherwise,false.
IsNameValid(string)
Checks if a player name is valid.
bool IsNameValid(string name)
Parameters
namestringThe name to validate.
Returns
- bool
trueif the name is valid; otherwise,false.
IsNickNameCharacterAllowed(char)
Checks if a specific character is allowed in player names.
bool IsNickNameCharacterAllowed(char character)
Parameters
charactercharThe character to check.
Returns
- bool
trueif the character is allowed; otherwise,false.
Players()
Gets a set of all available players only.
FlatPtrHashSet<IPlayer> Players()
Returns
RequestPlayer(ref PeerNetworkData, ref PeerRequestParams)
Requests a new player with the given network parameters.
(NewConnectionResult, IPlayer) RequestPlayer(ref PeerNetworkData netData, ref PeerRequestParams parms)
Parameters
netDataPeerNetworkDataThe network data for the player.
parmsPeerRequestParamsThe 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
SendClientMessageToAll(ref Colour, string)
Sends a client message to all players.
void SendClientMessageToAll(ref Colour colour, string message)
Parameters
SendDeathMessageToAll(IPlayer, IPlayer, int)
Sends a death message to all players.
void SendDeathMessageToAll(IPlayer killer, IPlayer killee, int weapon)
Parameters
killerIPlayerThe player who killed.
killeeIPlayerThe player who was killed.
weaponintThe 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)