Documentation/Loading the dkp data

Introduction

sdkp uses lib-st for data display. As such, according to the library, data loaded must be in a certain format. To do this, there is a file that must be placed in the Interface/Addons/sdkp folder called sdkpdata.lua. This script file is generated by a php script on the eqdkp+ site. The contents of the script file consist of a function that the addon uses which loads the data into a table.

Here's the php script we currently use to export from our eqdkp+ site.

Here is an example of the output:

SDKP_DATA_INIT()

function SDKP_DATA_INIT()
    -- Set up the tables...
    SDKPDATA = {} -- Master table to hold it all
    SDKPPLAYER = {} -- A lookup table that holds an index for the player in the SDKPDATA table.
    SDKP_SYSTEMS = {}  -- A table of systems for the mod to track.

    SDKP_SYSTEMS["T7 Pool"] = "T7 Pool";  
    SDKP_SYSTEMS["T8 Pool"] = "T8 Pool";

    SDKPDATA["T7 Pool"] = {}; -- Data for the "T7 Pool"
    SDKPDATA["T8 Pool"] = {}; -- Data for the "T8 Pool"

    -- load data into tables
    SDKPPLAYER["abbeyroad"] = 1;
    SDKPDATA["T7 Pool"][1] = {
        ["cols"] = {
            { ["value"] = "Abbeyroad", ["color"] = RAID_CLASS_COLORS["ROGUE"] or sdkp.COLOR_UNKNOWN_CLASS },
            { ["value"] = "" },
            { ["value"] = 100, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = 100, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = 100, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = sdkp.FUNC_PLAYER_BID, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = sdkp.FUNC_DKP_TOTAL,  ["color"] = sdkp.FUNC_COLOR_BRACKET, },
        },
        ["earned"] = 95.26,
        ["adjustments"] = 0,
        ["spent"] = 105.01,
    };
    SDKPDATA["T8 Pool"][1] = {
        ["cols"] = {
            { ["value"] = "Abbeyroad", ["color"] = RAID_CLASS_COLORS["ROGUE"] or sdkp.COLOR_UNKNOWN_CLASS },
            { ["value"] = "" },
            { ["value"] = 100, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = 100, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = 100, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = sdkp.FUNC_PLAYER_BID, ["color"] = sdkp.FUNC_COLOR_BRACKET },
            { ["value"] = sdkp.FUNC_DKP_TOTAL,  ["color"] = sdkp.FUNC_COLOR_BRACKET, },
        },
        ["earned"] = 69.65,
        ["adjustments"] = 0,
        ["spent"] = 67.14,
    };
end

sdkp.FUNC_COLOR_BRACKET

This is a function provided by the sdkp mod that will output a color based on tda (Thirty Day Attendance).

sdkp.COLOR_UNKNOWN_CLASS

This is a grey color used to signify an unknown player class.

sdkp.FUNC_PLAYER_BID

This function will return the currently recorded bid for the user.

sdkp.FUNC_DKP_TOTAL

This function returns the total dkp that a user has currently. Initial dkp from the loaded mod (earned + adjustments - spend) minus any recorded loot winnings.


Comments

Posts Quoted:
Reply
Clear All Quotes