Skip to content

Ranking Protocol

Yannik Marchand edited this page Oct 13, 2023 · 27 revisions

NEX Protocols > Ranking (112)

The following games have additional methods in the ranking protocol:

This remainder of this page describes the methods that are not specific to any game.

Method ID Method Name
1 UploadScore
2 DeleteScore
3 DeleteAllScores
4 UploadCommonData
5 DeleteCommonData
6 GetCommonData
7 ChangeAttributes
8 ChangeAllAttributes
9 GetRanking
10 GetApproxOrder
11 GetStats
12 GetRankingByPIDList
13 GetRankingByUniqueIdList
14 GetCachedTopXRanking
15 GetCachedTopXRankings

(1) UploadScore

Request

Type Name
RankingScoreData scoreData
Uint64 uniqueId

Response

This method does not return anything.

(2) DeleteScore

Request

Type Name
Uint32 category
Uint64 uniqueId

Response

This method does not return anything.

(3) DeleteAllScores

Request

Type Name
Uint64 uniqueId

Response

This method does not return anything.

(4) UploadCommonData

Request

Type Name
Buffer commonData
Uint64 uniqueId

Response

This method does not return anything.

(5) DeleteCommonData

Request

Type Name
Uint64 uniqueId

Response

This method does not return anything.

(6) GetCommonData

Request

Type Name
Uint64 uniqueId

Response

Type Name
Buffer commonData

(7) ChangeAttributes

Request

Type Name
Uint32 category
RankingChangeAttributesParam changeParam
Uint64 uniqueId

Response

This method does not return anything.

(8) ChangeAllAttributes

Request

Type Name
RankingChangeAttributesParam changeParam
Uint64 uniqueId

Response

This method does not return anything.

(9) GetRanking

Request

Type Name Description
Uint8 rankingMode Ranking mode
Uint32 category Category (game-specific)
RankingOrderParam orderParam A bunch of parameters
Uint64 uniqueId
PID principalId

Response

Type Name
RankingResult pResult

(10) GetApproxOrder

Request

Type Name
Uint32 category
RankingOrderParam orderParam
Uint32 score
Uint64 uniqueId
PID principalId

Response

Type Name
Uint32 pOrder

(11) GetStats

Request

Type Name Description
Uint32 category
RankingOrderParam orderParam
Uint32 flags Specifies the kind of stats returned

Flags

Value Description
0x1 Number of ranking entries
0x2 Sum of all scores
0x4 Lowest score
0x8 Highest score
0x10 Average score

Response

Type Name
RankingStats pStats

(12) GetRankingByPIDList

Request

Type Name Description
List<PID> principalIdList User ids
Uint8 rankingMode Ranking mode
Uint32 category
RankingOrderParam orderParam
Uint64 uniqueId

Response

Type Name
RankingResult pResult

(13) GetRankingByUniqueIdList

Request

Type Name Description
List<Uint64> nexUniqueIdList
Uint8 rankingMode Ranking mode
Uint32 category
RankingOrderParam orderParam
Uint64 uniqueId

Response

Type Name
RankingResult pResult

(14) GetCachedTopXRanking

Request

Type Name
Uint32 category
RankingOrderParam orderParam

Response

Type Name
RankingCachedResult pResult

(15) GetCachedTopXRankings

Request

Type Name
List<Uint32> categories
List<RankingOrderParam> orderParams

Response

Type Name
List<RankingCachedResult> pResults

Types

RankingOrderParam (Structure)

Type Name Description
Uint8 orderCalculation Rank calculation
Uint8 groupIndex Filter index
Uint8 groupNum Filter number
Uint8 timeScope Time scope
Uint32 offset Base rank (0 is world record)
Uint8 length Desired number of rankings

Rank Calculation

Value Description
0 Standard ranking (1224)
1 Ordinal ranking (1234)

RankingRankData (Structure)

Type Name Description
PID principalId User id
Uint64 uniqueId
Uint32 order Rank
Uint32 category Category
Uint32 score Score
List<byte> groups Filters
Uint64 param Additional info
Buffer commonData Additional data

RankingResult (Structure)

Type Name Description
List<RankingRankData> rankDataList Rankings
Uint32 totalCount Total number of ranking entries on the server
DateTime sinceTime

RankingCachedResult (Inherits RankingResult)

Type Name
DateTime createdTime
DateTime expiredTime
Uint8 maxLength

RankingStats (Structure)

The statsList always has 5 entries. Depending on the flags given to GetStats, some entries may be 0.

Type Name
List<Double> statsList

RankingScoreData (Structure)

Type Name
Uint32 category
Uint32 score
Uint8 orderBy
Uint8 updateMode
List<Uint8> groups
Uint64 param

RankingChangeAttributesParam (Structure)

Type Name
Uint8 modificationFlag
List<Uint8> groups
Uint64 param

Ranking Mode

Value Description
0 Global, only the top 1000 entries can be downloaded
1 Global rankings around own entry
4 Own ranking only
Clone this wiki locally