C# Class fCraft.Chat

Helper class for handling player-generated chat.
Mostrar archivo Open project: GlennMR/800craft Class Usage Examples

Public Properties

Property Type Description
EmoteKeywords char>.Dictionary
Swears List
badWordMatchers IEnumerable

Public Methods

Method Description
ContainsInvalidChars ( string message ) : bool

Checks for unprintable or illegal characters in a message.

SendAdmin ( Player player, string rawMessage ) : bool
SendCustom ( Player player, string rawMessage ) : bool
SendGlobal ( [ player, [ rawMessage ) : bool

Sends a global (white) chat.

SendMe ( [ player, [ rawMessage ) : bool

Sends an action message (/Me).

SendPM ( [ from, [ to, [ rawMessage ) : bool

Sends a private message (PM). Does NOT send a copy of the message to the sender.

SendRank ( [ player, [ rank, [ rawMessage ) : bool

Sends a rank-wide message (@@Rank message).

SendSay ( [ player, [ rawMessage ) : bool

Sends a global announcement (/Say).

SendStaff ( [ player, [ rawMessage ) : bool

Sends a staff message (/Staff).

Private Methods

Method Description
GetRawMessageType ( string message ) : RawMessageType

Determines the type of player-supplies message based on its syntax.

RaiseSendingEvent ( ChatSendingEventArgs args ) : bool
RaiseSentEvent ( ChatSendingEventArgs args, int count ) : void
ReplaceEmoteKeywords ( [ message ) : string
ReplaceEmotesWithUncode ( [ input ) : string
ReplaceNewlines ( [ message ) : string
ReplacePercentColorCodes ( [ message, bool allowNewlines ) : string
ReplaceTextKeywords ( [ player, [ input ) : string
ReplaceUncodeWithEmotes ( [ input ) : string
SendInternal ( [ e ) : bool
StripEmotes ( [ message ) : string
StripNewlines ( [ message ) : string
UnescapeBackslashes ( [ message ) : string

Method Details

ContainsInvalidChars() public static method

Checks for unprintable or illegal characters in a message.
public static ContainsInvalidChars ( string message ) : bool
message string Message to check.
return bool

SendAdmin() public static method

public static SendAdmin ( Player player, string rawMessage ) : bool
player Player
rawMessage string
return bool

SendCustom() public static method

public static SendCustom ( Player player, string rawMessage ) : bool
player Player
rawMessage string
return bool

SendGlobal() public static method

Sends a global (white) chat.
public static SendGlobal ( [ player, [ rawMessage ) : bool
player [ Player writing the message.
rawMessage [ Message text.
return bool

SendMe() public static method

Sends an action message (/Me).
public static SendMe ( [ player, [ rawMessage ) : bool
player [ Player writing the message.
rawMessage [ Message text.
return bool

SendPM() public static method

Sends a private message (PM). Does NOT send a copy of the message to the sender.
public static SendPM ( [ from, [ to, [ rawMessage ) : bool
from [ Sender player.
to [ Recepient player.
rawMessage [ Message text.
return bool

SendRank() public static method

Sends a rank-wide message (@@Rank message).
public static SendRank ( [ player, [ rank, [ rawMessage ) : bool
player [ Player writing the message.
rank [ Target rank.
rawMessage [ Message text.
return bool

SendSay() public static method

Sends a global announcement (/Say).
public static SendSay ( [ player, [ rawMessage ) : bool
player [ Player writing the message.
rawMessage [ Message text.
return bool

SendStaff() public static method

Sends a staff message (/Staff).
public static SendStaff ( [ player, [ rawMessage ) : bool
player [ Player writing the message.
rawMessage [ Message text.
return bool

Property Details

EmoteKeywords public_oe static_oe property

List of chat keywords, and emotes that they stand for.
public static Dictionary EmoteKeywords
return char>.Dictionary

Swears public_oe static_oe property

public static List Swears
return List

badWordMatchers public_oe static_oe property

public static IEnumerable badWordMatchers
return IEnumerable