Table of Contents

Class DefaultPlayerCommandMessageService

Namespace
SampSharp.Entities.SAMP.Commands
Assembly
SampSharp.OpenMp.Entities.Commands.dll

Default implementation of IPlayerCommandMessageService. Sends formatted messages to players via SendClientMessage.

public class DefaultPlayerCommandMessageService : IPlayerCommandMessageService
Inheritance
DefaultPlayerCommandMessageService
Implements
Inherited Members

Constructors

DefaultPlayerCommandMessageService(ICommandTextFormatter)

Initializes a new instance of the DefaultPlayerCommandMessageService class with the specified command text formatter.

public DefaultPlayerCommandMessageService(ICommandTextFormatter formatter)

Parameters

formatter ICommandTextFormatter

A formatter used to format command text.

Methods

SendCommandNotFound(Player, string)

Sends a command not found message to a player.

public virtual bool SendCommandNotFound(Player player, string input)

Parameters

player Player

The player to send the message to.

input string

The input text that didn't match any command.

Returns

bool

True to continue processing, false to stop and return false from the command handler.

SendPermissionDenied(Player, CommandDefinition)

Sends a permission denied message to a player.

public virtual bool SendPermissionDenied(Player player, CommandDefinition overload)

Parameters

player Player

The player to send the message to.

overload CommandDefinition

The command overload that was denied.

Returns

bool

True if a message was send to the player, false otherwise.

SendUsage(Player, IReadOnlyList<CommandDefinition>, string)

Sends a usage message to a player.

public virtual void SendUsage(Player player, IReadOnlyList<CommandDefinition> overloads, string usedCommandName = "")

Parameters

player Player

The player to send the message to.

overloads IReadOnlyList<CommandDefinition>

All overloads of the command.

usedCommandName string

The actual command name/path used (e.g., alias name). Empty string means use canonical command name.