|
|||||||||
| Version 1.5 | APIs subject to change! | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmultiverse.server.engine.EnginePlugin
multiverse.server.plugins.InventoryPlugin
multiverse.mars.plugins.MarsInventoryPlugin
public class MarsInventoryPlugin
| Nested Class Summary | |
|---|---|
protected class |
MarsInventoryPlugin.CreateInventoryHook
|
static class |
MarsInventoryPlugin.EquipMap
|
| Field Summary | |
|---|---|
static java.lang.String |
EQUIP_MAP_PROP
|
| Fields inherited from class multiverse.server.plugins.InventoryPlugin |
|---|
INVENTORY_PLUGIN_NAME, INVENTORY_PROP_BACKREF_KEY, INVENTORY_PROP_BAG_KEY, lock |
| Fields inherited from interface multiverse.msgsys.MessageCallback |
|---|
NO_FLAGS, RESPONSE_EXPECTED |
| Constructor Summary | |
|---|---|
MarsInventoryPlugin()
|
|
| Method Summary | |
|---|---|
protected boolean |
activateObject(java.lang.Long objOid,
java.lang.Long activatorOid,
java.lang.Long targetOid)
activates the object |
protected boolean |
addDC(java.lang.Long mobOid,
MarsItem item)
tell the world manager that we have added a submesh to this mob's display context |
protected boolean |
addItem(java.lang.Long mobOid,
java.lang.Long rootBagOid,
java.lang.Long itemOid)
adds the item to the container item must not be in a container already sets the item's containedBy backlink to the container |
protected boolean |
addItemHelper(java.lang.Long subBagOid,
int slotNum,
Entity item)
|
void |
completeTrade(TradeSession tradeSession)
|
protected boolean |
containsItem(java.lang.Long mobOid,
java.lang.Long itemOid)
returns whether or not the mob contains the given item |
java.lang.Long |
createInventory(java.lang.Long mobOid)
returns the bag oid, or null on failure |
EnginePlugin.SubObjData |
createInvSubObj(java.lang.Long mobOid,
Template template)
returns the bag, or null on failure |
protected EnginePlugin.SubObjData |
createItemSubObj(java.lang.Long masterOid,
Template template)
returns the bag, or null on failure |
protected void |
deleteInventory(Entity e)
Clean up when deleting an inventory sub object |
protected void |
deleteItem(Entity item)
Clean up when deleting an inventory item |
boolean |
equipItem(MVObject itemObj,
java.lang.Long activatorOid,
boolean replace)
equips item to primary slot parameter 'replace' indicates to replace an item occupying the slot. |
protected java.lang.Long |
findItem(java.lang.Long mobOid,
MarsEquipSlot slot)
|
protected java.lang.Long |
findItem(java.lang.Long mobOid,
java.lang.String template)
finds an item based on the template name |
protected boolean |
findItemHelper(java.lang.Long mobOid,
Bag rootBag,
java.lang.String template,
java.util.ArrayList<java.lang.Long> resultList)
|
protected java.util.ArrayList<java.lang.Long> |
findItems(java.lang.Long mobOid,
java.util.ArrayList<java.lang.String> templateList)
|
static Bag |
getBag(java.lang.Long oid)
|
protected DisplayContext |
getBaseDC(java.lang.Long mobOid)
|
MarsInventoryPlugin.EquipMap |
getEquipMap(java.lang.Long mobOid)
|
static MarsItem |
getMarsItem(java.lang.Long oid)
|
protected void |
loadInventory(Entity e)
performs setup required after loading an inventory sub object |
protected void |
loadItem(Entity e)
performs setup required after loading an inventory item |
protected boolean |
loadSubBag(java.lang.Long subBagOid,
Entity rootBag)
|
protected boolean |
lootAll(java.lang.Long looterOid,
java.lang.Long mobOid)
used to loot objects from a mob, or some other top level container object, such as a chest |
protected boolean |
lootAllHelper(java.lang.Long looterOid,
Bag looterRootBag,
java.lang.Long mobOid,
Bag mobRootBag,
Bag mobSubBag)
|
void |
onActivate()
for developers extending the EnginePlugin object, it may be easier to use the onActivate() method which gets called when the plugin is being activated by the Engine. |
static void |
registerBag(Bag bag)
|
static void |
registerMarsItem(MarsItem item)
|
protected boolean |
removeDC(java.lang.Long mobOid,
MarsItem item)
tell the world manager that we have added a submesh to this mob's display context |
protected java.lang.Long |
removeItem(java.lang.Long mobOid,
java.lang.Long itemOid)
|
protected java.lang.Long |
removeItem(java.lang.Long mobOid,
java.lang.String template)
|
protected boolean |
removeItemFromBag(java.lang.Long rootBagOid,
java.lang.Long itemOid)
removes item from the bag |
protected boolean |
removeItemFromBagHelper(java.lang.Long subBagOid,
Entity item)
|
protected java.util.ArrayList<java.lang.Long> |
removeItems(java.lang.Long mobOid,
java.util.ArrayList<java.lang.String> templateList)
|
protected void |
saveInventory(Entity e,
Namespace namespace)
performs work required after saving an inventory sub object |
protected void |
saveItem(Entity e,
Namespace namespace)
performs work required after saving an inventory item |
protected void |
sendInvUpdate(java.lang.Long mobOid)
sends an inventory update message to the client |
protected void |
sendInvUpdateHelper(InventoryClient.InvUpdateMessage msg,
int bagNum,
Bag subBag)
|
protected static void |
sendTradeComplete(java.lang.Long trader1,
java.lang.Long trader2,
byte status)
send a mv.TRADE_COMPLETE message to trader1, telling it that a trade with trader2 has completed |
static void |
sendTradeOfferUpdate(java.lang.Long trader1,
java.lang.Long trader2,
TradeSession tradeSession)
|
protected static java.util.LinkedList<java.util.LinkedList> |
sendTradeOfferUpdateHelper(java.lang.Long traderOid,
TradeSession tradeSession)
|
protected static void |
sendTradeStart(java.lang.Long trader1,
java.lang.Long trader2)
sends a mv.TRADE_START message to trader1 telling it that a trade has started with trader2 |
void |
setDirty(java.lang.Long mobOid)
|
boolean |
unequipItem(MVObject itemObj,
java.lang.Long mobOid)
unequips item |
protected void |
unloadInventory(Entity e)
Clean up when unloading an inventory sub object |
protected void |
unloadItem(Entity e)
Clean up when unloading an inventory item |
void |
updateObject(java.lang.Long mobOid,
java.lang.Long target)
creates inventory for object or loads from database |
boolean |
validateTradeOffer(java.lang.Long trader,
java.util.List<java.lang.Long> offer)
|
| Methods inherited from class multiverse.server.plugins.InventoryPlugin |
|---|
deleteInventory, deleteItem, destroyItem, getLock, registerHooks |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface multiverse.msgsys.MessageCallback |
|---|
handleMessage |
| Field Detail |
|---|
public static final java.lang.String EQUIP_MAP_PROP
| Constructor Detail |
|---|
public MarsInventoryPlugin()
| Method Detail |
|---|
public void onActivate()
EnginePlugin
onActivate in class InventoryPluginpublic static MarsItem getMarsItem(java.lang.Long oid)
public static void registerMarsItem(MarsItem item)
public static Bag getBag(java.lang.Long oid)
public static void registerBag(Bag bag)
protected void sendInvUpdate(java.lang.Long mobOid)
InventoryPlugin
sendInvUpdate in class InventoryPlugin
protected void sendInvUpdateHelper(InventoryClient.InvUpdateMessage msg,
int bagNum,
Bag subBag)
public java.lang.Long createInventory(java.lang.Long mobOid)
createInventory in class InventoryPlugin
public EnginePlugin.SubObjData createInvSubObj(java.lang.Long mobOid,
Template template)
createInvSubObj in class InventoryPlugin
protected static void sendTradeComplete(java.lang.Long trader1,
java.lang.Long trader2,
byte status)
protected static void sendTradeStart(java.lang.Long trader1,
java.lang.Long trader2)
public boolean validateTradeOffer(java.lang.Long trader,
java.util.List<java.lang.Long> offer)
public static void sendTradeOfferUpdate(java.lang.Long trader1,
java.lang.Long trader2,
TradeSession tradeSession)
protected static java.util.LinkedList<java.util.LinkedList> sendTradeOfferUpdateHelper(java.lang.Long traderOid,
TradeSession tradeSession)
public void completeTrade(TradeSession tradeSession)
protected EnginePlugin.SubObjData createItemSubObj(java.lang.Long masterOid,
Template template)
createItemSubObj in class InventoryPluginprotected void loadInventory(Entity e)
InventoryPlugin
loadInventory in class InventoryPlugin
protected boolean loadSubBag(java.lang.Long subBagOid,
Entity rootBag)
protected void unloadInventory(Entity e)
InventoryPlugin
unloadInventory in class InventoryPluginprotected void deleteInventory(Entity e)
InventoryPlugin
deleteInventory in class InventoryPluginprotected void loadItem(Entity e)
InventoryPlugin
loadItem in class InventoryPluginprotected void unloadItem(Entity e)
InventoryPlugin
unloadItem in class InventoryPluginprotected void deleteItem(Entity item)
InventoryPlugin
deleteItem in class InventoryPlugin
protected void saveInventory(Entity e,
Namespace namespace)
InventoryPlugin
saveInventory in class InventoryPlugin
protected void saveItem(Entity e,
Namespace namespace)
InventoryPlugin
saveItem in class InventoryPlugin
protected boolean addItem(java.lang.Long mobOid,
java.lang.Long rootBagOid,
java.lang.Long itemOid)
addItem in class InventoryPlugin
protected boolean addItemHelper(java.lang.Long subBagOid,
int slotNum,
Entity item)
protected boolean removeItemFromBag(java.lang.Long rootBagOid,
java.lang.Long itemOid)
InventoryPlugin
removeItemFromBag in class InventoryPlugin
protected boolean removeItemFromBagHelper(java.lang.Long subBagOid,
Entity item)
public void updateObject(java.lang.Long mobOid,
java.lang.Long target)
updateObject in class InventoryPlugin
protected boolean lootAll(java.lang.Long looterOid,
java.lang.Long mobOid)
lootAll in class InventoryPluginlooterOid - player/mob that is lootingmobOid - where you are looting from
protected boolean lootAllHelper(java.lang.Long looterOid,
Bag looterRootBag,
java.lang.Long mobOid,
Bag mobRootBag,
Bag mobSubBag)
protected boolean containsItem(java.lang.Long mobOid,
java.lang.Long itemOid)
containsItem in class InventoryPluginmobOid - the player/mob to check againstitemOid - the item you are checking against
protected java.lang.Long findItem(java.lang.Long mobOid,
java.lang.String template)
findItem in class InventoryPlugin
protected java.util.ArrayList<java.lang.Long> findItems(java.lang.Long mobOid,
java.util.ArrayList<java.lang.String> templateList)
findItems in class InventoryPlugin
protected boolean findItemHelper(java.lang.Long mobOid,
Bag rootBag,
java.lang.String template,
java.util.ArrayList<java.lang.Long> resultList)
protected java.lang.Long findItem(java.lang.Long mobOid,
MarsEquipSlot slot)
protected java.lang.Long removeItem(java.lang.Long mobOid,
java.lang.Long itemOid)
removeItem in class InventoryPlugin
protected java.lang.Long removeItem(java.lang.Long mobOid,
java.lang.String template)
removeItem in class InventoryPlugin
protected java.util.ArrayList<java.lang.Long> removeItems(java.lang.Long mobOid,
java.util.ArrayList<java.lang.String> templateList)
removeItems in class InventoryPlugin
protected boolean activateObject(java.lang.Long objOid,
java.lang.Long activatorOid,
java.lang.Long targetOid)
activateObject in class InventoryPlugin
public boolean equipItem(MVObject itemObj,
java.lang.Long activatorOid,
boolean replace)
equipItem in class InventoryPlugin
public boolean unequipItem(MVObject itemObj,
java.lang.Long mobOid)
protected boolean addDC(java.lang.Long mobOid,
MarsItem item)
protected boolean removeDC(java.lang.Long mobOid,
MarsItem item)
protected DisplayContext getBaseDC(java.lang.Long mobOid)
public MarsInventoryPlugin.EquipMap getEquipMap(java.lang.Long mobOid)
public void setDirty(java.lang.Long mobOid)
|
Copyright © 2008 The Multiverse Network, Inc. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||