com.planet_ink.coffee_mud.MOBS
Class StdPostman

java.lang.Object
  extended by com.planet_ink.coffee_mud.MOBS.StdMOB
      extended by com.planet_ink.coffee_mud.MOBS.StdShopKeeper
          extended by com.planet_ink.coffee_mud.MOBS.StdPostman
All Implemented Interfaces:
AbilityContainer, Affectable, Behavable, CMObject, Combatant, Contingent, DBIdentifiable, Economics, Environmental, FactionMember, Followable<MOB>, ItemCollection, ItemPossessor, Modifiable, MsgListener, MUDCmdProcessor, Physical, PhysicalAgent, Rider, ShopKeeper, StatsAffecting, Tattooable, Tickable, MOB, PostOffice, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenPostman

public class StdPostman
extends StdShopKeeper
implements PostOffice


Nested Class Summary
 
Nested classes/interfaces inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
StdMOB.ApplyAffectCharState<T extends StatsAffecting>, StdMOB.ApplyAffectCharStats<T extends StatsAffecting>, StdMOB.ApplyRecAffectPhyStats<T extends StatsAffecting>
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.PostOffice
PostOffice.MailPiece
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
ShopKeeper.ShopPrice
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
MOB.Attrib
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
 
Field Summary
protected  double feeForNewBox
           
protected  double holdFeePerPound
           
protected  int maxMudMonthsHeld
           
protected  double minimumPostage
           
protected  double postagePerPound
           
protected static java.util.Map<java.lang.String,java.lang.Long> postalTimes
           
 
Fields inherited from class com.planet_ink.coffee_mud.MOBS.StdShopKeeper
budget, budgetMax, budgetRemaining, budgetTickDown, devalueRate, invResetRate, invResetTickDown, itemZapperMask, pricingAdjustments, shop, whatIsSoldMask
 
Fields inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
abilitys, abilityUseCache, abilityUseTrig, affectCharState, affectCharStats, affectPhyStats, affects, ageMinutes, amDead, amDestroyed, amFollowing, atRange, attributesBitmap, baseCharStats, basePhyStats, baseState, behaviors, cachedImageName, charStats, clanAffects, clans, CODES, commandQue, curState, databaseID, description, displayText, experience, expertises, factions, followers, inventory, kickFlag, lastLocation, liegeID, location, maxState, me, miscText, money, moneyVariation, mySession, peaceTime, phyStats, playerStats, possHeldItem, possStartRoom, possWieldedItem, practices, questPoint, racialAffects, rawImageName, recoverAffectP, recoverTickCter, removeFromGame, riding, scripts, soulMate, tattoos, tickAgeCounter, tickStatus, trains, username, victim, wimpHitPoint, worshipCharID, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.ShopKeeper
DEAL_ALCHEMIST, DEAL_ANYTECHNOLOGY, DEAL_ANYTHING, DEAL_ARMOR, DEAL_AUCTIONEER, DEAL_BANKER, DEAL_BOOKS, DEAL_BUTCHER, DEAL_CASTER, DEAL_CLANBANKER, DEAL_CLANDSELLER, DEAL_CLANPOSTMAN, DEAL_CONFLICTS, DEAL_CSHIPSELLER, DEAL_DESCS, DEAL_FOODSELLER, DEAL_GENERAL, DEAL_GROWER, DEAL_HIDESELLER, DEAL_INNKEEPER, DEAL_INSTRUMENTS, DEAL_INVENTORYONLY, DEAL_JEWELLER, DEAL_LANDSELLER, DEAL_LEATHER, DEAL_LUMBERER, DEAL_MAGIC, DEAL_METALSMITH, DEAL_PETS, DEAL_POSTMAN, DEAL_READABLES, DEAL_SHIPSELLER, DEAL_SLAVES, DEAL_STONEYARDER, DEAL_TRAINER, DEAL_WEAPONS
 
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
 
Fields inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
AGE_MILLIS_THRESHOLD, END_SHEATH_TIME, START_SHEATH_TIME
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.MUDCmdProcessor
METAFLAG_AS, METAFLAG_ASMESSAGE, METAFLAG_FORCED, METAFLAG_INORDER, METAFLAG_MPFORCED, METAFLAG_ORDER, METAFLAG_POSSESSED, METAFLAG_SNOOPED
 
