com.planet_ink.coffee_mud.Libraries
Class CMCatalog

java.lang.Object
  extended by com.planet_ink.coffee_mud.Libraries.StdLibrary
      extended by com.planet_ink.coffee_mud.Libraries.CMCatalog
All Implemented Interfaces:
CMObject, Tickable, CatalogLibrary, CMLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class CMCatalog
extends StdLibrary
implements CatalogLibrary


Nested Class Summary
protected static class CMCatalog.CataDataImpl
           
protected static class CMCatalog.RoomContentImpl
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CatalogLibrary
CatalogLibrary.CataData, CatalogLibrary.CatalogKind, CatalogLibrary.RoomContent
 
Field Summary
 CMFile.CMVFSDir catalogFileItemsRoot
           
 CMFile.CMVFSDir catalogFileMobsRoot
           
 DVector icatalog
           
 DVector mcatalog
           
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
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_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, 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_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
CMCatalog()
           
 
Method Summary
 boolean activate()
          Activates the library.
 void addCatalog(Physical PA)
          Creates a new catalog item or mob from the given item or mob in no catagory.
 void addCatalog(java.lang.String category, Physical PA)
          Creates a new catalog item or mob from the given item or mob in the given catagory.
protected  void addCatalogReplace(DVector DV, java.lang.String category, Physical P)
           
 void bumpDeathPickup(Physical P)
          When a cataloged mob dies, or a cataloged item is picked up, this method is called to bump the metadata stats on the object.
 void changeCatalogFlag(Physical P, boolean truefalse)
           
 void changeCatalogUsage(Physical P, boolean toCataloged)
          Adds or clears the catalog flag on the item or mob instance given to this method, and adds (or removes) it as an instance from the catadata for its prototype.
 java.lang.StringBuffer checkCatalogIntegrity(Physical P)
          Given an item or mob that might be in the catalog, this method confirms that fact.
 void delCatalog(Physical P)
          Completely removes the given item or mob from the catalog, deleting it from the database, and unsetting the cataloged flag from every instance in the world, though it does not save the items..
protected  void forceTick()
           
 CatalogLibrary.CataData getCatalogData(Physical P)
          Returns the cataloged metadata for the mob or item of the same type and with the same name as the given object.
 Item getCatalogItem(java.lang.String called)
          Returns the cataloged prototype item of the given name.
 CatalogLibrary.CataData getCatalogItemData(java.lang.String called)
          Returns the cataloged metadata for the item of the given name
 java.lang.String[] getCatalogItemNames()
          Creates a list of all the item keys (names) of all the items in the catalog, regardless of catagory.
 java.lang.String[] getCatalogItemNames(java.lang.String cataName)
          Creates a list of all the item keys (names) of all the items in the catalog in the given catagory.
 Item[] getCatalogItems()
          Creates a list of all the prototype catalog items.
protected  CMFile.CMVFSDir getCatalogItemsRoot(CMFile.CMVFSDir rootRoot)
           
 MOB getCatalogMob(java.lang.String called)
          Returns the cataloged prototype mob of the given name.
 CatalogLibrary.CataData getCatalogMobData(java.lang.String called)
          Returns the cataloged metadata for the mob of the given name
 java.lang.String[] getCatalogMobNames()
          Creates a list of all the mob keys (names) of all the mobs in the catalog, regardless of catagory.
 java.lang.String[] getCatalogMobNames(java.lang.String cataName)
          Creates a list of all the mob keys (names) of all the mobs in the catalog in the given catagory.
 MOB[] getCatalogMobs()
          Creates a list of all the prototype catalog mobs.
protected  CMFile.CMVFSDir getCatalogMobsRoot(CMFile.CMVFSDir rootRoot)
           
 Physical getCatalogObj(Physical P)
          Returns the cataloged prototype mob or item of the same type and with the same name as the given object.
