EQdkp Plus Navigation:   Home  |   Forum  |   Wiki  |   Translate  |   Bugtracker  |   WebSVN  |  USVN

Bnet armory

From EQdkp Plus Wiki

Contents

Battle.net Armory Class

What is the Battle.net Armory Class

Its a helper class to fetch the character data of the battle.net armory for World of Warcraft

Initialize the class

Description

Its pretty simple to initialize the class. You do not need to include it by hand, just load it as a game object

Source Code

$game->new_object('bnet_armory', 'armory', array(SERVERLOC, LANGUAGE));

Function Limiters

Name Description Default
SERVERLOC The Location of the server us
LANGUAGE The language of the fetched data en

Set Language/Serverloc manually

$game->obj['armory']->setSettings(array('loc'=>SERVERLOC, 'locale'=>LANGUAGE));

Ouput

NORMAL

The functions returns an array with all the fetched data.

ERROR

If there's an error fetching the data, the value "status" is set to "error". you can check if the status value is available. It is only available in case of an error. The "reason" value contains the reason why the error appeared

Fetch character data

Description

The output is an array with all the character data fetched of the bnet-armory

Source Code

$chardata = $game->obj['armory']->character(MEMBERNAME, SERVERNAME, FORCE);

Function Limiters

Name Description Possible Values
MEMBERNAME The character name to search for on armory string
SERVERNAME The server name to search for an member string
FORCE Force an update or use the cached version (recommended: used cached version!) true/false

Hints

Last modified date

The lastupdated timestamp needs to be divided by thousand.

$timestamp = ($chardata['lastModified']/ 1000);

To show it in the timeformat of the user:

$time->user_date(($testdata['lastModified']/ 1000)

Convert armory ID to eqdkp+ ID

If you need the races/classes/gender ID of eqdkp, just use the convert function:

$game->obj['armory']->ConvertID($chardata['gender'], 'int', 'gender'));

Fetch guild data

Description

The output is an array with all the guild data fetched of the bnet-armory

Source Code

$chardata = $game->obj['armory']->guild(GUILD, REALM, FORCE);

Function Limiters

Name Description Possible Values
GUILD The name of the guild string
REALM The realmname of the guild string
FORCE Force an update or use the cached version (recommended: used cached version!) true/false

Fetch realm data

Description

The output is an array with all the realms data fetched of the bnet-armory

Source Code

$chardata = $game->obj['armory']->realms(REALMS, FORCE);

Function Limiters

Name Description Possible Values
RELAMS An array with one or multiple realm names array
FORCE Force an update or use the cached version (recommended: used cached version!) true/false

Fetch item data

Description

The output is an array with all the item data fetched of the bnet-armory

Source Code

$chardata = $game->obj['armory']->item(ITEMID, FORCE);

Function Limiters

Name Description Possible Values
ITEMID The itemid of the item to fetch array
FORCE Force an update or use the cached version (recommended: used cached version!) true/false


Fetch Data Resources

Achievements

A List of all available guild or char achievements

$chardata = $game->obj['armory']->getdata_achievements(TYPE, FORCE));
Name Description Possible Values
TYPE The type of the list to fetch character, guild
FORCE Force an update or use the cached version (recommended: used cached version!) true/false

Icons / Images

Character icon

This function outputs the URL to the cached character icon. Simply add it to an img tag.

$game->obj['armory']->characterIcon($chardata['thumbnail']);

Guild tabard image

This function outputs the URL to the cached guild tabard image. Simply add it to an img tag.

$game->obj['armory']->guildTabard(BATTLE.NET API EMBLEM ARRAY, FACTION, GUILDNAME, IMAGE SIZE);

Working with chardata, too. But you have to set the side to 0 for alliance and 1 for horde by yourself and set the correct emblem-array. p.e.

$game->obj['armory']->guildTabard($guilddata['emblem'], $guilddata['side'], $guilddata['name'], 215);