Class MapleStorage
java.lang.Object
server.MapleStorage
- All Implemented Interfaces:
Serializable
角色倉庫(Storage)的記憶體模型與資料庫持久化。
倉庫以帳號(accountId)為單位,儲存跨角色共用的道具清單與楓幣,
並以 MapleInventoryType 分類快取於 typeItems。
主要職責:
- 靜態方法
create在首次開通時於資料庫建立記錄; loadStorage從資料庫讀取倉庫資料並以ItemLoader載入道具;saveStorage將變更(changed = true)寫回資料庫;sendStorage組裝並送出NPCPacket讓客戶端顯示倉庫 UI。
MapleCharacter 取得並操作。- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidarrange()voidclose()static intcreate(int id) findById(int itemId) getItems()intgetMeso()bytegetSlot(MapleInventoryType type, byte slot) intgetSlots()voidincreaseSlots(byte gain) booleanisFull()static MapleStorageloadStorage(int id) booleanremoveItemByInventoryItemId(long inventoryitemid) voidsaveToDB()voidvoidsendStorage(MapleClient c, int npcId) voidsendStored(MapleClient c, MapleInventoryType type) voidsendTakenOut(MapleClient c, MapleInventoryType type) voidsetMeso(int meso) voidsetSlots(byte set) voidtakeOut(byte slot) void
-
Method Details
-
create
- Throws:
SQLException
-
loadStorage
-
saveToDB
public void saveToDB() -
takeOut
-
store
-
arrange
public void arrange() -
getItems
-
getSlot
-
sendStorage
-
update
-
sendStored
-
sendTakenOut
-
getMeso
public int getMeso() -
findById
-
setMeso
public void setMeso(int meso) -
sendMeso
-
isFull
public boolean isFull() -
getSlots
public int getSlots() -
increaseSlots
public void increaseSlots(byte gain) -
setSlots
public void setSlots(byte set) -
close
public void close() -
removeItemByInventoryItemId
public boolean removeItemByInventoryItemId(long inventoryitemid)
-