com.planet_ink.coffee_mud.core
Class CMProps

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by com.planet_ink.coffee_mud.core.CMProps
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class CMProps
extends java.util.Properties

The source class for thread-group-based and global mud properties. Acts as a singleton for the purposes of access to properties, parsed into Str(ing), Int(eger), and Bool(ean). The singleton maintains instances of itself for thread-group access, and fills in any gaps with the base-thread-group values.

See Also:
Serialized Form

Nested Class Summary
static class CMProps.Bool
          Enums for Boolean entries in the coffeemud.ini file
static class CMProps.Int
          Enums for Integer entries in the coffeemud.ini file
static class CMProps.ListFile
          Enums for localizeable string list entries in lists.ini
static class CMProps.Str
          Enums for String entries in the coffeemud.ini file
static class CMProps.StrList
          Enums for String list entries
static class CMProps.WhiteList
          Enum for white lists for various purposes
 
Field Summary
protected  java.util.List<java.lang.String> channelFilter
           
protected  java.util.Map<java.lang.String,java.lang.Double> cmdActionCostExceptions
           
protected  java.util.Map<java.lang.String,java.lang.Double> cmdComActionCostExceptions
           
protected  java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> commonCost
           
protected  java.util.List<java.lang.String> emoteFilter
           
protected static char[] FILTER_CHARS
           
protected static java.lang.String FILTER_PATTERN
           
protected  java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> languageCost
           
protected  long lastReset
           
protected  boolean loaded
           
protected  java.util.Map<java.lang.String,java.lang.Integer> maxClanCatsMap
           
protected  long MILLIS_PER_MUDHOUR
           
protected  PairVector<java.lang.String,java.lang.Long> newusersByIP
           
protected  int pkillLevelDiff
           
protected  java.util.List<java.lang.String> poseFilter
           
protected  java.util.Map<java.lang.String,java.lang.ThreadGroup> privateSet
           
protected  byte[] promptSuffix
           
static java.lang.Class<? extends java.lang.Enum<?>>[] PROP_CLASSES
           
protected  java.util.Set<java.lang.String> publicClanCats
           
protected  java.util.List<java.lang.String> sayFilter
           
protected  java.util.Map<java.lang.String,java.lang.Double> skillActionCostExceptions
           
protected  java.util.Map<java.lang.String,java.lang.Double> skillComActionCostExceptions
           
protected  java.util.Map<java.lang.String,java.lang.Double> skillMaxManaExceptions
           
protected  java.util.Map<java.lang.String,java.lang.Double> skillMinManaExceptions
           
protected  java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> skillsCost
           
protected  java.util.Map<java.lang.String,java.lang.Double> socActionCostExceptions
           
protected  java.util.Map<java.lang.String,java.lang.Double> socComActionCostExceptions
           
protected  java.lang.String[][] statCodeExtensions
           
protected  java.lang.Boolean[] sysBools
           
protected  java.lang.Integer[] sysInts
           
protected  java.lang.Double[] sysIntsAsFloat
           
protected  java.lang.String[][] sysLists
           
protected  java.lang.Object[] sysLstFileLists
           
protected  java.util.Set<java.lang.String>[] sysLstFileSet
           
protected  java.lang.String[] sysVars
           
protected  long TICKS_PER_RLDAY
           
protected  long TICKS_PER_RLHOUR
           
protected  long TICKS_PER_RLMIN
           
protected  long TIME_TICK
           
protected  double TIME_TICK_DOUBLE
           
protected  java.util.Map<CMProps.WhiteList,java.util.regex.Pattern[]> whiteLists
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
CMProps()
          Constructor for a property object that applies only to this thread group.
CMProps(java.io.InputStream in)
          Creates a properties object for the callers thread group using the given input stream as input for the properties.
CMProps(java.util.Properties p, java.lang.String filename)
          Creates a properties object for the callers thread group using the given file path as input for the properties and the given properties as a baseline.
CMProps(java.lang.String filename)
          Creates a properties object for the callers thread group using the given file path as input for the properties.
 
Method Summary
static void addListVar(CMProps.StrList varType, java.lang.String var)
          Add to the end of one of the pre-processed coffeemud.ini list entries for the callers thread group.
static void addNewUserByIP(java.lang.String address)
          Adds a new new user entry for the callers thread group, and the given address.
static java.lang.String applyINIFilter(java.lang.String msg, CMProps.Str whichFilter)
          Alters the given message according to the given filter, by replacing any words found in the given filter with garbage characters.
static CMProps get(Session session)
          Returns an instance of CMProps appropriate to either the given session, or otherwise the current thread, as normal.
