Manage player statistics.
The statistics module will:
redis_statistics
database.
(gametype, username) -> (gameId) -> { "level": 12, "bestScore": 320, "bestSpree": 22 }
level
metadata in users
.COORDINATOR_PORT_8080_TCP_ADDR
- IP of the coordinator serviceCOORDINATOR_PORT_8080_TCP_PORT
- Port of the coordinator serviceREDIS_STATISTICS_PORT_6379_TCP_ADDR
- IP of the games redisREDIS_STATISTICS_PORT_6379_TCP_PORT
- Port of the games redisRANKING_STRATEGY
- (simple)All requests made to the statistics API require gameType, version and username passed in the request URL.
+ Parameters
+ gameType (string) ... Family of game
+ version (string) ... Major version number the game
+ username (string) ... Player's username
12
DEPRECATED (not implemented this way)
{
"alltimes": {
"numGames": 12,
"numVictories: 6,
"ranking": 121,
"bestScore": 420,
"bestSpree": 21
},
"weekly": {
"numGames": 3,
"numVictories: 2,
"ranking": 28,
"bestScore": 381,
"bestSpree": 2
}
}
+ ?after=timestamp (int) ... Only gets after a given timestamp
[
{
"id": "123456788",
"date": 149202010847293,
"players" : [{
"username": "jeko",
"score": 33,
"newLevel": 770
}, {
"username": "sousou",
"score": 319,
"newLevel": 640
}]
},
{
"id": "123456789",
"date": 149202039203920,
"players" : [{
"username": "jeko",
"score": 93,
"newLevel": 750
}, {
"username": "TheChicken",
"score": 218,
"newLevel": 1834
}]
}
]