protected  java.lang.Object getCatalogObject(DVector list, java.lang.String name, int dim)
           
 CMFile.CMVFSDir getCatalogRoot(CMFile.CMVFSDir root)
          In order to make the catalog appear in the vfs directory paths, this method is called to get the root directory of the catalog, which automatically turns all the catalog entries into directories and files.
protected  CMFile.CMVFSDir getCatalogRoot(DVector catalog, java.lang.String rootName, CMFile.CMVFSDir rootRoot)
           
 Item getDropItem(MOB M, boolean live)
          The catalog has the ability to provide random items from the catalog as either random equipment on a live mob, or a random drop from a dead one.
 java.lang.String[] getItemCatalogCatagories()
          Creates a list of all the catagories that items have been placed in.
 java.lang.String[] getMobCatalogCatagories()
          Creates a list of all the catagories that mobs have been placed in.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isCatalogObj(Environmental E)
          Returns whether there exists an item/mob in the catalog of the same type and name/key as the given item or mob.
 boolean isCatalogObj(java.lang.String name)
          Returns whether there exists an item or mob in the catalog of the given name/key.
 java.lang.String[] makeCatalogCatagories(DVector catalog)
           
 java.lang.String[] makeCatalogNames(java.lang.String catName, DVector catalog)
           
 void newInstance(Physical P)
          Registers the given cataloged item or mob as being an instance, for metadata collection purposes only.
protected  void propogateShopChange(ShopKeeper SK, java.util.Set<Physical> ignored, Physical cataP)
           
 java.util.Vector<CatalogLibrary.RoomContent> roomContent(Room R)
          Returns the coded contents of a room, as it presently exists.
 CatalogLibrary.CataData sampleCataData(java.lang.String xml)
          Builds catalog metadata, optionally building it from an xml doc of saved metadata.
 void setCategory(Physical P, java.lang.String category)
          Changes the catagory of the catalog item with the given physical objects name to the given catagory.
 boolean shutdown()
          Shuts down the library.
 void submitToCatalog(Physical P)
          If the given item or mob is not yet in the catalog prototype library, this method will mark it as uncataloged (as is correct for a prototype), and add it to the items or mobs list, depending on which is appropriate.
 void submitToCatalog(java.lang.String category, Physical P)
           
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 void updateCatalog(Physical modelP)
          When the properties of a cataloged item or mob change, this method is called to propagate those changes into the catalog prototype, and then to all the known instances of the cataloged item.
 void updateCatalogCategory(Physical modelP, java.lang.String newCat)
          Updates the catagory assigned to the given prototype mob or item to the given catagory.
 void updateCatalogIntegrity(Physical P)
          Confirms this mob or item instance against the catalog prototype.
 void updateRoomContent(java.lang.String roomID, java.util.List<CatalogLibrary.RoomContent> content)
          Updates the database entries of the given room id and the adjusted content objects.
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
getServiceClient, L, propertiesLoaded
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

icatalog

public DVector icatalog

mcatalog

public DVector mcatalog

catalogFileMobsRoot

public volatile CMFile.CMVFSDir catalogFileMobsRoot

catalogFileItemsRoot

public volatile CMFile.CMVFSDir catalogFileItemsRoot
Constructor Detail

CMCatalog

public CMCatalog()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdLibrary
Returns:
the name of this class

changeCatalogFlag

public void changeCatalogFlag(Physical P,
                              boolean truefalse)

getCatalogObject

protected java.lang.Object getCatalogObject(DVector list,
                                            java.lang.String name,
                                            int dim)

addCatalogReplace

protected void addCatalogReplace(DVector DV,
                                 java.lang.String category,
                                 Physical P)

makeCatalogNames

public java.lang.String[] makeCatalogNames(java.lang.String catName,
                                           DVector catalog)

makeCatalogCatagories

public java.lang.String[] makeCatalogCatagories(DVector catalog)

getCatalogItemNames

public java.lang.String[] getCatalogItemNames()
Description copied from interface: CatalogLibrary
Creates a list of all the item keys (names) of all the items in the catalog, regardless of catagory.

