-
-
Notifications
You must be signed in to change notification settings - Fork 8
Data Specification
LibItemCache establishes a few data types that are central to the library's functionality - identifiers for entities and containers, and data structures for function returns. This page describes all of them.
When designing LibItemCache, a major goal was to make owners easily identifiable with a single variable, while making sure that variable is human readable.
As such, owners are identified with ID strings, which are composed by the conjugation of their name and the realm they reside on. For example, the character Lazypants from Shattered Halls would be identified as 'Lazypants - Shattered Halls'
. Yet, nothing prevents a guild from having the same name as a character on the same realm. As such, guilds are identified by a registered trademark symbol before their name. For example, guild Noobs from that same server would be identified as '® Noobs - Shattered Halls'
.
If the realm portion of the ID is omitted, the library assumes you meant the current realm the player is logged on.
The bagID identifies a single item container that contains multiple item slots. The possible values for bagID change depending on the owner type. For a guild, the only possibility is:
-
1
to5
for the guild bank tabs
Meanwhile, for a character, the current possibilities are:
-
-2
for the reagent bank -
-1
for the main bank bag -
0
for the backpack -
1
to4
for the bags on the character -
5
to11
for the custom bank bags -
'equip'
for the character's equipment -
'vault'
for the void storage
All the function part of the query API return information in the form of tables. Not only this makes code more readable, due to the large amount of variables being returned, it also makes it possible for caches to add their own fields to the data, if they have additional information we did not think of including.
Field | Type | Description |
---|---|---|
id | number | The item's ID number. |
link | string | A hyperlink for the item |
icon | string | Path to an icon texture for the item. |
quality | number | Quality (rarity) level of the item. |
count | number | Current stack size for the item. |
locked | boolean | Whether the item is currently locked from being moved. |
recent | boolean | Whether the item has recently been stored (void storage only). |
filtered | boolean | Whether the item is filtered out using the Blizzard item filtering system. |
readable | boolean | Whether the item can be read. |
lootable | boolean | Whether the item can be opened for loot. |
worthless | boolean | Whether the item can't be sold at an NPC vendor. |
cached | boolean | Whether the information came live from the server or from a cache. |
An extension of item data, bag data features the same fields with minor modifications and additions:
Field | Type | Description |
---|---|---|
count | number | The number of item slots in this container. |
free | number | The number of empty item slots in this container. |
slot | number | Equipment slot ID of this container (1 to 11 only). |
owned | boolean | Whether access to this container has been purchased (-2 and 5-11 only). |
viewable | boolean | Whether the container can be viewed by your character (guild bank only). |
canDeposit | boolean | Whether your character can deposit items in this container (guild bank only). |
numWithdrawals | number | Maximum number of withdrawals your character can do (guild bank only). |
remainingWithdrawals | number | Number of withdrawals remaining to your character (guild bank only). |
Field | Type | Description |
---|---|---|
cached | boolean | Whether the information came live from the server or from a cache. |
isguild | boolean | Whether the owner is a guild or a character. |
money | number | Amount of copper owned by the entity. |
faction | string | English name of the owner's faction. |
guild | string | Name of the guild the owner belongs to (character only). |
class | number | Class ID of the owner (character only). |
gender | number | Gender ID of the owner (character only). |
race | number | Race ID of the owner (character only). |
This is the LibItemCache-2.0 wiki. Wiki Home
Using the Library
API
Data Specification
Advanced Uses
Exposing your Cache
Interface Protocol