Constructor Summary
StdPostman()
           
 
Method Summary
 void addSoldType(int mask)
          Adds the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper to the existing shopkeeper mask.
 void addToBox(java.lang.String mob, Item thisThang, java.lang.String from, java.lang.String to, long holdTime, double COD)
          Low level method to add an item directly to a postal box.
 void autoGive(MOB src, MOB tgt, Item I)
           
 void createBoxHere(java.lang.String boxName, java.lang.String forward)
          Creates a new post office box for the given player or clan name, with the given forwarding address.
 void deleteBoxHere(java.lang.String boxName)
          Removes the given post office box for the given player or clan name.
 boolean delFromBox(java.lang.String boxName, Item thisThang)
          Low level method to remove an item from a postal box
 void emptyBox(java.lang.String boxName)
          Removes all items from the given post office box
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 double feeForNewBox()
          Gets the fee to open a new postal box at this branch.
 Item findBoxContents(java.lang.String boxName, java.lang.String likeThis)
          Searches the given postal box for an item with the given name, or one with the given string as a substring.
 PostOffice.MailPiece findExactBoxData(java.lang.String boxName, Item likeThis)
           
 java.lang.String findProperBranch(java.lang.String toWhom)
          Returns the proper branch of this postal chain to which to deliver packages belonging to the given mob or clan name.
 java.util.Vector<DatabaseEngine.PlayerData> getAllLocalBoxPD(java.lang.String boxName)
           
 java.util.List<DatabaseEngine.PlayerData> getBoxRowPDData(java.lang.String mob)
           
protected  java.lang.String getBranchPostableTo(java.lang.String toWhom, java.lang.String branch, java.util.Map<java.lang.String,java.lang.String> allBranchBoxes)
           
protected  int getChargeableWeight(Item I)
           
protected  double getCODChargeForPiece(PostOffice.MailPiece data)
           
protected  double getHoldingCost(PostOffice.MailPiece data, int chargeableWeight)
           
 java.util.Map<java.lang.String,java.lang.String> getOurOpenBoxes(java.lang.String boxName)
          Returns a mapping of postal branches in this chain to forwarding addresses, for the given postal box.
 java.lang.String getSenderName(MOB mob, Clan.Function func, boolean checked)
          When the given mob tries to send or withdraw a package, this method is called to get the proper FROM address, which is either the mob themselves or their clan, if they are (optionally) permitted by their rank.
protected  double getSimplePostage(int chargeableWeight)
           
 double holdFeePerPound()
          Gets the fee charged per pound per mud month to hold a package in a postal box at this branch.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
protected  Item makeItem(PostOffice.MailPiece data)
           
 int maxMudMonthsHeld()
          Returns the maximum number of mud-months that a package will be held before it gets put on sale at this branch.
 double minimumPostage()
          Gets the minimum postage to send a package from this branch.
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 PostOffice.MailPiece parsePostalItemData(java.lang.String data)
          Parses an postal package entry, which is formatted as item xml preceded by various semicolon-delimited numbers and data.
 double postagePerPound()
          Gets the postage charged per pound after the first, to send packages from this branch.
 java.lang.String postalBranch()
          Returns the branch of the postal chain that this specific postoffice employee belongs to.
 java.lang.String postalChain()
          Returns the postal chain, a string shared by all post offices that deal with the same postal boxes and customers, able to send mail to each other.
 long postalWaitTime()
           
 void setFeeForNewBox(double d)
          Sets the fee to open a new postal box at this branch.
 void setHoldFeePerPound(double d)
          Sets the fee charged per pound per mud month to hold a package in a postal box at this branch.
 void setMaxMudMonthsHeld(int months)
          Sets the maximum number of mud-months that a package will be held before it gets put on sale at this branch.
 void setMinimumPostage(double d)
          Sets the minimum postage to send a package from this branch.
 void setPostagePerPound(double d)
          Sets the postage charged per pound after the first, to send packages from this branch.
 void setPostalChain(java.lang.String name)
          Sets the postal chain, a string shared by all post offices that deal with the same postal boxes and customers, able to send mail to each other.
 void setWhatIsSoldMask(long newSellCode)
          Sets the encoded ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 