Specified by:
getCatalogItemNames in interface CatalogLibrary
Returns:
a list of all the item keys
See Also:
CatalogLibrary.getCatalogItemNames(String)

getCatalogItemNames

public java.lang.String[] getCatalogItemNames(java.lang.String cataName)
Description copied from interface: CatalogLibrary
Creates a list of all the item keys (names) of all the items in the catalog in the given catagory. Send null to get all items regardless of catagory

Specified by:
getCatalogItemNames in interface CatalogLibrary
Parameters:
cataName - the item catagory to filter by
Returns:
a list of all the item keys
See Also:
CatalogLibrary.getCatalogItemNames()

getCatalogMobNames

public java.lang.String[] getCatalogMobNames()
Description copied from interface: CatalogLibrary
Creates a list of all the mob keys (names) of all the mobs in the catalog, regardless of catagory.

Specified by:
getCatalogMobNames in interface CatalogLibrary
Returns:
a list of all the mob keys
See Also:
CatalogLibrary.getCatalogItemNames(), CatalogLibrary.getCatalogMobNames(String)

getCatalogMobNames

public java.lang.String[] getCatalogMobNames(java.lang.String cataName)
Description copied from interface: CatalogLibrary
Creates a list of all the mob keys (names) of all the mobs in the catalog in the given catagory. Send null to get all mobs regardless of catagory

Specified by:
getCatalogMobNames in interface CatalogLibrary
Parameters:
cataName - the mob catagory to filter by
Returns:
a list of all the mob keys
See Also:
CatalogLibrary.getCatalogMobNames()

getMobCatalogCatagories

public java.lang.String[] getMobCatalogCatagories()
Description copied from interface: CatalogLibrary
Creates a list of all the catagories that mobs have been placed in.

Specified by:
getMobCatalogCatagories in interface CatalogLibrary
Returns:
a list of all the catagories
See Also:
CatalogLibrary.getItemCatalogCatagories()

getItemCatalogCatagories

public java.lang.String[] getItemCatalogCatagories()
Description copied from interface: CatalogLibrary
Creates a list of all the catagories that items have been placed in.

Specified by:
getItemCatalogCatagories in interface CatalogLibrary
Returns:
a list of all the catagories
See Also:
CatalogLibrary.getMobCatalogCatagories()

getCatalogItems

public Item[] getCatalogItems()
Description copied from interface: CatalogLibrary
Creates a list of all the prototype catalog items.

Specified by:
getCatalogItems in interface CatalogLibrary
Returns:
a list of all the prototype catalog items.
See Also:
CatalogLibrary.getCatalogMobs()

getCatalogMobs

public MOB[] getCatalogMobs()
Description copied from interface: CatalogLibrary
Creates a list of all the prototype catalog mobs.

Specified by:
getCatalogMobs in interface CatalogLibrary
Returns:
a list of all the prototype catalog mobs.
See Also:
CatalogLibrary.getCatalogItems()

isCatalogObj

public boolean isCatalogObj(Environmental E)
Description copied from interface: CatalogLibrary
Returns whether there exists an item/mob in the catalog of the same type and name/key as the given item or mob.

Specified by:
isCatalogObj in interface CatalogLibrary
Parameters:
E - the item or mob
Returns:
true if it's in the catalog, false otherwise
See Also:
CatalogLibrary.isCatalogObj(String)

isCatalogObj

public boolean isCatalogObj(java.lang.String name)
Description copied from interface: CatalogLibrary
Returns whether there exists an item or mob in the catalog of the given name/key. Since the name could be item or mob, preference is given to mobs.

Specified by:
isCatalogObj in interface CatalogLibrary
Parameters:
name - the item or mob name
Returns:
true if it's in the catalog, false otherwise
See Also:
CatalogLibrary.isCatalogObj(Environmental)

getCatalogItem

public Item getCatalogItem(java.lang.String called)
Description copied from interface: CatalogLibrary
Returns the cataloged prototype item of the given name.

