![]() |
fCraft
0.638
Custom Minecraft Server
|
Helper class for handling player-generated chat. More...
Static Public Member Functions | |
| static bool | SendGlobal ([NotNull] Player player,[NotNull] string rawMessage) |
| Sends a global (white) chat. | |
| static bool | SendMe ([NotNull] Player player,[NotNull] string rawMessage) |
| Sends an action message (/Me). | |
| static bool | SendPM ([NotNull] Player from,[NotNull] Player to,[NotNull] string rawMessage) |
| Sends a private message (PM). Does NOT send a copy of the message to the sender. | |
| static bool | SendRank ([NotNull] Player player,[NotNull] Rank rank,[NotNull] string rawMessage) |
| Sends a rank-wide message (@Rank message). | |
| static bool | SendSay ([NotNull] Player player,[NotNull] string rawMessage) |
| Sends a global announcement (/Say). | |
| static bool | SendStaff ([NotNull] Player player,[NotNull] string rawMessage) |
| Sends a staff message (/Staff). | |
| static bool | ContainsInvalidChars ([NotNull] string message) |
| Checks for unprintable or illegal characters in a message. | |
| static string | ReplaceTextKeywords ([NotNull] Player player,[NotNull] string input) |
| Replaces keywords with appropriate values. See http://www.fcraft.net/wiki/Constants | |
| static string | ReplaceNewlines ([NotNull] string message) |
| Replaces newline codes (&n and &N) with actual newlines ( ). | |
| static string | StripNewlines ([NotNull] string message) |
| Removes newlines ( ) and newline codes (&n and &N). | |
| static string | StripEmotes ([NotNull] string message) |
| Strips all emote symbols (ASCII control characters). Does not strip UTF-8 equivalents of emotes. | |
| static string | ReplaceEmoteKeywords ([NotNull] string message) |
| Replaces emote keywords with actual emotes, using Chat.EmoteKeywords mapping. Keywords are enclosed in curly braces, and are case-insensitive. | |
| static string | ReplacePercentColorCodes ([NotNull] string message, bool allowNewlines) |
| Substitutes percent color codes (e.g. C) with equivalent ampersand color codes (&C). Also replaces newline codes (N) with actual newlines ( ). | |
| static string | UnescapeBackslashes ([NotNull] string message) |
| Unescapes backslashes. Any paid of backslashes (\) is converted to a single one (). | |
| static string | ReplaceUncodeWithEmotes ([NotNull] string input) |
| Replaces UTF-8 symbol characters with ASCII control characters, matching Code Page 437. Opposite of ReplaceEmotesWithUncode. | |
| static string | ReplaceEmotesWithUncode ([NotNull] string input) |
| Replaces ASCII control characters with UTF-8 symbol characters, matching Code Page 437. Opposite of ReplaceUncodeWithEmotes. | |
Static Public Attributes | |
| static readonly Dictionary < string, char > | EmoteKeywords |
| List of chat keywords, and emotes that they stand for. | |
Events | |
| static EventHandler < ChatSendingEventArgs > | Sending |
| Occurs when a chat message is about to be sent. Cancelable. | |
| static EventHandler < ChatSentEventArgs > | Sent |
| Occurs after a chat message has been sent. | |
Helper class for handling player-generated chat.
|
static |
Checks for unprintable or illegal characters in a message.
| message | Message to check. |
| ArgumentNullException | message is null. |
|
static |
Replaces emote keywords with actual emotes, using Chat.EmoteKeywords mapping. Keywords are enclosed in curly braces, and are case-insensitive.
| message | String to process. |
| ArgumentNullException | input is null. |
|
static |
Replaces ASCII control characters with UTF-8 symbol characters, matching Code Page 437. Opposite of ReplaceUncodeWithEmotes.
| input | String to process. |
| ArgumentNullException | input is null. |
|
static |
Replaces newline codes (&n and &N) with actual newlines (
).
| message | Message to process. |
| ArgumentNullException | message is null. |
|
static |
Substitutes percent color codes (e.g. C) with equivalent ampersand color codes (&C). Also replaces newline codes (N) with actual newlines (
).
| message | Message to process. |
| allowNewlines | Whether newlines are allowed. |
| ArgumentNullException | message is null. |
|
static |
Replaces keywords with appropriate values. See http://www.fcraft.net/wiki/Constants
|
static |
Replaces UTF-8 symbol characters with ASCII control characters, matching Code Page 437. Opposite of ReplaceEmotesWithUncode.
| input | String to process. |
| ArgumentNullException | input is null. |
|
static |
Sends a global (white) chat.
| player | Player writing the message. |
| rawMessage | Message text. |
|
static |
Sends an action message (/Me).
| player | Player writing the message. |
| rawMessage | Message text. |
|
static |
Sends a private message (PM). Does NOT send a copy of the message to the sender.
| from | Sender player. |
| to | Recepient player. |
| rawMessage | Message text. |
|
static |
Sends a global announcement (/Say).
| player | Player writing the message. |
| rawMessage | Message text. |
|
static |
Sends a staff message (/Staff).
| player | Player writing the message. |
| rawMessage | Message text. |
|
static |
Strips all emote symbols (ASCII control characters). Does not strip UTF-8 equivalents of emotes.
| message | Message to strip emotes from. |
|
static |
Removes newlines (
) and newline codes (&n and &N).
| message | Message to process. |
| ArgumentNullException | message is null. |
|
static |
Unescapes backslashes. Any paid of backslashes (\) is converted to a single one ().
| message | String to process. |
| ArgumentNullException | message is null. |
|
static |
List of chat keywords, and emotes that they stand for.
|
static |
Occurs when a chat message is about to be sent. Cancelable.
|
static |
Occurs after a chat message has been sent.