Methods inherited from class com.planet_ink.coffee_mud.MOBS.StdShopKeeper
budget, cloneFix, destroy, devalueRate, doInventoryReset, doISellThis, finalBudget, finalDevalueRate, finalIgnoreMask, finalInvResetRate, finalItemPricingAdjustments, finalPrejudiceFactors, getShop, getStartArea, getWhatIsSoldMask, getWhatIsSoldZappermask, ignoreMask, invResetRate, isSold, itemPricingAdjustments, prejudiceFactors, setBudget, setDevalueRate, setIgnoreMask, setInvResetRate, setItemPricingAdjustments, setPrejudiceFactors, setWhatIsSoldZappermask, storeKeeperString
 
Methods inherited from class com.planet_ink.coffee_mud.MOBS.StdMOB
abilities, actions, addAbility, addBehavior, addEffect, addExpertise, addFaction, addFollower, addItem, addItem, addNonUninvokableEffect, addPriorityEffect, addScript, addTattoo, addTattoo, addTattoo, adjustFaction, affectCharState, affectCharStats, affectPhyStats, allAbilities, amActive, amDead, amDestroyed, amFollowing, amUltimatelyFollowing, baseCharStats, basePhyStats, baseState, baseWeight, behaviors, bringToLife, bringToLife, calculateActionCost, canSaveDatabaseID, charStats, clanEffects, clans, clearCommandQueue, commandQueSize, compareTo, confirmLocation, copyFactions, copyOf, curState, databaseID, delAbility, delAllAbilities, delAllBehaviors, delAllEffects, delAllExpertises, delAllItems, delAllScripts, delBehavior, delEffect, delExpertise, delFollower, delItem, delScript, delTattoo, delTattoo, dequeCommand, description, description, displayText, displayText, dispossess, doCommand, doCommand, eachBehavior, eachEffect, eachItem, eachScript, effects, enqueCommand, enqueCommands, expertises, expirationDate, factions, fetchAbility, fetchAbility, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchExpertise, fetchFaction, fetchFactionData, fetchFactionRanges, fetchFirstWornItem, fetchFollower, fetchFollower, fetchFollowerOrder, fetchFromInventory, fetchHeldItem, fetchItem, fetchRandomAbility, fetchScript, fetchWieldedItem, fetchWornItems, findAbility, findItem, findItem, findItems, findItems, findTattoo, findTattooStartsWith, fixChannelColors, flagVariableEq, followers, freeWearPositions, genericName, getAbilityUsageCache, getAgeMinutes, getAttributesBitmap, getClanRole, getCodeNum, getCombatant, getDirectionToTarget, getExperience, getExpNeededDelevel, getExpNeededLevel, getExpNextLevel, getExpPrevLevel, getFactionListing, getGroupMembers, getGroupMembersAndRideables, getItem, getLiegeID, getMoney, getMoneyVariation, getMyDeity, getNaturalWeapon, getPeaceTime, getPractices, getQuestPoint, getRandomItem, getRideBuddies, getSaveStatIndex, getStartRoom, getStat, getStatCodes, getTickStatus, getTrains, getVictim, getWearPositions, getWimpHitPoint, getWorshipCharID, hasFaction, hasOnlyGoldInInventory, healthText, image, initializeClass, isAttributeSet, isContent, isEitherOfUsDead, isFollowedBy, isGeneric, isInCombat, isMarriedToLiege, isMine, isMonster, isPermissableToFight, isPlayer, isPossessing, isRacialAbility, isSavable, isStat, items, killMeDead, L, lastTickedDateTime, location, makePeace, maxCarry, maxFollowers, maxItems, maxRange, maxState, mayIFight, mayPhysicallyAttack, minRange, miscTextFormat, moveItemTo, moveItemTo, name, Name, name, newInstance, numAbilities, numAllAbilities, numAllEffects, numBehaviors, numEffects, numFollowers, numItems, numScripts, personalEffects, phyStats, playerStats, prequeCommand, prequeCommands, racialEffects, rangeToTarget, rawImage, recoverCharStats, recoverMaxState, recoverPhyStats, removeFaction, removeFromGame, resetToMaxState, riding, sameAs, scripts, session, setActions, setAgeMinutes, setAttribute, setAttributesBitmap, setBaseCharStats, setBasePhyStats, setBaseState, setClan, setCombatant, setDatabaseID, setDescription, setDisplayText, setExperience, setExpirationDate, setFollowing, setImage, setLiegeID, setLocation, setMiscText, setMoney, setMoneyVariation, setName, setPlayerStats, setPractices, setQuestPoint, setRangeToTarget, setRiding, setSavable, setSession, setSoulMate, setStartRoom, setStat, setTrains, setVictim, setWimpHitPoint, setWorshipCharID, soulMate, tattoos, tell, tell, text, titledName, totalFollowers, willFollowOrdersOf
 
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.core.interfaces.ShopKeeper
doISellThis, getShop, getWhatIsSoldMask, getWhatIsSoldZappermask, isSold, setWhatIsSoldZappermask, storeKeeperString
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Economics
budget, devalueRate, finalBudget, finalDevalueRate, finalIgnoreMask, finalInvResetRate, finalItemPricingAdjustments, finalPrejudiceFactors, ignoreMask, invResetRate, itemPricingAdjustments, prejudiceFactors, setBudget, setDevalueRate, setIgnoreMask, setInvResetRate, setItemPricingAdjustments, setPrejudiceFactors
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, L, maxRange, minRange, miscTextFormat, Name, rawImage, sameAs, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Contingent
amDestroyed, destroy, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 

