LeaderboardDef Asset
The leaderboard defintion asset defines how information sent by the server about the players on the leaderboard is read. Infinity Ward added it early on Modern Warfare 2, while Treyarch took longer with Black Ops 2 the only game it appears on by them. Subtleties of the asset changed but the main concept remains the same, a header with an array of columns.
enum LbColType
{
LBCOL_TYPE_NUMBER = 0x0,
LBCOL_TYPE_TIME = 0x1,
LBCOL_TYPE_LEVELXP = 0x2,
LBCOL_TYPE_PRESTIGE = 0x3,
LBCOL_TYPE_BIGNUMBER = 0x4,
LBCOL_TYPE_PERCENT = 0x5,
LBCOL_TYPE_TIME_FULL = 0x6,
LBCOL_TYPE_COUNT = 0x7
};
enum LbAggType
{
LBAGG_TYPE_MIN = 0x0,
LBAGG_TYPE_MAX = 0x1,
LBAGG_TYPE_ADD = 0x2,
LBAGG_TYPE_REPLACE = 0x3,
LBAGG_TYPE_COUNT = 0x4
};
struct LbColumnDef
{
const char * title;
int colId;
int dwColIndex;
bool hidden;
#ifdef Ghosts
char unknown15[0x4];
#endif
const char * statName;
LbColType type;
int precision;
LbAggType agg;
#ifdef MW3 || Ghosts
char unknown3[0x8];
#elif defined(BO2)
const char *localization;
int uiCalColX;
int uiCalColY;
#endif
};
enum LbUpdateType
{
LBUPDATE_TYPE_NORMAL = 0x0,
LBUPDATE_TYPE_RANK = 0x1,
LBUPDATE_TYPE_COMBINE = 0x2,
LBUPDATE_TYPE_COUNT = 0x3,
};
struct LeaderboardDef
{
const char * name;
unsigned int id;
int columnCount;
#ifdef BO2 //Check this on BO, one of the next 2 may have been added instead.
int dwColumnCount;
#endif
int xpColId;
int prestigeColId;
LbColumnDef *columns;
#ifdef BO2
LbUpdateType updateType;
int trackTypes;
#endif
};