CMObject
, Tickable
, CMLibrary
, TelnetFilter
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CoffeeFilter extends StdLibrary implements TelnetFilter
Modifier and Type | Class | Description |
---|---|---|
static class |
CoffeeFilter.Pronoun |
One of the most useful enum in the game, listing
the pronoun conversions that are correctly
rendered at runtime by context.
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
hexStr |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
CoffeeFilter() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
colorOnlyFilter(java.lang.String msg,
Session S) |
Does MXP and normal CM ^ color codes, and that's about it.
|
protected int |
convertEscape(Session S,
java.lang.StringBuffer str,
int index) |
|
java.lang.String |
fullInFilter(java.lang.String input) |
Safety filter for user input.
|
java.lang.String |
fullOutFilter(Session S,
MOB mob,
Physical source,
Environmental target,
Environmental tool,
java.lang.String msg,
boolean wrapOnly) |
The real workhorse of this library, which does ALL filtering,
including word wrap, MXP and MSP tags, % and \\ escape codes,
pronoun tags, (s), and all the rest.
|
protected java.lang.String |
getLastWord(java.lang.StringBuffer buf,
int lastSp,
int lastSpace) |
|
java.util.Set<java.lang.String> |
getPronounSuffixes() |
Returns the suffix strings for the various pronoun tags.
|
protected java.util.Map<java.lang.String,CoffeeFilter.Pronoun> |
getPronounTagTable() |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
void |
initializeClass() |
Called ONCE after all objects are loaded, but before the map is read in
during initialization.
|
java.lang.String |
mxpSafetyFilter(java.lang.String msg,
Session S) |
Does MXP tag correction if MXP is on, and that's it.
|
java.lang.String |
safetyInFilter(java.lang.String s) |
Removes carriage returns, linefeeds, and converts ' to `
|
java.lang.String |
secondaryUserInputFilter(java.lang.String s) |
Converts pronoun tags and at-sign variables
to neutral characters, rendering them useless.
|
java.lang.String |
simpleInFilter(java.lang.StringBuilder input) |
Safety filter for user input.
|
java.lang.String |
simpleInFilter(java.lang.StringBuilder input,
boolean permitMXPTags,
boolean isArchon) |
Safety filter for user input.
|
java.lang.String |
simpleOutFilter(java.lang.String msg) |
Simplest, least things done filter.
|
java.lang.String[] |
wrapOnlyFilter(java.lang.String msg,
int wrap) |
Does word wrapping, % and backslash \\ escape codes.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
public static final java.lang.String hexStr
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public void initializeClass()
CMObject
initializeClass
in interface CMObject
initializeClass
in class StdLibrary
protected java.util.Map<java.lang.String,CoffeeFilter.Pronoun> getPronounTagTable()
public java.util.Set<java.lang.String> getPronounSuffixes()
TelnetFilter
getPronounSuffixes
in interface TelnetFilter
public java.lang.String simpleOutFilter(java.lang.String msg)
TelnetFilter
simpleOutFilter
in interface TelnetFilter
msg
- the filtered messagepublic java.lang.String[] wrapOnlyFilter(java.lang.String msg, int wrap)
TelnetFilter
wrapOnlyFilter
in interface TelnetFilter
msg
- the string to filterwrap
- the column to wrap atpublic java.lang.String secondaryUserInputFilter(java.lang.String s)
TelnetFilter
secondaryUserInputFilter
in interface TelnetFilter
s
- the input string to filterprotected int convertEscape(Session S, java.lang.StringBuffer str, int index)
public java.lang.String colorOnlyFilter(java.lang.String msg, Session S)
TelnetFilter
colorOnlyFilter
in interface TelnetFilter
msg
- the message to translateS
- null, or the session object, for color codespublic java.lang.String mxpSafetyFilter(java.lang.String msg, Session S)
TelnetFilter
mxpSafetyFilter
in interface TelnetFilter
msg
- the string to translateS
- null, or the session for MXP statusprotected java.lang.String getLastWord(java.lang.StringBuffer buf, int lastSp, int lastSpace)
public java.lang.String fullOutFilter(Session S, MOB mob, Physical source, Environmental target, Environmental tool, java.lang.String msg, boolean wrapOnly)
TelnetFilter
fullOutFilter
in interface TelnetFilter
S
- null, or the session for wrap, tags, other infomob
- the mob who will see the messagesource
- the source for S-pronounstarget
- the target for T-pronounstool
- the tool for O-pronounsmsg
- the string to filterwrapOnly
- true to skip pronouns, and (s)public java.lang.String simpleInFilter(java.lang.StringBuilder input)
TelnetFilter
simpleInFilter
in interface TelnetFilter
input
- the input stringpublic java.lang.String simpleInFilter(java.lang.StringBuilder input, boolean permitMXPTags, boolean isArchon)
TelnetFilter
simpleInFilter
in interface TelnetFilter
input
- the input stringpermitMXPTags
- true to allow mxp tags from usersisArchon
- true to allow certain escape codes from userspublic java.lang.String fullInFilter(java.lang.String input)
TelnetFilter
fullInFilter
in interface TelnetFilter
input
- the input stringpublic java.lang.String safetyInFilter(java.lang.String s)
TelnetFilter
safetyInFilter
in interface TelnetFilter
s
- the string to filter