Read the end-of-game block's real key names (#154)
A block captured at the end of an Arena 3x6 game on Windows spells the player's key `PUUID` and names no player, so the decoder never found the signed-in one: every game waited for Riot's publication, and the page, told of no Match, showed « Défi » without the end-of-game animation. The decoder now also reads the names of that block (`PUUID`, `itemIds`, `augmentPlatformIds`, `playerKills`, `playerDeaths`, `playerAssists`, `damageDealtToChampions`, `damageTaken`). The capture is kept as an anonymised fixture; a unit test decodes it and a follow test builds its Provisional Match from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a7387c61ce
commit
529b1c9370
4 files changed
+706
-24
No files matched your search
@@ -1,11 +1,16 @@
|
||||
//! The game client's end-of-game block (`/lol-end-of-game/v1/gameclient-eog-stats-block`), read
|
||||
//! leniently: no capture of one is in the repository yet.
|
||||
//! leniently.
|
||||
//!
|
||||
//! Seen on real blocks (docs/research/arena-match-statistics.md): `gameId`,
|
||||
//! `statsBlock.players[]`, each player's `puuid` and `subteamStanding`. Every other key name here
|
||||
//! is a likely name still to verify on Windows against a real block. A key not found leaves its
|
||||
//! value `None`, and the block is stored as received (`tracker/blocks.rs`): one that built no
|
||||
//! Match is read again by later rounds and by a corrected decoder.
|
||||
//! Key names checked on a block captured on Windows at the end of an Arena 3x6 game
|
||||
//! (`tests/fixtures/client/end_of_game_block_arena.json`, #154): `gameId`, `gameMode`, `queueId`,
|
||||
//! `statsBlock.gameLengthSeconds` and `statsBlock.players[]`, each with `PUUID`, `championId`,
|
||||
//! `championName`, `championLevel`, `subteamId`, `subteamStanding`, `playerKills`,
|
||||
//! `playerDeaths`, `playerAssists`, `goldEarned`, `itemIds`, `augmentPlatformIds`,
|
||||
//! `damageDealtToChampions` and `damageTaken`. That block gives no platform and no player name:
|
||||
//! the signed-in player is found by the client's PUUID alone. The other names are unverified
|
||||
//! spellings. A key not found leaves its value `None`, and the block is stored as received
|
||||
//! (`tracker/blocks.rs`): one that built no Match is read again by later rounds and by a
|
||||
//! corrected decoder.
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
@@ -148,28 +153,29 @@ fn player(entry: &Value) -> BlockPlayer {
|
||||
let at = |names: &[&str]| field(entry, "stats", names);
|
||||
let int = |names: &[&str]| at(names).and_then(number);
|
||||
let small = |names: &[&str]| int(names).and_then(|n| u32::try_from(n).ok());
|
||||
let items = match at(&["items"]).and_then(Value::as_array) {
|
||||
let items = match at(&["items", "itemIds"]).and_then(Value::as_array) {
|
||||
Some(list) => std::array::from_fn(|i| list.get(i).and_then(id)),
|
||||
None => std::array::from_fn(|i| {
|
||||
let names = [format!("item{i}"), format!("ITEM{i}")];
|
||||
small(&[&names[0], &names[1]])
|
||||
}),
|
||||
};
|
||||
let augments = match at(&["augments", "playerAugments"]).and_then(Value::as_array) {
|
||||
Some(list) => Some(list.iter().filter_map(id).collect()),
|
||||
None => {
|
||||
let slots: Vec<Option<u32>> = (1..=6)
|
||||
.map(|i| {
|
||||
let names = [format!("playerAugment{i}"), format!("PLAYER_AUGMENT_{i}")];
|
||||
small(&[&names[0], &names[1]])
|
||||
})
|
||||
.collect();
|
||||
(slots.iter().any(Option::is_some)).then(|| slots.into_iter().flatten().collect())
|
||||
let augments =
|
||||
match at(&["augments", "playerAugments", "augmentPlatformIds"]).and_then(Value::as_array) {
|
||||
Some(list) => Some(list.iter().filter_map(id).collect()),
|
||||
None => {
|
||||
let slots: Vec<Option<u32>> = (1..=6)
|
||||
.map(|i| {
|
||||
let names = [format!("playerAugment{i}"), format!("PLAYER_AUGMENT_{i}")];
|
||||
small(&[&names[0], &names[1]])
|
||||
})
|
||||
.collect();
|
||||
(slots.iter().any(Option::is_some)).then(|| slots.into_iter().flatten().collect())
|
||||
}
|
||||
}
|
||||
}
|
||||
.map(|ids: Vec<u32>| ids.into_iter().filter(|&id| id != 0).collect());
|
||||
.map(|ids: Vec<u32>| ids.into_iter().filter(|&id| id != 0).collect());
|
||||
BlockPlayer {
|
||||
puuid: at(&["puuid"]).and_then(text),
|
||||
puuid: at(&["puuid", "PUUID"]).and_then(text),
|
||||
game_name: at(&["riotIdGameName", "gameName"]).and_then(text),
|
||||
tag_line: at(&["riotIdTagLine", "riotIdTagline", "tagLine"]).and_then(text),
|
||||
summoner_name: at(&["summonerName", "displayName"]).and_then(text),
|
||||
@@ -185,17 +191,18 @@ fn player(entry: &Value) -> BlockPlayer {
|
||||
.and_then(|n| u8::try_from(n).ok())
|
||||
.filter(|&p| p != 0),
|
||||
level: small(&["level", "champLevel", "championLevel", "LEVEL"]),
|
||||
kills: small(&["kills", "CHAMPIONS_KILLED"]),
|
||||
deaths: small(&["deaths", "NUM_DEATHS"]),
|
||||
assists: small(&["assists", "ASSISTS"]),
|
||||
kills: small(&["kills", "playerKills", "CHAMPIONS_KILLED"]),
|
||||
deaths: small(&["deaths", "playerDeaths", "NUM_DEATHS"]),
|
||||
assists: small(&["assists", "playerAssists", "ASSISTS"]),
|
||||
gold_earned: int(&["goldEarned", "GOLD_EARNED"]),
|
||||
items,
|
||||
augments,
|
||||
damage_to_champions: int(&[
|
||||
"totalDamageDealtToChampions",
|
||||
"damageDealtToChampions",
|
||||
"TOTAL_DAMAGE_DEALT_TO_CHAMPIONS",
|
||||
]),
|
||||
damage_taken: int(&["totalDamageTaken", "TOTAL_DAMAGE_TAKEN"]),
|
||||
damage_taken: int(&["totalDamageTaken", "damageTaken", "TOTAL_DAMAGE_TAKEN"]),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,3 +157,37 @@ fn the_platform_is_upper_case_and_alphanumeric_or_ignored() {
|
||||
assert_eq!(with(bad), None, "{bad:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A block the client gave at the end of an Arena 3x6 game (2026-11-28), PUUIDs anonymised.
|
||||
const CAPTURED: &str = include_str!("../../tests/fixtures/client/end_of_game_block_arena.json");
|
||||
|
||||
#[test]
|
||||
fn decodes_a_captured_block() {
|
||||
let block = decode(CAPTURED).unwrap();
|
||||
assert_eq!(block.game_id, 8059574990);
|
||||
assert_eq!(block.game_mode.as_deref(), Some("CHERRY"));
|
||||
assert_eq!((block.queue_id, block.duration_s), (Some(1750), Some(1415)));
|
||||
assert_eq!(block.platform_id, None);
|
||||
assert_eq!((block.players.len(), block.team_count()), (18, 6));
|
||||
let me = block.player(Some("client-puuid-self"), None).unwrap();
|
||||
assert_eq!(
|
||||
(me.champion_id, me.subteam_id, me.placement),
|
||||
(Some(23), Some(2), Some(1))
|
||||
);
|
||||
assert_eq!(
|
||||
(me.level, me.kills, me.deaths, me.assists),
|
||||
(Some(18), Some(16), Some(6), Some(7))
|
||||
);
|
||||
assert_eq!(me.gold_earned, Some(16258));
|
||||
assert_eq!(
|
||||
me.items.map(Option::unwrap),
|
||||
[223091, 447100, 223031, 223033, 226672, 223156, 3348]
|
||||
);
|
||||
assert_eq!(me.augments, Some(vec![116, 225, 310]));
|
||||
assert_eq!(
|
||||
(me.damage_to_champions, me.damage_taken),
|
||||
(Some(61810), Some(35648))
|
||||
);
|
||||
// The block names no player: only the PUUID finds the signed-in one.
|
||||
assert_eq!(me.riot_id(), None);
|
||||
}
|
||||
@@ -0,0 +1,616 @@
|
||||
{
|
||||
"gameId": 8059574990,
|
||||
"gameMode": "CHERRY",
|
||||
"isRanked": false,
|
||||
"queueId": 1750,
|
||||
"queueType": "CHERRY",
|
||||
"statsBlock": {
|
||||
"gameLengthSeconds": 1415,
|
||||
"players": [
|
||||
{
|
||||
"PUUID": "client-puuid-0",
|
||||
"augmentPlatformIds": [
|
||||
48,
|
||||
44,
|
||||
211
|
||||
],
|
||||
"championId": 127,
|
||||
"championLevel": 15,
|
||||
"championName": "Lissandra",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 64575,
|
||||
"damageDealtToChampions": 24824,
|
||||
"damageTaken": 23760,
|
||||
"goldEarned": 9815,
|
||||
"itemIds": [
|
||||
444636,
|
||||
223158,
|
||||
223157,
|
||||
224646,
|
||||
223118,
|
||||
224645,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 5,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1000,
|
||||
"playerKills": 3,
|
||||
"subteamId": 1,
|
||||
"subteamStanding": 5,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-1",
|
||||
"augmentPlatformIds": [
|
||||
357,
|
||||
211,
|
||||
125
|
||||
],
|
||||
"championId": 777,
|
||||
"championLevel": 15,
|
||||
"championName": "Yone",
|
||||
"championSkinId": 35,
|
||||
"damageDealt": 152289,
|
||||
"damageDealtToChampions": 25923,
|
||||
"damageTaken": 19968,
|
||||
"goldEarned": 9507,
|
||||
"itemIds": [
|
||||
446671,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 4,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1001,
|
||||
"playerKills": 4,
|
||||
"subteamId": 1,
|
||||
"subteamStanding": 5,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-2",
|
||||
"augmentPlatformIds": [
|
||||
227,
|
||||
135
|
||||
],
|
||||
"championId": 893,
|
||||
"championLevel": 15,
|
||||
"championName": "Aurora",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 52014,
|
||||
"damageDealtToChampions": 15197,
|
||||
"damageTaken": 20712,
|
||||
"goldEarned": 12321,
|
||||
"itemIds": [
|
||||
220012,
|
||||
446656,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 6,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1002,
|
||||
"playerKills": 3,
|
||||
"subteamId": 1,
|
||||
"subteamStanding": 5,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-3",
|
||||
"augmentPlatformIds": [
|
||||
192,
|
||||
15,
|
||||
2008,
|
||||
141
|
||||
],
|
||||
"championId": 16,
|
||||
"championLevel": 13,
|
||||
"championName": "Soraka",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 23464,
|
||||
"damageDealtToChampions": 8318,
|
||||
"damageTaken": 22361,
|
||||
"goldEarned": 6750,
|
||||
"itemIds": [
|
||||
223158,
|
||||
447104,
|
||||
226617,
|
||||
4011,
|
||||
0,
|
||||
0,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 8,
|
||||
"playerDeaths": 6,
|
||||
"playerId": 1003,
|
||||
"playerKills": 1,
|
||||
"subteamId": 3,
|
||||
"subteamStanding": 6,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-4",
|
||||
"augmentPlatformIds": [
|
||||
133,
|
||||
48,
|
||||
47
|
||||
],
|
||||
"championId": 90,
|
||||
"championLevel": 13,
|
||||
"championName": "Malzahar",
|
||||
"championSkinId": 38,
|
||||
"damageDealt": 46934,
|
||||
"damageDealtToChampions": 19987,
|
||||
"damageTaken": 22595,
|
||||
"goldEarned": 6750,
|
||||
"itemIds": [
|
||||
223158,
|
||||
443062,
|
||||
222503,
|
||||
223165,
|
||||
0,
|
||||
0,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 6,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1004,
|
||||
"playerKills": 3,
|
||||
"subteamId": 3,
|
||||
"subteamStanding": 6,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-5",
|
||||
"augmentPlatformIds": [
|
||||
23,
|
||||
2,
|
||||
193
|
||||
],
|
||||
"championId": 5,
|
||||
"championLevel": 13,
|
||||
"championName": "Xin Zhao",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 50992,
|
||||
"damageDealtToChampions": 22188,
|
||||
"damageTaken": 31585,
|
||||
"goldEarned": 9032,
|
||||
"itemIds": [
|
||||
223748,
|
||||
223047,
|
||||
223078,
|
||||
223071,
|
||||
447101,
|
||||
0,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 2,
|
||||
"playerDeaths": 6,
|
||||
"playerId": 1005,
|
||||
"playerKills": 5,
|
||||
"subteamId": 3,
|
||||
"subteamStanding": 6,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-6",
|
||||
"augmentPlatformIds": [
|
||||
215,
|
||||
216,
|
||||
37
|
||||
],
|
||||
"championId": 267,
|
||||
"championLevel": 18,
|
||||
"championName": "Nami",
|
||||
"championSkinId": 9,
|
||||
"damageDealt": 61349,
|
||||
"damageDealtToChampions": 28336,
|
||||
"damageTaken": 44909,
|
||||
"goldEarned": 13255,
|
||||
"itemIds": [
|
||||
4016,
|
||||
223040,
|
||||
223020,
|
||||
223089,
|
||||
224645,
|
||||
444636,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 19,
|
||||
"playerDeaths": 6,
|
||||
"playerId": 1006,
|
||||
"playerKills": 3,
|
||||
"subteamId": 4,
|
||||
"subteamStanding": 3,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-7",
|
||||
"augmentPlatformIds": [
|
||||
388,
|
||||
133,
|
||||
45
|
||||
],
|
||||
"championId": 63,
|
||||
"championLevel": 18,
|
||||
"championName": "Brand",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 101953,
|
||||
"damageDealtToChampions": 78863,
|
||||
"damageTaken": 48229,
|
||||
"goldEarned": 15264,
|
||||
"itemIds": [
|
||||
447118,
|
||||
447108,
|
||||
226657,
|
||||
223040,
|
||||
224646,
|
||||
226653,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 5,
|
||||
"playerDeaths": 6,
|
||||
"playerId": 1007,
|
||||
"playerKills": 18,
|
||||
"subteamId": 5,
|
||||
"subteamStanding": 4,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-8",
|
||||
"augmentPlatformIds": [
|
||||
118,
|
||||
15,
|
||||
21,
|
||||
343
|
||||
],
|
||||
"championId": 37,
|
||||
"championLevel": 18,
|
||||
"championName": "Sona",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 47197,
|
||||
"damageDealtToChampions": 41589,
|
||||
"damageTaken": 44131,
|
||||
"goldEarned": 16520,
|
||||
"itemIds": [
|
||||
223107,
|
||||
447104,
|
||||
223040,
|
||||
226617,
|
||||
446667,
|
||||
223158,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 20,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1008,
|
||||
"playerKills": 9,
|
||||
"subteamId": 6,
|
||||
"subteamStanding": 2,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-9",
|
||||
"augmentPlatformIds": [
|
||||
141,
|
||||
150,
|
||||
215,
|
||||
46,
|
||||
378
|
||||
],
|
||||
"championId": 267,
|
||||
"championLevel": 17,
|
||||
"championName": "Nami",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 16000,
|
||||
"damageDealtToChampions": 13156,
|
||||
"damageTaken": 32307,
|
||||
"goldEarned": 13669,
|
||||
"itemIds": [
|
||||
447105,
|
||||
223107,
|
||||
226617,
|
||||
223089,
|
||||
226616,
|
||||
223504,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 20,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1009,
|
||||
"playerKills": 1,
|
||||
"subteamId": 5,
|
||||
"subteamStanding": 4,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-10",
|
||||
"augmentPlatformIds": [
|
||||
13,
|
||||
181,
|
||||
313,
|
||||
322
|
||||
],
|
||||
"championId": 19,
|
||||
"championLevel": 18,
|
||||
"championName": "Warwick",
|
||||
"championSkinId": 6,
|
||||
"damageDealt": 255047,
|
||||
"damageDealtToChampions": 59168,
|
||||
"damageTaken": 107820,
|
||||
"goldEarned": 16042,
|
||||
"itemIds": [
|
||||
443058,
|
||||
447103,
|
||||
223084,
|
||||
223075,
|
||||
223008,
|
||||
447111,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 10,
|
||||
"playerDeaths": 8,
|
||||
"playerId": 1010,
|
||||
"playerKills": 13,
|
||||
"subteamId": 6,
|
||||
"subteamStanding": 2,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-11",
|
||||
"augmentPlatformIds": [
|
||||
113,
|
||||
2,
|
||||
205,
|
||||
53
|
||||
],
|
||||
"championId": 76,
|
||||
"championLevel": 18,
|
||||
"championName": "Nidalee",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 116704,
|
||||
"damageDealtToChampions": 36816,
|
||||
"damageTaken": 35756,
|
||||
"goldEarned": 14250,
|
||||
"itemIds": [
|
||||
223135,
|
||||
444636,
|
||||
224628,
|
||||
223042,
|
||||
223146,
|
||||
223089,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 11,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1011,
|
||||
"playerKills": 8,
|
||||
"subteamId": 4,
|
||||
"subteamStanding": 3,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-12",
|
||||
"augmentPlatformIds": [
|
||||
206,
|
||||
228,
|
||||
220
|
||||
],
|
||||
"championId": 498,
|
||||
"championLevel": 18,
|
||||
"championName": "Xayah",
|
||||
"championSkinId": 2,
|
||||
"damageDealt": 450859,
|
||||
"damageDealtToChampions": 83142,
|
||||
"damageTaken": 37714,
|
||||
"goldEarned": 16268,
|
||||
"itemIds": [
|
||||
223146,
|
||||
443069,
|
||||
223031,
|
||||
223036,
|
||||
447113,
|
||||
223153,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 11,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1012,
|
||||
"playerKills": 12,
|
||||
"subteamId": 4,
|
||||
"subteamStanding": 3,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-13",
|
||||
"augmentPlatformIds": [
|
||||
129,
|
||||
1332,
|
||||
107,
|
||||
238,
|
||||
238,
|
||||
1328
|
||||
],
|
||||
"championId": 85,
|
||||
"championLevel": 17,
|
||||
"championName": "Kennen",
|
||||
"championSkinId": 7,
|
||||
"damageDealt": 170457,
|
||||
"damageDealtToChampions": 36016,
|
||||
"damageTaken": 29691,
|
||||
"goldEarned": 13692,
|
||||
"itemIds": [
|
||||
223008,
|
||||
443060,
|
||||
223115,
|
||||
223089,
|
||||
447121,
|
||||
223124,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 13,
|
||||
"playerDeaths": 7,
|
||||
"playerId": 1013,
|
||||
"playerKills": 4,
|
||||
"subteamId": 5,
|
||||
"subteamStanding": 4,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-14",
|
||||
"augmentPlatformIds": [
|
||||
48,
|
||||
6,
|
||||
2010
|
||||
],
|
||||
"championId": 42,
|
||||
"championLevel": 18,
|
||||
"championName": "Corki",
|
||||
"championSkinId": 0,
|
||||
"damageDealt": 115053,
|
||||
"damageDealtToChampions": 47167,
|
||||
"damageTaken": 29508,
|
||||
"goldEarned": 16262,
|
||||
"itemIds": [
|
||||
443069,
|
||||
223031,
|
||||
223036,
|
||||
447106,
|
||||
223153,
|
||||
223091,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 12,
|
||||
"playerDeaths": 8,
|
||||
"playerId": 1014,
|
||||
"playerKills": 8,
|
||||
"subteamId": 2,
|
||||
"subteamStanding": 1,
|
||||
"summonerSpell1": 2201,
|
||||
"summonerSpell2": 2202
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-self",
|
||||
"augmentPlatformIds": [
|
||||
116,
|
||||
225,
|
||||
310
|
||||
],
|
||||
"championId": 23,
|
||||
"championLevel": 18,
|
||||
"championName": "Tryndamere",
|
||||
"championSkinId": 29,
|
||||
"damageDealt": 403095,
|
||||
"damageDealtToChampions": 61810,
|
||||
"damageTaken": 35648,
|
||||
"goldEarned": 16258,
|
||||
"itemIds": [
|
||||
223091,
|
||||
447100,
|
||||
223031,
|
||||
223033,
|
||||
226672,
|
||||
223156,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 7,
|
||||
"playerDeaths": 6,
|
||||
"playerId": 1015,
|
||||
"playerKills": 16,
|
||||
"subteamId": 2,
|
||||
"subteamStanding": 1,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-16",
|
||||
"augmentPlatformIds": [
|
||||
120,
|
||||
356,
|
||||
44,
|
||||
1405
|
||||
],
|
||||
"championId": 420,
|
||||
"championLevel": 18,
|
||||
"championName": "Illaoi",
|
||||
"championSkinId": 15,
|
||||
"damageDealt": 121486,
|
||||
"damageDealtToChampions": 62288,
|
||||
"damageTaken": 86385,
|
||||
"goldEarned": 16379,
|
||||
"itemIds": [
|
||||
223074,
|
||||
447103,
|
||||
223084,
|
||||
447111,
|
||||
223071,
|
||||
223161,
|
||||
3348
|
||||
],
|
||||
"playerAssists": 14,
|
||||
"playerDeaths": 5,
|
||||
"playerId": 1016,
|
||||
"playerKills": 5,
|
||||
"subteamId": 2,
|
||||
"subteamStanding": 1,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
},
|
||||
{
|
||||
"PUUID": "client-puuid-17",
|
||||
"augmentPlatformIds": [
|
||||
227,
|
||||
2132,
|
||||
205,
|
||||
30
|
||||
],
|
||||
"championId": 9,
|
||||
"championLevel": 18,
|
||||
"championName": "Fiddlesticks",
|
||||
"championSkinId": 6,
|
||||
"damageDealt": 100345,
|
||||
"damageDealtToChampions": 73837,
|
||||
"damageTaken": 73607,
|
||||
"goldEarned": 21488,
|
||||
"itemIds": [
|
||||
220012,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
3330
|
||||
],
|
||||
"playerAssists": 15,
|
||||
"playerDeaths": 10,
|
||||
"playerId": 1017,
|
||||
"playerKills": 8,
|
||||
"subteamId": 6,
|
||||
"subteamStanding": 2,
|
||||
"summonerSpell1": 2202,
|
||||
"summonerSpell2": 2201
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,31 @@ fn the_block_counts_at_once_and_its_publication_corrects_it_without_a_second_rep
|
||||
assert_eq!(world.source_calls(), calls, "nothing left to look for");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_captured_block_counts_at_once() {
|
||||
let world = World::new(&s2_matches());
|
||||
let tracker = world.tracker();
|
||||
start_game(&world, &tracker);
|
||||
|
||||
// The block of a real game (Tryndamere first), moved to the game these tests play: it names
|
||||
// no player, only the client's PUUID finds the signed-in one.
|
||||
let block = include_str!("../fixtures/client/end_of_game_block_arena.json")
|
||||
.replace("8059574990", &game().0.to_string());
|
||||
world.client.create_end_of_game_block(&block);
|
||||
world.client.return_to_lobby();
|
||||
let (_, events) = changed_round(&tracker);
|
||||
|
||||
assert_eq!(events.len(), 1);
|
||||
assert!(events[0].provisional, "from the end-of-game block");
|
||||
assert_eq!(
|
||||
(events[0].champion_id, events[0].match_id.as_str()),
|
||||
(23, game().1.as_str())
|
||||
);
|
||||
let m = stored(&tracker, SELF_PUUID);
|
||||
assert!(m.provisional);
|
||||
assert_eq!((m.placement, m.win, m.format), (1, true, Format::Arena3x6));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_block_before_the_game_leaves_in_game_is_the_game_s_match_and_it_is_not_pending() {
|
||||
let world = World::new(&s2_matches());
|
||||
|
||||
Reference in new issue
Block a user