Specified by:
getCatalogItem in interface CatalogLibrary
Parameters:
called - the name to look for.
Returns:
the cataloged prototype item
See Also:
CatalogLibrary.getCatalogItem(String), CatalogLibrary.getCatalogObj(Physical)

getCatalogMob

public MOB getCatalogMob(java.lang.String called)
Description copied from interface: CatalogLibrary
Returns the cataloged prototype mob of the given name.

Specified by:
getCatalogMob in interface CatalogLibrary
Parameters:
called - the name to look for.
Returns:
the cataloged prototype mob
See Also:
CatalogLibrary.getCatalogMob(String), CatalogLibrary.getCatalogObj(Physical)

getCatalogItemData

public CatalogLibrary.CataData getCatalogItemData(java.lang.String called)
Description copied from interface: CatalogLibrary
Returns the cataloged metadata for the item of the given name

Specified by:
getCatalogItemData in interface CatalogLibrary
Parameters:
called - the name of the cataloged item.
Returns:
the cataloged metadata for the item
See Also:
CatalogLibrary.CataData, CatalogLibrary.getCatalogMobData(String), CatalogLibrary.getCatalogData(Physical)

getCatalogMobData

public CatalogLibrary.CataData getCatalogMobData(java.lang.String called)
Description copied from interface: CatalogLibrary
Returns the cataloged metadata for the mob of the given name

Specified by:
getCatalogMobData in interface CatalogLibrary
Parameters:
called - the name of the cataloged mob.
Returns:
the cataloged metadata for the mob
See Also:
CatalogLibrary.CataData, CatalogLibrary.getCatalogItemData(String), CatalogLibrary.getCatalogData(Physical)

roomContent

public java.util.Vector<CatalogLibrary.RoomContent> roomContent(Room R)
Description copied from interface: CatalogLibrary
Returns the coded contents of a room, as it presently exists. That's all the mobs and items, including all the shopkeeper shop items. This is used typically for catalogging.

Specified by:
roomContent in interface CatalogLibrary
Parameters:
R - the room to retrieve content from
Returns:
the list of items and mobs in the room
See Also:
CatalogLibrary.updateRoomContent(String, List), CatalogLibrary.RoomContent

updateRoomContent

public void updateRoomContent(java.lang.String roomID,
                              java.util.List<CatalogLibrary.RoomContent> content)
Description copied from interface: CatalogLibrary
Updates the database entries of the given room id and the adjusted content objects.

Specified by:
updateRoomContent in interface CatalogLibrary
Parameters:
roomID - the roomID of the room being updated
content - the adjusted content of the room
See Also:
CatalogLibrary.roomContent(Room), CatalogLibrary.RoomContent

addCatalog

public void addCatalog(Physical PA)
Description copied from interface: CatalogLibrary
Creates a new catalog item or mob from the given item or mob in no catagory. The given object is marked as cataloged and a copy if submitted to the database and memory.

Specified by:
addCatalog in interface CatalogLibrary
Parameters:
PA - the item or mob to create in the catalog
See Also:
CatalogLibrary.addCatalog(String, Physical), CatalogLibrary.delCatalog(Physical), CatalogLibrary.submitToCatalog(Physical), CatalogLibrary.updateCatalog(Physical)

addCatalog

public void addCatalog(java.lang.String category,
                       Physical PA)
Description copied from interface: CatalogLibrary
Creates a new catalog item or mob from the given item or mob in the given catagory. The given object is marked as cataloged and a copy if submitted to the database and memory.

Specified by:
addCatalog in interface CatalogLibrary
Parameters:
category - the new catagory, such as null
PA - the item or mob to create in the catalog
See Also:
CatalogLibrary.addCatalog(Physical), CatalogLibrary.delCatalog(Physical), CatalogLibrary.submitToCatalog(Physical)

submitToCatalog

public void submitToCatalog(Physical P)
Description copied from interface: CatalogLibrary
If the given item or mob is not yet in the catalog prototype library, this method will mark it as uncataloged (as is correct for a prototype), and add it to the items or mobs list, depending on which is appropriate. This method, unlike addCatalog, does not copy the item or add to the database.