Field Detail

minimumPostage

protected double minimumPostage

postagePerPound

protected double postagePerPound

holdFeePerPound

protected double holdFeePerPound

feeForNewBox

protected double feeForNewBox

maxMudMonthsHeld

protected int maxMudMonthsHeld

postalTimes

protected static java.util.Map<java.lang.String,java.lang.Long> postalTimes
Constructor Detail

StdPostman

public StdPostman()
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 StdShopKeeper
Returns:
the name of this class

minimumPostage

public double minimumPostage()
Description copied from interface: PostOffice
Gets the minimum postage to send a package from this branch.

Specified by:
minimumPostage in interface PostOffice
Returns:
the minimum postage to send a package from this branch.
See Also:
PostOffice.setMinimumPostage(double)

setMinimumPostage

public void setMinimumPostage(double d)
Description copied from interface: PostOffice
Sets the minimum postage to send a package from this branch.

Specified by:
setMinimumPostage in interface PostOffice
Parameters:
d - the minimum postage to send a package from this branch.
See Also:
PostOffice.minimumPostage()

postagePerPound

public double postagePerPound()
Description copied from interface: PostOffice
Gets the postage charged per pound after the first, to send packages from this branch.

Specified by:
postagePerPound in interface PostOffice
Returns:
the postage charged per pound after the first
See Also:
PostOffice.setPostagePerPound(double)

setPostagePerPound

public void setPostagePerPound(double d)
Description copied from interface: PostOffice
Sets the postage charged per pound after the first, to send packages from this branch.

Specified by:
setPostagePerPound in interface PostOffice
Parameters:
d - the postage charged per pound after the first
See Also:
PostOffice.postagePerPound()

holdFeePerPound

public double holdFeePerPound()
Description copied from interface: PostOffice
Gets the fee charged per pound per mud month to hold a package in a postal box at this branch.

Specified by:
holdFeePerPound in interface PostOffice
Returns:
the fee charged per pound per mud month
See Also:
PostOffice.setHoldFeePerPound(double)

setHoldFeePerPound

public void setHoldFeePerPound(double d)
Description copied from interface: PostOffice
Sets the fee charged per pound per mud month to hold a package in a postal box at this branch.

Specified by:
setHoldFeePerPound in interface PostOffice
Parameters:
d - the fee charged per pound per mud month
See Also:
PostOffice.holdFeePerPound()

feeForNewBox

public double feeForNewBox()
Description copied from interface: PostOffice
Gets the fee to open a new postal box at this branch.

Specified by:
feeForNewBox in interface PostOffice
Returns:
the fee to open a new postal box at this branch.
See Also:
PostOffice.setFeeForNewBox(double)

setFeeForNewBox

public void setFeeForNewBox(double d)
Description copied from interface: PostOffice
Sets the fee to open a new postal box at this branch.

Specified by:
setFeeForNewBox in interface PostOffice
Parameters:
d - the fee to open a new postal box at this branch.
See Also:
PostOffice.feeForNewBox()

maxMudMonthsHeld

public int maxMudMonthsHeld()
Description copied from interface: PostOffice
Returns the maximum number of mud-months that a package will be held before it gets put on sale at this branch.

