LeaderboardDef Asset: Difference between revisions
No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
[[Category:Ghosts]] | [[Category:Ghosts]] | ||
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. | 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 == | |||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
enum LbColType | enum LbColType | ||
| Line 26: | Line 27: | ||
LBAGG_TYPE_REPLACE = 0x3, | LBAGG_TYPE_REPLACE = 0x3, | ||
LBAGG_TYPE_COUNT = 0x4 | LBAGG_TYPE_COUNT = 0x4 | ||
}; | |||
enum LbUpdateType | |||
{ | |||
LBUPDATE_TYPE_NORMAL = 0x0, | |||
LBUPDATE_TYPE_RANK = 0x1, | |||
LBUPDATE_TYPE_COMBINE = 0x2, | |||
LBUPDATE_TYPE_COUNT = 0x3, | |||
}; | }; | ||
| Line 34: | Line 43: | ||
int dwColIndex; | int dwColIndex; | ||
bool hidden; | bool hidden; | ||
const char * statName; | const char * statName; | ||
LbColType type; | LbColType type; | ||
int precision; | int precision; | ||
LbAggType agg; | LbAggType agg; | ||
const char *localization; | const char *localization; | ||
int uiCalColX; | int uiCalColX; | ||
int uiCalColY; | int uiCalColY; | ||
}; | |||
struct LeaderboardDef | |||
{ | |||
const char * name; | |||
unsigned int id; | |||
int columnCount; | |||
int dwColumnCount; | |||
int xpColId; | |||
int prestigeColId; | |||
LbColumnDef *columns; | |||
LbUpdateType updateType; | |||
int trackTypes; | |||
}; | |||
</syntaxhighlight> | |||
== Infinity Ward == | |||
TODO: This is off Ghosts, check other games. | |||
<syntaxhighlight lang="cpp"> | |||
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 | |||
}; | }; | ||
| Line 55: | Line 95: | ||
LBUPDATE_TYPE_RANK = 0x1, | LBUPDATE_TYPE_RANK = 0x1, | ||
LBUPDATE_TYPE_COMBINE = 0x2, | LBUPDATE_TYPE_COMBINE = 0x2, | ||
LBUPDATE_TYPE_COUNT = 0x3, | 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; | |||
}; | }; | ||
| Line 61: | Line 126: | ||
{ | { | ||
const char * name; | const char * name; | ||
int id; | |||
int columnCount; | int columnCount; | ||
int xpColId; | int xpColId; | ||
int prestigeColId; | int prestigeColId; | ||
LbColumnDef *columns; | LbColumnDef *columns; | ||
LbUpdateType updateType; | LbUpdateType updateType; | ||
int trackTypes; | int trackTypes; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 03:27, 22 December 2014
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;
};