Specified by:
submitToCatalog in interface CatalogLibrary
Parameters:
P - the item or mob to add to the catalog
See Also:
CatalogLibrary.addCatalog(Physical), CatalogLibrary.delCatalog(Physical), CatalogLibrary.addCatalog(String, Physical)

submitToCatalog

public void submitToCatalog(java.lang.String category,
                            Physical P)

delCatalog

public void delCatalog(Physical P)
Description copied from interface: CatalogLibrary
Completely removes the given item or mob from the catalog, deleting it from the database, and unsetting the cataloged flag from every instance in the world, though it does not save the items..

Specified by:
delCatalog in interface CatalogLibrary
Parameters:
P - the item or mob whose name and prototype are removed
See Also:
CatalogLibrary.addCatalog(Physical), CatalogLibrary.updateCatalog(Physical)

updateCatalogCategory

public void updateCatalogCategory(Physical modelP,
                                  java.lang.String newCat)
Description copied from interface: CatalogLibrary
Updates the catagory assigned to the given prototype mob or item to the given catagory. Catagories do not affect the requirement for a unique name/key for each mob or item. Unlike setCatagory, this method is totally synchronized and also clears the VFSDir cache.

Specified by:
updateCatalogCategory in interface CatalogLibrary
Parameters:
modelP - the prototype mob or item
newCat - the catagory to change it into, or null
See Also:
CatalogLibrary.setCategory(Physical, String)

updateCatalog

public void updateCatalog(Physical modelP)
Description copied from interface: CatalogLibrary
When the properties of a cataloged item or mob change, this method is called to propagate those changes into the catalog prototype, and then to all the known instances of the cataloged item. Therefore this is a potentially expensive call timewise.

Specified by:
updateCatalog in interface CatalogLibrary
Parameters:
modelP - the updated changed item or mob

newInstance

public void newInstance(Physical P)
Description copied from interface: CatalogLibrary
Registers the given cataloged item or mob as being an instance, for metadata collection purposes only.

Specified by:
newInstance in interface CatalogLibrary
Parameters:
P - the item or mob to register as being in the world

bumpDeathPickup

public void bumpDeathPickup(Physical P)
Description copied from interface: CatalogLibrary
When a cataloged mob dies, or a cataloged item is picked up, this method is called to bump the metadata stats on the object.

Specified by:
bumpDeathPickup in interface CatalogLibrary
Parameters:
P - the item or mob to bump the stats on

changeCatalogUsage

public void changeCatalogUsage(Physical P,
                               boolean toCataloged)
Description copied from interface: CatalogLibrary
Adds or clears the catalog flag on the item or mob instance given to this method, and adds (or removes) it as an instance from the catadata for its prototype.

Specified by:
changeCatalogUsage in interface CatalogLibrary
Parameters:
P - the item or mob to alter
toCataloged - true to flag it as cataloged, false to clear its flag.

propogateShopChange

protected void propogateShopChange(ShopKeeper SK,
                                   java.util.Set<Physical> ignored,
                                   Physical cataP)

getCatalogData

public CatalogLibrary.CataData getCatalogData(Physical P)
Description copied from interface: CatalogLibrary
Returns the cataloged metadata for the mob or item of the same type and with the same name as the given object.

Specified by:
getCatalogData in interface CatalogLibrary
Parameters:
P - the object type and name to look for
Returns:
the cataloged metadata for the mob
See Also:
CatalogLibrary.CataData, CatalogLibrary.getCatalogItemData(String), CatalogLibrary.getCatalogMobData(String)

getCatalogObj

public Physical getCatalogObj(Physical P)
Description copied from interface: CatalogLibrary
Returns the cataloged prototype mob or item of the same type and with the same name as the given object.

Specified by:
getCatalogObj in interface CatalogLibrary
Parameters:
P - the object type and name to look for
Returns:
the cataloged prototype mob or item
See Also:
CatalogLibrary.getCatalogMob(String), CatalogLibrary.getCatalogItem(String)