static java.lang.String getAnyListFileValue(CMProps.ListFile varCode)
          Given the specific lists.ini entry, grabs the indexed string list, returns a random string choice from a random index in the list.
 boolean getBool(CMProps.Bool varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for this prop object.
 boolean getBoolean(java.lang.String tagToGet)
          retrieve a particular .ini file entry as a boolean Usage: boolean i=getBoolean("TAG");
static boolean getBoolVar(CMProps.Bool varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.
static double getCommandActionCost(java.lang.String ID)
          Return the action cost associated with a specific Command ID(), or the default value if no exception is found for that command.
static double getCommandActionCost(java.lang.String ID, double defaultValue)
          Return the action cost associated with a specific Command ID(), or the default value if no exception is found for that command.
static double getCommandCombatActionCost(java.lang.String ID)
          Return the action cost associated with a specific Command ID() during combat, or the default value if no exception is found for that command.
static double getCommandCombatActionCost(java.lang.String ID, double defaultValue)
          Return the action cost associated with a specific Command ID() during combat, or the default value if no exception is found for that command.
static ExpertiseLibrary.SkillCostDefinition getCommonSkillGainCost(java.lang.String id)
          Returns the cost of gaining the given common skill, by Ability id, for the callers thread group.
static int getCountNewUserByIP(java.lang.String address)
          Returns the number of times the given ip address has created a new user in the callers thread group properties, within a given amount of time.
 double getDouble(java.lang.String tagToGet)
          retrieve a particular .ini file entry as a double Usage: double i=getDouble("TAG");
static java.lang.String[] getExtraStatCodesHolder(CMObject O)
          Checks the properties for any "extra" properties attached to an object of the given object type, and if found, constructs a string array to hold all of the extra values to go with the extra properties, and returns it.
static java.lang.String getFilterPattern()
          Returns the dirty word filter pattern
 int getInt(CMProps.Int varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for theis props object.
 int getInt(java.lang.String tagToGet)
          retrieve a particular .ini file entry as an integer Usage: int i=getInt("TAG");
static int getIntVar(CMProps.Int varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.
static double getIntVarAsDouble(CMProps.Int varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.
static double getIntVarAsPct(CMProps.Int varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.
static ExpertiseLibrary.SkillCostDefinition getLangSkillGainCost(java.lang.String id)
          Returns the cost of gaining the given language skill, by Ability id, for the callers thread group.
static long getLastResetTime()
          Returns the last time the properties for the callers thread group has been loaded.
static java.lang.String getListFileChoiceFromIndexedList(CMProps.ListFile varCode, int listIndex)
          Given the specific lists.ini entry, grabs the indexed string list, and then returns a random string from that choices available at the given index in the string list.
static java.lang.String getListFileChoiceFromIndexedListByHash(CMProps.ListFile varCode, int hash)
          Given the specific lists.ini entry, grabs the indexed string list, and then returns a random string from that choices available at the hash index in the string list.
static int getListFileFirstInt(CMProps.ListFile var)
          Returns the first integer in the integer array from the lists.ini file of the given ListFile entry, for the callers thread group.
static java.lang.Object[][][] getListFileGrid(CMProps.ListFile var)
          Returns the entire object grid from the lists.ini file of the given ListFile entry, for the callers thread group.
static int getListFileIndexedListSize(CMProps.ListFile varCode)
          Given the specific lists.ini entry, grabs the indexed string list, and it's size.
static int[] getListFileIntList(CMProps.ListFile var)
          Returns the entire int list from the lists.ini file of the given ListFile entry, for the callers thread group.
static java.lang.String[] getListFileStringList(CMProps.ListFile var)
          Returns the entire string list from the lists.ini file of the given ListFile entry, for the callers thread group.
static java.util.Set<java.lang.String> getListFileVarSet(CMProps.ListFile varType)
          Retrieve one of the pre-processed coffeemud.ini lists for the callers thread group, as a hashed set of values.
static java.lang.String[] getListVar(CMProps.StrList varType)
          Retrieve one of the pre-processed coffeemud.ini lists for the callers thread group.
 long getLong(java.lang.String tagToGet)
          retrieve a particular .ini file entry as a long Usage: long i=getInt("TAG");
static int getMaxClansThisCategory(java.lang.String clanCategory)
          Returns maximum the maximum number of clans of this category a player can belong to according to the callers properties.
static int getMaxManaException(java.lang.String skillID)
          Returns the maximum amount of usage cost (mana) for the given ability ID().
static long getMillisPerMudHour()
          Returns the number of real milliseconds that occur every in-game "hour"
static int getMinManaException(java.lang.String skillID)
          Returns the minimum amount of usage cost (mana) for the given ability ID().
static int getMobHPBase()
          Retrieve the base MOB hit point base
static ExpertiseLibrary.SkillCostDefinition getNormalSkillGainCost(java.lang.String id)
          Returns the cost of gaining the given skill, by Ability id, for the callers thread group.
static int getPKillLevelDiff()
          Returns the maximum level difference between players who want to PVP each other.
static java.lang.ThreadGroup getPrivateOwner(java.lang.String s)
          Returns the first thread group available that privately owns the given property, excepting the base group.
 java.lang.String getPrivateStr(java.lang.String tagToGet)
          retrieve a local .ini file entry as a string Usage: String s=getPrivateStr("TAG");
static java.util.Set<java.lang.String> getPrivateSubSet(java.lang.String mask)
          Returns the set of properties that are private to the callers thread group.
static byte[] getPromptSuffix()
          Returns the array of bytes that must be sent after every prompt.
static java.lang.String getProp(java.lang.String varName)
          Returns a string representation of the given property, as best it can.
 java.lang.String getRawPrivateStr(java.lang.String tagToGet)
          retrieve raw local .ini file entry as a string Usage: String s=getRawPrivateStr("TAG");
static double getSkillActionCost(java.lang.String ID)
          Return the action cost associated with a specific Ability ID(), or the default value if no exception is found for that Ability.
static double getSkillActionCost(java.lang.String ID, double defaultValue)
          Return the action cost associated with a specific Ability ID(), or the default value if no exception is found for that Ability.
static double getSkillCombatActionCost(java.lang.String ID)
          Return the action cost associated with a specific Ability ID() during combat, or the default value if no exception is found for that Ability.
static double getSkillCombatActionCost(java.lang.String ID, double defaultValue)
          Return the action cost associated with a specific Ability ID() during combat, or the default value if no exception is found for that Ability.
static double getSocialActionCost(java.lang.String baseName)
          Return the action cost associated with a specific Social base name, or the default value if no exception is found for that Social.
static double getSocialCombatActionCost(java.lang.String baseName)
          Return the action cost associated with a specific Social base name during combat, or the default value if no exception is found for that Social.
static java.lang.String getStatCodeExtensionValue(java.lang.String[] codes, java.lang.String[] xtraValues, java.lang.String code)
          This method searches the given codes array for an entry matching the given code, and returns the value in xtraValues, or "" if not found.
static java.lang.String[] getStatCodesList(java.lang.String[] baseStatCodes, CMObject O)
          Checks the properties for any "extra" properties attached to an object of the given object type, and if found, constructs a string array to hold all of the object "base" stat codes, and the extra stat codes, and returns it.
 java.lang.String getStr(CMProps.Str varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for this prop object
 java.lang.String getStr(java.lang.String tagToGet)
          retrieve a particular .ini file entry as a string Usage: String s=getStr(p,"TAG");
 java.lang.String getStr(java.lang.String tagToGet, java.lang.String defaultVal)
          retrieve a particular .ini file entry as a string, or use a default Usage: String s=getStr(p,"TAG");
 java.lang.String[][] getStrsStarting(java.lang.String tagStartersToGet)
          retrieve particular .ini file entrys as a string array Usage: String s=getStrsStarting(p,"TAG");
static long getTickMillis()
          Returns the amount of milliseconds per mud tick.
static double getTickMillisD()
          Returns the amount of milliseconds per mud tick, as a double.
static long getTicksPerDay()
          Returns the number of game ticks that occur every real life day
static long getTicksPerHour()
          Returns the number of game ticks that occur every real life hour (60 min)
static long getTicksPerMinute()
          Returns the number of game ticks that occur every real life minute
static long getTicksPerMudHour()
          Returns the number of game ticks that occur every in-game "hour"
static java.lang.String getVar(CMProps.Str varNum)
          Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.
static CMProps instance()
          Returns the property object that applies to the callers thread group.
static CMProps instance(char c)
          Returns the property object that applies to the given thread group.
static boolean isAnyINIFiltered(java.lang.String msg)
          Returns true if the given msg contains words which would be filtered out by any of the filters, for the callers thread group.
static boolean isINIFiltered(java.lang.String msg, CMProps.Str whichFilter)
          Returns true if the given msg contains words which would be filtered out by the given filter for the callers thread group.
 boolean isLoaded()
          Returns true if this properties object has been loaded from a stream or ini file, and false otherwise.
static boolean isOnWhiteList(CMProps.WhiteList listType, java.lang.String chk)
          Retrurns true if the given chk string matches one of the entries in the given WhiteList type for the callers thread group.
static boolean isOnWhiteList(CMProps props, CMProps.WhiteList listType, java.lang.String chk)
          Retrurns true if the given chk string matches one of the entries in the given WhiteList type for the given properties object.
static boolean isPrivateToMe(java.lang.String s)
          Returns true if the given property name is private to the callers thread group, and false if it is shared with the base thread group.
static boolean isPropName(java.lang.String varName)
          Returns whether the given string is a valid property name, referring to the names of the various enums in the static CMProps class.
static boolean isPublicClanGvtCategory(java.lang.String clanCategory)
          Returns true if, according to the callers properties, the given clan category makes it classified as a "Public Clan".
static boolean isTheme(int themeMask)
          Returns true if the global mud theme includes the them given by the themeMask passed in.
static boolean isUsingAccountSystem()
           
static java.util.List<java.lang.String> loadEnumerablePage(java.lang.String iniFile)
          Loads the given iniFile by mud path, combines any multi-line entries, and returns all the lines in the file in a list.
static CMProps loadPropPage(java.lang.String iniFile)
          Creates a new properties object for the callers thread group and loads the given ini file.
 void resetSecurityVars()
          Reads this properties objects and sets security variables.
 void resetSystemVars()
          Reads this properties objects and sets ALL internal variables.
static void setBoolAllVar(CMProps.Bool varNum, boolean val)
          Sets one of the pre-processed coffeemud.ini entries for all thread groups.
static void setBoolVar(CMProps.Bool varNum, boolean val)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group.
static void setIntVar(CMProps.Int varNum, int val)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group.
static void setIntVar(CMProps.Int varNum, java.lang.String val)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group, only in this case, the entry needs to be converted to an int first.
static void setIntVar(CMProps.Int varNum, java.lang.String val, int defaultValue)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group, only in this case, the entry needs to be converted to an int first, if it can.
static void setListVar(CMProps.StrList varType, java.lang.String[] var)
          Sets one of the pre-processed coffeemud.ini list entries for the callers thread group.
static boolean setProp(java.lang.String varName, java.lang.String value)
          Sets a property from a string representation of the given property, as best it can.
static void setStatCodeExtensionValue(java.lang.String[] codes, java.lang.String[] xtraValues, java.lang.String code, java.lang.String val)
          This method searches the given codes array for an entry matching the given code, and set the value in xtraValues when found.
static void setUpAllLowVar(CMProps.Str varNum, java.lang.String val)
          Sets one of the pre-processed coffeemud.ini entries for all thread groups.
static void setUpCosts(java.lang.String fieldName, java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> map, java.util.List<java.lang.String> fields)
          Given the list of skill cost definitions, this method will parse out the ID and the data, build a cost definition object and store the cost definition in the given map.
static void setUpLowVar(CMProps.Str varNum, java.lang.String val)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group, without making the value uppercase.
static void setVar(CMProps.Str varNum, java.lang.String val)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group, forcing the value to uppercase.
static void setVar(CMProps.Str varNum, java.lang.String val, boolean upperFy)
          Sets one of the pre-processed coffeemud.ini entries for the callers thread group.
static void setWhitelist(CMProps.WhiteList listType, java.lang.String list)
          Parses and sets one of the properties whitelist entries by parsing the given string by commands, and compiling them into Patterns, all for the callers thread group.
static void setWhitelist(CMProps props, CMProps.WhiteList listType, java.lang.String list)
          Parses and sets one of the properties whitelist entries by parsing the given string by commands, and compiling them into Patterns.
 long tickMillis()
          Returns the amount of milliseconds per mud tick.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FILTER_PATTERN

protected static final java.lang.String FILTER_PATTERN
See Also:
Constant Field Values

FILTER_CHARS

protected static final char[] FILTER_CHARS

PROP_CLASSES

public static final java.lang.Class<? extends java.lang.Enum<?>>[] PROP_CLASSES

sysLstFileSet

protected final java.util.Set<java.lang.String>[] sysLstFileSet

sysVars

protected final java.lang.String[] sysVars

sysInts

protected final java.lang.Integer[] sysInts

sysIntsAsFloat

protected final java.lang.Double[] sysIntsAsFloat

sysBools

protected final java.lang.Boolean[] sysBools

sysLists

protected final java.lang.String[][] sysLists

sysLstFileLists

protected final java.lang.Object[] sysLstFileLists

sayFilter

protected final java.util.List<java.lang.String> sayFilter

channelFilter

protected final java.util.List<java.lang.String> channelFilter

emoteFilter

protected final java.util.List<java.lang.String> emoteFilter

poseFilter

protected final java.util.List<java.lang.String> poseFilter

statCodeExtensions

protected java.lang.String[][] statCodeExtensions

pkillLevelDiff

protected int pkillLevelDiff

loaded

protected boolean loaded

promptSuffix

protected byte[] promptSuffix

lastReset

protected long lastReset

TIME_TICK

protected long TIME_TICK

MILLIS_PER_MUDHOUR

protected long MILLIS_PER_MUDHOUR

TICKS_PER_RLMIN

protected long TICKS_PER_RLMIN

TICKS_PER_RLHOUR

protected long TICKS_PER_RLHOUR

TICKS_PER_RLDAY

protected long TICKS_PER_RLDAY

TIME_TICK_DOUBLE

protected double TIME_TICK_DOUBLE

maxClanCatsMap

protected final java.util.Map<java.lang.String,java.lang.Integer> maxClanCatsMap

publicClanCats

protected final java.util.Set<java.lang.String> publicClanCats

skillMaxManaExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> skillMaxManaExceptions

skillMinManaExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> skillMinManaExceptions

skillActionCostExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> skillActionCostExceptions

skillComActionCostExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> skillComActionCostExceptions

cmdActionCostExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> cmdActionCostExceptions

cmdComActionCostExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> cmdComActionCostExceptions

socActionCostExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> socActionCostExceptions

socComActionCostExceptions

protected final java.util.Map<java.lang.String,java.lang.Double> socComActionCostExceptions

whiteLists

protected final java.util.Map<CMProps.WhiteList,java.util.regex.Pattern[]> whiteLists

newusersByIP

protected final PairVector<java.lang.String,java.lang.Long> newusersByIP

privateSet

protected final java.util.Map<java.lang.String,java.lang.ThreadGroup> privateSet

commonCost

protected final java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> commonCost

skillsCost

protected final java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> skillsCost

languageCost

protected final java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> languageCost
Constructor Detail

CMProps

public CMProps()
Constructor for a property object that applies only to this thread group.


CMProps

public CMProps(java.io.InputStream in)
Creates a properties object for the callers thread group using the given input stream as input for the properties.

Parameters:
in - a stream from which to draw the properties.

CMProps

public CMProps(java.lang.String filename)
Creates a properties object for the callers thread group using the given file path as input for the properties.

Parameters:
filename - a file from which to draw the properties.

CMProps

public CMProps(java.util.Properties p,
               java.lang.String filename)
Creates a properties object for the callers thread group using the given file path as input for the properties and the given properties as a baseline.

Parameters:
p - loads these properties into this object first
filename - a file from which to draw the rest of the properties.
Method Detail

instance

public static final CMProps instance()
Returns the property object that applies to the callers thread group.

Returns:
the property object that applies to the callers thread group.

instance

public static final CMProps instance(char c)
Returns the property object that applies to the given thread group.

Parameters:
c - thread group code to return properties for. Base = '0'.
Returns:
the property object that applies to the given thread group.

loadPropPage

public static final CMProps loadPropPage(java.lang.String iniFile)
Creates a new properties object for the callers thread group and loads the given ini file.

Parameters:
iniFile - the path and name of the ini file to load
Returns:
the new properties object

get

public static final CMProps get(Session session)
Returns an instance of CMProps appropriate to either the given session, or otherwise the current thread, as normal.

Parameters:
session - the session to get a thread id for, or null
Returns:
the appropriate CMProps instance

isLoaded

public boolean isLoaded()
Returns true if this properties object has been loaded from a stream or ini file, and false otherwise.

Returns:
true or false, depending

getFilterPattern

public static java.lang.String getFilterPattern()
Returns the dirty word filter pattern

Returns:
the dirty word filter pattern

getPrivateStr

public final java.lang.String getPrivateStr(java.lang.String tagToGet)
retrieve a local .ini file entry as a string Usage: String s=getPrivateStr("TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
String the value of the .ini file tag

getRawPrivateStr

public final java.lang.String getRawPrivateStr(java.lang.String tagToGet)
retrieve raw local .ini file entry as a string Usage: String s=getRawPrivateStr("TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
String the value of the .ini file tag

getStr

public final java.lang.String getStr(java.lang.String tagToGet)
retrieve a particular .ini file entry as a string Usage: String s=getStr(p,"TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
String the value of the .ini file tag

getStr

public final java.lang.String getStr(java.lang.String tagToGet,
                                     java.lang.String defaultVal)
retrieve a particular .ini file entry as a string, or use a default Usage: String s=getStr(p,"TAG");

Parameters:
tagToGet - the property tag to retrieve.
defaultVal - the value to return if the property does not exist
Returns:
String the value of the .ini file tag

getStrsStarting

public final java.lang.String[][] getStrsStarting(java.lang.String tagStartersToGet)
retrieve particular .ini file entrys as a string array Usage: String s=getStrsStarting(p,"TAG");

Parameters:
tagStartersToGet - the property tag to retrieve.
Returns:
String the value of the .ini file tag

getBoolean

public final boolean getBoolean(java.lang.String tagToGet)
retrieve a particular .ini file entry as a boolean Usage: boolean i=getBoolean("TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
int the value of the .ini file tag

getDouble

public final double getDouble(java.lang.String tagToGet)
retrieve a particular .ini file entry as a double Usage: double i=getDouble("TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
int the value of the .ini file tag

getInt

public final int getInt(java.lang.String tagToGet)
retrieve a particular .ini file entry as an integer Usage: int i=getInt("TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
int the value of the .ini file tag

getLong

public final long getLong(java.lang.String tagToGet)
retrieve a particular .ini file entry as a long Usage: long i=getInt("TAG");

Parameters:
tagToGet - the property tag to retrieve.
Returns:
long the value of the .ini file tag

isUsingAccountSystem

public static final boolean isUsingAccountSystem()

getCommandActionCost

public static final double getCommandActionCost(java.lang.String ID,
                                                double defaultValue)
Return the action cost associated with a specific Command ID(), or the default value if no exception is found for that command.

Parameters:
ID - the commands ID()
defaultValue - the value to return if the override does not exist
Returns:
the action cost

getCommandCombatActionCost

public static final double getCommandCombatActionCost(java.lang.String ID,
                                                      double defaultValue)
Return the action cost associated with a specific Command ID() during combat, or the default value if no exception is found for that command.

Parameters:
ID - the commands ID()
defaultValue - the default action cost to use
Returns:
the action cost

getCommandActionCost

public static final double getCommandActionCost(java.lang.String ID)
Return the action cost associated with a specific Command ID(), or the default value if no exception is found for that command.

Parameters:
ID - the commands ID()
Returns:
the action cost

getCommandCombatActionCost

public static final double getCommandCombatActionCost(java.lang.String ID)
Return the action cost associated with a specific Command ID() during combat, or the default value if no exception is found for that command.

Parameters:
ID - the commands ID()
Returns:
the action cost

getSkillActionCost

public static final double getSkillActionCost(java.lang.String ID,
                                              double defaultValue)
Return the action cost associated with a specific Ability ID(), or the default value if no exception is found for that Ability.

Parameters:
ID - the Ability ID()
defaultValue - the default action cost to use
Returns:
the action cost

getSkillCombatActionCost

public static final double getSkillCombatActionCost(java.lang.String ID,
                                                    double defaultValue)
Return the action cost associated with a specific Ability ID() during combat, or the default value if no exception is found for that Ability.

Parameters:
ID - the Ability ID()
defaultValue - the default action cost to use
Returns:
the action cost

getSkillActionCost

public static final double getSkillActionCost(java.lang.String ID)
Return the action cost associated with a specific Ability ID(), or the default value if no exception is found for that Ability.

Parameters:
ID - the Ability ID()
Returns:
the action cost

getSkillCombatActionCost

public static final double getSkillCombatActionCost(java.lang.String ID)
Return the action cost associated with a specific Ability ID() during combat, or the default value if no exception is found for that Ability.

Parameters:
ID - the Ability ID()
Returns:
the action cost

getSocialActionCost

public static final double getSocialActionCost(java.lang.String baseName)
Return the action cost associated with a specific Social base name, or the default value if no exception is found for that Social.

Parameters:
baseName - the Social Base Name
Returns:
the action cost

getSocialCombatActionCost

public static final double getSocialCombatActionCost(java.lang.String baseName)
Return the action cost associated with a specific Social base name during combat, or the default value if no exception is found for that Social.

Parameters:
baseName - the Social Base Name
Returns:
the action cost

getPKillLevelDiff

public static final int getPKillLevelDiff()
Returns the maximum level difference between players who want to PVP each other.

Returns:
the maximum level difference between players who want to PVP each other.

getVar

public static final java.lang.String getVar(CMProps.Str varNum)
Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.

Parameters:
varNum - the Str enum of the entry to get
Returns:
the value of the property.

isPropName

public static boolean isPropName(java.lang.String varName)
Returns whether the given string is a valid property name, referring to the names of the various enums in the static CMProps class.

Parameters:
varName - the possible name of a property
Returns:
true if it is some sort of prop enum, false otherwise

getProp

public static java.lang.String getProp(java.lang.String varName)
Returns a string representation of the given property, as best it can. referring to the names of the various enums in the static CMProps class. If the given property name does not exist, a "" is returned.

Parameters:
varName - the name of a property
Returns:
the string value of that property

setProp

public static boolean setProp(java.lang.String varName,
                              java.lang.String value)
Sets a property from a string representation of the given property, as best it can. referring to the names of the various enums in the static CMProps class. If the given property name does not exist, false is returned.

Parameters:
varName - the name of a property
value - the string value of that property
Returns:
true if it tried to set the property, false if it failed

getStr

public final java.lang.String getStr(CMProps.Str varNum)
Retrieve one of the pre-processed coffeemud.ini entries for this prop object

Parameters:
varNum - the Str enum of the entry to get
Returns:
the value of the property.

getIntVar

public static final int getIntVar(CMProps.Int varNum)
Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.

Parameters:
varNum - the Int enum of the entry to get
Returns:
the value of the property.

getMobHPBase

public static final int getMobHPBase()
Retrieve the base MOB hit point base

Returns:
the value of the base.

getIntVarAsDouble

public static final double getIntVarAsDouble(CMProps.Int varNum)
Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group. These are in variables permanently translated to floats for easy access

Parameters:
varNum - the Int enum of the entry to get
Returns:
the value of the property as a double.

getIntVarAsPct

public static final double getIntVarAsPct(CMProps.Int varNum)
Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group. These are in variables permanently translated from 0-100 to pct (0-1) for easy access

Parameters:
varNum - the Int enum of the entry to get
Returns:
the value of the property as a pct double.

getInt

public final int getInt(CMProps.Int varNum)
Retrieve one of the pre-processed coffeemud.ini entries for theis props object.

Parameters:
varNum - the Int enum of the entry to get
Returns:
the value of the property.

getListVar

public static final java.lang.String[] getListVar(CMProps.StrList varType)
Retrieve one of the pre-processed coffeemud.ini lists for the callers thread group.

Parameters:
varType - the StrList enum of the list to get
Returns:
the list from the properties.

getListFileVarSet

public static final java.util.Set<java.lang.String> getListFileVarSet(CMProps.ListFile varType)
Retrieve one of the pre-processed coffeemud.ini lists for the callers thread group, as a hashed set of values.

Parameters:
varType - the StrList enum of the set list to get
Returns:
the list set from the properties.

getBoolVar

public static final boolean getBoolVar(CMProps.Bool varNum)
Retrieve one of the pre-processed coffeemud.ini entries for the callers thread group.

Parameters:
varNum - the Bool enum of the entry to get
Returns:
the value of the property.

getBool

public final boolean getBool(CMProps.Bool varNum)
Retrieve one of the pre-processed coffeemud.ini entries for this prop object.

Parameters:
varNum - the Bool enum of the entry to get
Returns:
the value of the property.

setBoolVar

public static final void setBoolVar(CMProps.Bool varNum,
                                    boolean val)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group.

Parameters:
varNum - the Bool enum of the entry to set
val - the new value of the entry

setBoolAllVar

public static final void setBoolAllVar(CMProps.Bool varNum,
                                       boolean val)
Sets one of the pre-processed coffeemud.ini entries for all thread groups.

Parameters:
varNum - the Bool enum of the entries to set
val - the new value of the entries

setIntVar

public static final void setIntVar(CMProps.Int varNum,
                                   int val)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group.

Parameters:
varNum - the Int enum of the entry to set
val - the new value of the entry

setIntVar

public static final void setIntVar(CMProps.Int varNum,
                                   java.lang.String val)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group, only in this case, the entry needs to be converted to an int first.

Parameters:
varNum - the Int enum of the entry to set
val - the new value of the entry, as a string.

setIntVar

public static final void setIntVar(CMProps.Int varNum,
                                   java.lang.String val,
                                   int defaultValue)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group, only in this case, the entry needs to be converted to an int first, if it can. If it cannot, the defaultValue is used.

Parameters:
varNum - the Int enum of the entry to set
val - the new value of the entry, as a string.
defaultValue - the default value to use when the property doesn't exist

setListVar

public static final void setListVar(CMProps.StrList varType,
                                    java.lang.String[] var)
Sets one of the pre-processed coffeemud.ini list entries for the callers thread group.

Parameters:
varType - the StrList enum of the entry to set
var - the new value of the entry list

addListVar

public static final void addListVar(CMProps.StrList varType,
                                    java.lang.String var)
Add to the end of one of the pre-processed coffeemud.ini list entries for the callers thread group.

Parameters:
varType - the StrList enum of the entry to add to
var - the value to add to the entry list

setVar

public static final void setVar(CMProps.Str varNum,
                                java.lang.String val,
                                boolean upperFy)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group.

Parameters:
varNum - the Str enum of the entry to set
val - the new value of the entry
upperFy - true to make the value uppercase first, false otherwise

setVar

public static final void setVar(CMProps.Str varNum,
                                java.lang.String val)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group, forcing the value to uppercase.

Parameters:
varNum - the Str enum of the entry to set
val - the new value of the entry

setUpLowVar

public static final void setUpLowVar(CMProps.Str varNum,
                                     java.lang.String val)
Sets one of the pre-processed coffeemud.ini entries for the callers thread group, without making the value uppercase.

Parameters:
varNum - the Str enum of the entry to set
val - the new value of the entry

setUpAllLowVar

public static final void setUpAllLowVar(CMProps.Str varNum,
                                        java.lang.String val)
Sets one of the pre-processed coffeemud.ini entries for all thread groups.

Parameters:
varNum - the Str enum of the entries to set
val - the new value of the entries

setWhitelist

public static final void setWhitelist(CMProps props,
                                      CMProps.WhiteList listType,
                                      java.lang.String list)
Parses and sets one of the properties whitelist entries by parsing the given string by commands, and compiling them into Patterns.

Parameters:
props - the properties object to set the whitelist on
listType - the WhiteList type to set
list - the unparsed whitelist entries

setWhitelist

public static final void setWhitelist(CMProps.WhiteList listType,
                                      java.lang.String list)
Parses and sets one of the properties whitelist entries by parsing the given string by commands, and compiling them into Patterns, all for the callers thread group.

Parameters:
listType - the WhiteList type to set
list - the unparsed whitelist entries

isOnWhiteList

public static final boolean isOnWhiteList(CMProps props,
                                          CMProps.WhiteList listType,
                                          java.lang.String chk)
Retrurns true if the given chk string matches one of the entries in the given WhiteList type for the given properties object.

Parameters:
props - the properties to check the whitelist on
listType - the WhiteList type
chk - the string to search for
Returns:
true if the chk string is found, false otherwise

isOnWhiteList

public static final boolean isOnWhiteList(CMProps.WhiteList listType,
                                          java.lang.String chk)
Retrurns true if the given chk string matches one of the entries in the given WhiteList type for the callers thread group.

Parameters:
listType - the WhiteList type
chk - the string to search for
Returns:
true if the chk string is found, false otherwise

setUpCosts

public static final void setUpCosts(java.lang.String fieldName,
                                    java.util.Map<java.lang.String,ExpertiseLibrary.SkillCostDefinition> map,
                                    java.util.List<java.lang.String> fields)
Given the list of skill cost definitions, this method will parse out the ID and the data, build a cost definition object and store the cost definition in the given map.

Parameters:
fieldName - the name of the field being parsed, for error messages
map - the map to store the cost definitions in
fields - the pre-separated list of cost definitions to finish parsing

getNormalSkillGainCost

public static final ExpertiseLibrary.SkillCostDefinition getNormalSkillGainCost(java.lang.String id)
Returns the cost of gaining the given skill, by Ability id, for the callers thread group.

Parameters:
id - the Ability id to find a cost for
Returns:
the cost definition object for the given Ability.

getCommonSkillGainCost

public static final ExpertiseLibrary.SkillCostDefinition getCommonSkillGainCost(java.lang.String id)
Returns the cost of gaining the given common skill, by Ability id, for the callers thread group.

Parameters:
id - the common skill Ability id to find a cost for
Returns:
the cost definition object for the given common skill Ability.

getLangSkillGainCost

public static final ExpertiseLibrary.SkillCostDefinition getLangSkillGainCost(java.lang.String id)
Returns the cost of gaining the given language skill, by Ability id, for the callers thread group.

Parameters:
id - the language skill Ability id to find a cost for
Returns:
the cost definition object for the given language skill Ability.

getCountNewUserByIP

public static final int getCountNewUserByIP(java.lang.String address)
Returns the number of times the given ip address has created a new user in the callers thread group properties, within a given amount of time.

Parameters:
address - the address to look for.
Returns:
the number of new users created.

addNewUserByIP

public static final void addNewUserByIP(java.lang.String address)
Adds a new new user entry for the callers thread group, and the given address. These are tracked to make sure a given address doesn't create too many new users.

Parameters:
address - the address to register a new user for

getMinManaException

public static final int getMinManaException(java.lang.String skillID)
Returns the minimum amount of usage cost (mana) for the given ability ID(). All for the callers thread group. If no cost is found, returns MIN_VALUE.

Parameters:
skillID - the Ability ID to find a minimum cost for.
Returns:
the minimim cost of usage (mana) for the ability.

getMaxManaException

public static final int getMaxManaException(java.lang.String skillID)
Returns the maximum amount of usage cost (mana) for the given ability ID(). All for the callers thread group. If no cost is found, returns MIN_VALUE.

Parameters:
skillID - the Ability ID to find a maximum cost for.
Returns:
the maximum cost of usage (mana) for the ability.

getListFileFirstInt

public static final int getListFileFirstInt(CMProps.ListFile var)
Returns the first integer in the integer array from the lists.ini file of the given ListFile entry, for the callers thread group.

Parameters:
var - the ListFile entry to return the first integer from
Returns:
the first int in the given entry

getListFileStringList

public static final java.lang.String[] getListFileStringList(CMProps.ListFile var)
Returns the entire string list from the lists.ini file of the given ListFile entry, for the callers thread group.

Parameters:
var - the ListFile entry to return the string list from
Returns:
the string list from the lists.ini file

getListFileIntList

public static final int[] getListFileIntList(CMProps.ListFile var)
Returns the entire int list from the lists.ini file of the given ListFile entry, for the callers thread group.

Parameters:
var - the ListFile entry to return the int list from
Returns:
the int list from the lists.ini file

getListFileGrid

public static final java.lang.Object[][][] getListFileGrid(CMProps.ListFile var)
Returns the entire object grid from the lists.ini file of the given ListFile entry, for the callers thread group.

Parameters:
var - the ListFile entry to return the object grid from
Returns:
the object grid from the lists.ini file

getListFileChoiceFromIndexedList

public static final java.lang.String getListFileChoiceFromIndexedList(CMProps.ListFile varCode,
                                                                      int listIndex)
Given the specific lists.ini entry, grabs the indexed string list, and then returns a random string from that choices available at the given index in the string list.

Parameters:
varCode - the lists.ini string list entry
listIndex - the index into the string list, to determine which choices to use
Returns:
a random string from the indexed string list

getListFileChoiceFromIndexedListByHash

public static final java.lang.String getListFileChoiceFromIndexedListByHash(CMProps.ListFile varCode,
                                                                            int hash)
Given the specific lists.ini entry, grabs the indexed string list, and then returns a random string from that choices available at the hash index in the string list.

Parameters:
varCode - the lists.ini string list entry
hash - the hash to use to determine the index in the list to use.
Returns:
a random string from the indexed string list

getListFileIndexedListSize

public static final int getListFileIndexedListSize(CMProps.ListFile varCode)
Given the specific lists.ini entry, grabs the indexed string list, and it's size.

Parameters:
varCode - the lists.ini string list entry
Returns:
size of the indexed string list

getAnyListFileValue

public static final java.lang.String getAnyListFileValue(CMProps.ListFile varCode)
Given the specific lists.ini entry, grabs the indexed string list, returns a random string choice from a random index in the list.

Parameters:
varCode - the lists.ini string list entry
Returns:
the completely random choice

isPrivateToMe

public static boolean isPrivateToMe(java.lang.String s)
Returns true if the given property name is private to the callers thread group, and false if it is shared with the base thread group. If the caller is the base thread group, it always returns false.

Parameters:
s - the name of the coffeemud.ini file property
Returns:
true of false

getPrivateSubSet

public static java.util.Set<java.lang.String> getPrivateSubSet(java.lang.String mask)
Returns the set of properties that are private to the callers thread group. The base thread group always returns all of them.

Parameters:
mask - a regular expression mask to limit the set
Returns:
the set of private local properties

getPrivateOwner

public static java.lang.ThreadGroup getPrivateOwner(java.lang.String s)
Returns the first thread group available that privately owns the given property, excepting the base group.

Parameters:
s - the name of the property to look for
Returns:
the first thread group that privately owns the property

resetSystemVars

public final void resetSystemVars()
Reads this properties objects and sets ALL internal variables. Can be re-called if any properties are changed.


getPromptSuffix

public static byte[] getPromptSuffix()
Returns the array of bytes that must be sent after every prompt. Defined, in part, by PROMPTBEHAVIOR in coffeemud.ini file

Returns:
the array of bytes that must be sent after every prompt.

getLastResetTime

public static long getLastResetTime()
Returns the last time the properties for the callers thread group has been loaded.

Returns:
the time in ms when the callers properties were last parsed.

resetSecurityVars

public final void resetSecurityVars()
Reads this properties objects and sets security variables. Can be re-called if any properties are changed.


isAnyINIFiltered

public static boolean isAnyINIFiltered(java.lang.String msg)
Returns true if the given msg contains words which would be filtered out by any of the filters, for the callers thread group. Applicable filters are EMOTEFILTER, POSEFILTER, SAYFILTER, or CHANNELFILTER.

Parameters:
msg - the message to apply the filter to
Returns:
true if any filter would alter the string in any way

isINIFiltered

public static boolean isINIFiltered(java.lang.String msg,
                                    CMProps.Str whichFilter)
Returns true if the given msg contains words which would be filtered out by the given filter for the callers thread group.

Parameters:
msg - the message to apply the filter to
whichFilter - the filter to apply, such as EMOTEFILTER, POSEFILTER, SAYFILTER, or CHANNELFILTER
Returns:
true if the filter would alter the string in any way

applyINIFilter

public static java.lang.String applyINIFilter(java.lang.String msg,
                                              CMProps.Str whichFilter)
Alters the given message according to the given filter, by replacing any words found in the given filter with garbage characters.

Parameters:
msg - the message to apply the filter to
whichFilter - the filter to apply, such as EMOTEFILTER, POSEFILTER, SAYFILTER, or CHANNELFILTER
Returns:
the altered msg

isPublicClanGvtCategory

public static final boolean isPublicClanGvtCategory(java.lang.String clanCategory)
Returns true if, according to the callers properties, the given clan category makes it classified as a "Public Clan".

Parameters:
clanCategory - the category to check data for
Returns:
true if the category makes it a public category, false otherwise

getMaxClansThisCategory

public static final int getMaxClansThisCategory(java.lang.String clanCategory)
Returns maximum the maximum number of clans of this category a player can belong to according to the callers properties.

Parameters:
clanCategory - the category to check data for
Returns:
the maximum number of clans of this category a player can belong to

getTickMillis

public static final long getTickMillis()
Returns the amount of milliseconds per mud tick.

Returns:
the amount of milliseconds per mud tick.

tickMillis

public final long tickMillis()
Returns the amount of milliseconds per mud tick.

Returns:
the amount of milliseconds per mud tick.

getTickMillisD

public static final double getTickMillisD()
Returns the amount of milliseconds per mud tick, as a double.

Returns:
the amount of milliseconds per mud tick, as a double.

getMillisPerMudHour

public static final long getMillisPerMudHour()
Returns the number of real milliseconds that occur every in-game "hour"

Returns:
the number of real milliseconds that occur every in-game "hour"

getTicksPerMudHour

public static final long getTicksPerMudHour()
Returns the number of game ticks that occur every in-game "hour"

Returns:
the number of game ticks that occur every in-game "hour"

getTicksPerMinute

public static final long getTicksPerMinute()
Returns the number of game ticks that occur every real life minute

Returns:
the number of game ticks that occur every real life minute

getTicksPerHour

public static final long getTicksPerHour()
Returns the number of game ticks that occur every real life hour (60 min)

Returns:
the number of game ticks that occur every real life hour (60 min)

getTicksPerDay

public static final long getTicksPerDay()
Returns the number of game ticks that occur every real life day

Returns:
the number of game ticks that occur every real life day

isTheme

public static final boolean isTheme(int themeMask)
Returns true if the global mud theme includes the them given by the themeMask passed in.

Parameters:
themeMask - the theme mask to check for
Returns:
true if the given mask matches is included in muds preference, false otherwise.

loadEnumerablePage

public static final java.util.List<java.lang.String> loadEnumerablePage(java.lang.String iniFile)
Loads the given iniFile by mud path, combines any multi-line entries, and returns all the lines in the file in a list.

Parameters:
iniFile - the file to load
Returns:
the list of useful entries

getStatCodeExtensionValue

public static final java.lang.String getStatCodeExtensionValue(java.lang.String[] codes,
                                                               java.lang.String[] xtraValues,
                                                               java.lang.String code)
This method searches the given codes array for an entry matching the given code, and returns the value in xtraValues, or "" if not found.

Parameters:
codes - the code names to search
xtraValues - the values matching the codes, or null if unsupported
code - the code to search for
Returns:
the value from xtraValues, or ""

setStatCodeExtensionValue

public static void setStatCodeExtensionValue(java.lang.String[] codes,
                                             java.lang.String[] xtraValues,
                                             java.lang.String code,
                                             java.lang.String val)
This method searches the given codes array for an entry matching the given code, and set the value in xtraValues when found.

Parameters:
codes - the code names to search
xtraValues - the values matching the codes, or null if unsupported
code - the code to search for
val - the value to set the stat to

getExtraStatCodesHolder

public static final java.lang.String[] getExtraStatCodesHolder(CMObject O)
Checks the properties for any "extra" properties attached to an object of the given object type, and if found, constructs a string array to hold all of the extra values to go with the extra properties, and returns it. The object should save this array for its use.

Parameters:
O - the object to find extra properties for
Returns:
a string array to hold any extra values, or null if not applicable

getStatCodesList

public static final java.lang.String[] getStatCodesList(java.lang.String[] baseStatCodes,
                                                        CMObject O)
Checks the properties for any "extra" properties attached to an object of the given object type, and if found, constructs a string array to hold all of the object "base" stat codes, and the extra stat codes, and returns it. The object should save this array for its use.

Parameters:
baseStatCodes - the base set of stat codes that apply to this object
O - the object to find extra properties for
Returns:
a string array to hold all applicable stat codes, or just the base ones given if N/A