Specified by:
maxMudMonthsHeld in interface PostOffice
Returns:
the maximum number of mud-months to hold
See Also:
PostOffice.setMaxMudMonthsHeld(int)

setMaxMudMonthsHeld

public void setMaxMudMonthsHeld(int months)
Description copied from interface: PostOffice
Sets the maximum number of mud-months that a package will be held before it gets put on sale at this branch.

Specified by:
setMaxMudMonthsHeld in interface PostOffice
Parameters:
months - the maximum number of mud-months to hold
See Also:
PostOffice.setMaxMudMonthsHeld(int)

addSoldType

public void addSoldType(int mask)
Description copied from interface: ShopKeeper
Adds the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper to the existing shopkeeper mask. A value of 0 will clear the whole mask.

Specified by:
addSoldType in interface ShopKeeper
Overrides:
addSoldType in class StdShopKeeper
Parameters:
mask - the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
See Also:
ShopKeeper.DEAL_DESCS, ShopKeeper.isSold(int)

setWhatIsSoldMask

public void setWhatIsSoldMask(long newSellCode)
Description copied from interface: ShopKeeper
Sets the encoded ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper

Specified by:
setWhatIsSoldMask in interface ShopKeeper
Overrides:
setWhatIsSoldMask in class StdShopKeeper
Parameters:
newSellCode - the dealer type constants to the 2nd power, shifted 8 bits left
See Also:
ShopKeeper.DEAL_DESCS, ShopKeeper.addSoldType(int)

postalChain

public java.lang.String postalChain()
Description copied from interface: PostOffice
Returns the postal chain, a string shared by all post offices that deal with the same postal boxes and customers, able to send mail to each other.

Specified by:
postalChain in interface PostOffice
Returns:
the name of the postal chain
See Also:
PostOffice.setPostalChain(String)

setPostalChain

public void setPostalChain(java.lang.String name)
Description copied from interface: PostOffice
Sets the postal chain, a string shared by all post offices that deal with the same postal boxes and customers, able to send mail to each other.

Specified by:
setPostalChain in interface PostOffice
Parameters:
name - the name of the postal chain
See Also:
PostOffice.postalChain()

postalBranch

public java.lang.String postalBranch()
Description copied from interface: PostOffice
Returns the branch of the postal chain that this specific postoffice employee belongs to. Typically the extended room id, this is a unique identifier for this branch of the postal chain. Each PostOffice should be unique!

Specified by:
postalBranch in interface PostOffice
Returns:
the branch of the postal chain
See Also:
PostOffice.findProperBranch(String)

getSenderName

public java.lang.String getSenderName(MOB mob,
                                      Clan.Function func,
                                      boolean checked)
Description copied from interface: PostOffice
When the given mob tries to send or withdraw a package, this method is called to get the proper FROM address, which is either the mob themselves or their clan, if they are (optionally) permitted by their rank. If checked is true, and the mob does NOT have clan privileges, then an error message is given to the mob and null is returned.

Specified by:
getSenderName in interface PostOffice
Parameters:
mob - the mob who is trying to send the package
func - either Clan.Function.WITHDRAW or Clan.FUNCTION.DEPOSIT
checked - true if the mob must have clan privileges, false if not.
Returns:
the mobs name, their clan name, or null
See Also:
Clan.Function

addToBox

public void addToBox(java.lang.String mob,
                     Item thisThang,
                     java.lang.String from,
                     java.lang.String to,
                     long holdTime,
                     double COD)
Description copied from interface: PostOffice
Low level method to add an item directly to a postal box.

Specified by:
addToBox in interface PostOffice
Parameters:
mob - the box name, such as a player or clan name
thisThang - the item to add to the postal box
from - player or clan the item is from
to - player or clan the item is to
holdTime - when the package was sent, real time, in milliseconds
COD - the amount of money which must be paid to withdraw the item
See Also:
PostOffice.delFromBox(String, Item), PostOffice.emptyBox(String)

delFromBox

public boolean delFromBox(java.lang.String boxName,
                          Item thisThang)
Description copied from interface: PostOffice
Low level method to remove an item from a postal box

Specified by:
delFromBox in interface PostOffice
Parameters:
boxName - the box name, such as a player or clan name
thisThang - the item to remove from the postal box
Returns:
true if the item was removed, or false otherwise
See Also:
PostOffice.addToBox(String, Item, String, String, long, double), PostOffice.emptyBox(String)