setCategory

public void setCategory(Physical P,
                        java.lang.String category)
Description copied from interface: CatalogLibrary
Changes the catagory of the catalog item with the given physical objects name to the given catagory. Unlike updateCatalogCatagory, this method is not synchronized and does not clear the VFSDir cache

Specified by:
setCategory in interface CatalogLibrary
Parameters:
P - the catalog item to get a key/name from
category - the new catagory, such as null
See Also:
CatalogLibrary.updateCatalogCategory(Physical, String)

updateCatalogIntegrity

public void updateCatalogIntegrity(Physical P)
Description copied from interface: CatalogLibrary
Confirms this mob or item instance against the catalog prototype. If it matches, it does nothing. If it doesn't, the given item or mob loses its catalog flagging.

Specified by:
updateCatalogIntegrity in interface CatalogLibrary
Parameters:
P - the item or mob to confirm against the catalog prototype

checkCatalogIntegrity

public java.lang.StringBuffer checkCatalogIntegrity(Physical P)
Description copied from interface: CatalogLibrary
Given an item or mob that might be in the catalog, this method confirms that fact. It returns null if all is well, and if there are differences between this object and the cataloged one, it returns a string list of the stats that differ.

Specified by:
checkCatalogIntegrity in interface CatalogLibrary
Parameters:
P - the item or mob to check
Returns:
null or the list of bad stats

getDropItem

public Item getDropItem(MOB M,
                        boolean live)
Description copied from interface: CatalogLibrary
The catalog has the ability to provide random items from the catalog as either random equipment on a live mob, or a random drop from a dead one. This method is called to generate just such an item from the available options.

Specified by:
getDropItem in interface CatalogLibrary
Parameters:
M - the mob to equip
live - true if its for a live mob, false if its for a corpse
Returns:
null or a random item

sampleCataData

public CatalogLibrary.CataData sampleCataData(java.lang.String xml)
Description copied from interface: CatalogLibrary
Builds catalog metadata, optionally building it from an xml doc of saved metadata.

Specified by:
sampleCataData in interface CatalogLibrary
Parameters:
xml - an optional xml doc of metadata data
Returns:
a catadata object
See Also:
CatalogLibrary.CataData

activate

public boolean activate()
Description copied from interface: CMLibrary
Activates the library. This is called after the mud is booted, but before connections are accepted.

Specified by:
activate in interface CMLibrary
Overrides:
activate in class StdLibrary
Returns:
true if activation was successful, false if you're screwed
See Also:
CMLibrary.shutdown()

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Overrides:
tick in class StdLibrary
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

shutdown

public boolean shutdown()
Description copied from interface: CMLibrary
Shuts down the library. Called at system shutdown time obviously, but is sometimes called just to reset the library.

Specified by:
shutdown in interface CMLibrary
Overrides:
shutdown in class StdLibrary
Returns:
true if shutdown was successful, false if there's nothing you can do about it
See Also:
CMLibrary.activate()

forceTick

protected void forceTick()

getCatalogMobsRoot

protected CMFile.CMVFSDir getCatalogMobsRoot(CMFile.CMVFSDir rootRoot)

getCatalogItemsRoot

protected CMFile.CMVFSDir getCatalogItemsRoot(CMFile.CMVFSDir rootRoot)

getCatalogRoot

public CMFile.CMVFSDir getCatalogRoot(CMFile.CMVFSDir root)
Description copied from interface: CatalogLibrary
In order to make the catalog appear in the vfs directory paths, this method is called to get the root directory of the catalog, which automatically turns all the catalog entries into directories and files.

Specified by:
getCatalogRoot in interface CatalogLibrary
Parameters:
root - the vfs dir of the resources directory
Returns:
the vfs dir of the catalog directory

getCatalogRoot

protected CMFile.CMVFSDir getCatalogRoot(DVector catalog,
                                         java.lang.String rootName,
                                         CMFile.CMVFSDir rootRoot)