LeaderboardDef Asset

From COD Engine Research
Jump to: navigation, search

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.

Treyarch

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
};
 
enum LbUpdateType
{
  LBUPDATE_TYPE_NORMAL = 0x0,
  LBUPDATE_TYPE_RANK = 0x1,
  LBUPDATE_TYPE_COMBINE = 0x2,
  LBUPDATE_TYPE_COUNT = 0x3,
};
 
struct LbColumnDef
{
  const char * title;
  int colId;
  int dwColIndex;
  bool hidden;
  const char * statName;
  LbColType type;
  int precision;
  LbAggType agg;
  const char *localization;
  int uiCalColX;
  int uiCalColY;
};
 
struct LeaderboardDef
{
  const char * name;
  unsigned int id;
  int columnCount;
  int dwColumnCount;
  int xpColId;
  int prestigeColId;
  LbColumnDef *columns;
  LbUpdateType updateType;
  int trackTypes;
};

Infinity Ward

TODO: This is off Ghosts, check other games.

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_SUM = 0x2,
  LBAGG_TYPE_LAST = 0x3,
  LBAGG_TYPE_COUNT = 0x4
};
 
enum LbUpdateType
{
  LBUPDATE_TYPE_NORMAL = 0x0,
  LBUPDATE_TYPE_RANK = 0x1,
  LBUPDATE_TYPE_COMBINE = 0x2,
  LBUPDATE_TYPE_COUNT = 0x3
};
 
enum StatsGroup
{
  STATSGROUP_RANKED = 0x0,
  STATSGROUP_PRIVATE = 0x1,
  STATSGROUP_COOP = 0x2,
  STATSGROUP_COMMON = 0x3,
  STATSGROUP_COUNT = 0x4,
  STATSGROUP_IGNORE = 0x5
};
 
struct __declspec(align(8)) LbColumnDef
{
  const char * title;
  int id;
  int propertyId;
  bool hidden;
  StatsGroup statsGroup;
  const char * statName;
  LbColType type;
  int precision;
  LbAggType agg;
  int uiCalColX;
  int uiCalColY;
};
 
struct LeaderboardDef
{
  const char * name;
  int id;
  int columnCount;
  int xpColId;
  int prestigeColId;
  LbColumnDef *columns;
  LbUpdateType updateType;
  int trackTypes;
};