emptyBox

public void emptyBox(java.lang.String boxName)
Description copied from interface: PostOffice
Removes all items from the given post office box

Specified by:
emptyBox in interface PostOffice
Parameters:
boxName - the box name, such as a player or clan name
See Also:
PostOffice.addToBox(String, Item, String, String, long, double), PostOffice.delFromBox(String, Item)

getOurOpenBoxes

public java.util.Map<java.lang.String,java.lang.String> getOurOpenBoxes(java.lang.String boxName)
Description copied from interface: PostOffice
Returns a mapping of postal branches in this chain to forwarding addresses, for the given postal box.

Specified by:
getOurOpenBoxes in interface PostOffice
Parameters:
boxName - the player or clan name of the box
Returns:
a mapping of postal branches to forwarding addresses.
See Also:
PostOffice.deleteBoxHere(String), PostOffice.createBoxHere(String, String)

createBoxHere

public void createBoxHere(java.lang.String boxName,
                          java.lang.String forward)
Description copied from interface: PostOffice
Creates a new post office box for the given player or clan name, with the given forwarding address.

Specified by:
createBoxHere in interface PostOffice
Parameters:
boxName - the player or clan name of the new box
forward - the player or clan name of the forwarding
See Also:
PostOffice.deleteBoxHere(String), PostOffice.getOurOpenBoxes(String)

deleteBoxHere

public void deleteBoxHere(java.lang.String boxName)
Description copied from interface: PostOffice
Removes the given post office box for the given player or clan name.

Specified by:
deleteBoxHere in interface PostOffice
Parameters:
boxName - the player or clan name of the new box
See Also:
PostOffice.createBoxHere(String, String), PostOffice.getOurOpenBoxes(String)

getAllLocalBoxPD

public java.util.Vector<DatabaseEngine.PlayerData> getAllLocalBoxPD(java.lang.String boxName)

getBoxRowPDData

public java.util.List<DatabaseEngine.PlayerData> getBoxRowPDData(java.lang.String mob)

findBoxContents

public Item findBoxContents(java.lang.String boxName,
                            java.lang.String likeThis)
Description copied from interface: PostOffice
Searches the given postal box for an item with the given name, or one with the given string as a substring.

Specified by:
findBoxContents in interface PostOffice
Parameters:
boxName - the player or clan name of the postal box
likeThis - the search string for the item name
Returns:
the item found, or null

findExactBoxData

public PostOffice.MailPiece findExactBoxData(java.lang.String boxName,
                                             Item likeThis)

parsePostalItemData

public PostOffice.MailPiece parsePostalItemData(java.lang.String data)
Description copied from interface: PostOffice
Parses an postal package entry, which is formatted as item xml preceded by various semicolon-delimited numbers and data.

Specified by:
parsePostalItemData in interface PostOffice
Parameters:
data - the postal package formatted string
Returns:
the MailPiece object
See Also:
PostOffice.MailPiece

makeItem

protected Item makeItem(PostOffice.MailPiece data)

getChargeableWeight

protected int getChargeableWeight(Item I)

getSimplePostage

protected double getSimplePostage(int chargeableWeight)

getHoldingCost

protected double getHoldingCost(PostOffice.MailPiece data,
                                int chargeableWeight)

getCODChargeForPiece

protected double getCODChargeForPiece(PostOffice.MailPiece data)

getBranchPostableTo

protected java.lang.String getBranchPostableTo(java.lang.String toWhom,
                                               java.lang.String branch,
                                               java.util.Map<java.lang.String,java.lang.String> allBranchBoxes)

findProperBranch

public java.lang.String findProperBranch(java.lang.String toWhom)
Description copied from interface: PostOffice
Returns the proper branch of this postal chain to which to deliver packages belonging to the given mob or clan name.

Specified by:
findProperBranch in interface PostOffice
Parameters:
toWhom - the player or clan name receiving the package
Returns:
the best branch in this postal chain to deliver to
See Also:
PostOffice.postalBranch()

postalWaitTime

public long postalWaitTime()

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 StdShopKeeper
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

autoGive

public void autoGive(MOB src,
                     MOB tgt,
                     Item I)

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdShopKeeper
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Overrides:
okMessage in class StdShopKeeper
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()