Modern live ticker: crowd and weather before the kickoff
The recording's ticker matches and the paused live kickoff's matches carry attendance and weather (temperature, the original's weather picture; none indoors), as the interface asked in issue 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
98e6982d07
commit
d3ea650c07
4 files changed
+17
-1
No files matched your search
@@ -8820,6 +8820,12 @@ cli::Json ModernSession::read_live(const cli::Json& request) const {
|
||||
{"away", O{{"id", modern::ui_team_id(g_, away)}, {"name", ui::original_to_utf8(g_.club_name(away))}}},
|
||||
{"homeManagerId", hm >= 0 ? cli::Json(modern::ui_manager_id(g_, hm)) : cli::Json(nullptr)},
|
||||
{"awayManagerId", am >= 0 ? cli::Json(modern::ui_manager_id(g_, am)) : cli::Json(nullptr)},
|
||||
// the crowd and the weather the kickoff set (descriptor +0x30 temperature,
|
||||
// +0x50 the weather picture 0-7)
|
||||
{"attendance", size_t(m) < grp.spectators.size() ? cli::Json(int64_t(grp.spectators[size_t(m)])) : cli::Json(nullptr)},
|
||||
{"weather", grp.desc.size() > 0x50 + size_t(m)
|
||||
? cli::Json(cli::Json::Object{{"temperature", int(int8_t(grp.desc[0x30 + size_t(m)]))}, {"rain", int(grp.desc[0x50 + size_t(m)])}})
|
||||
: cli::Json(nullptr)},
|
||||
{"score", cli::Json::Array{cli::Json(h), cli::Json(a)}}});
|
||||
}
|
||||
// the live tables: each league group with a live match, its matches at their score so far
|
||||
|
||||
@@ -852,7 +852,11 @@ cli::Json live_fixture(const ModernState& g, uint32_t after_date, uint32_t until
|
||||
const Competition c = competition_of(g, s, m);
|
||||
matches.push_back(O{{"id", id}, {"home", O{{"id", s.clubs[m.home].id}, {"name", s.clubs[m.home].name}}},
|
||||
{"away", O{{"id", s.clubs[m.away].id}, {"name", s.clubs[m.away].name}}},
|
||||
{"owners", std::move(match_owners)}, {"competition", c.name}});
|
||||
{"owners", std::move(match_owners)}, {"competition", c.name},
|
||||
// known before the kickoff (frame 0 on): the crowd and the weather (rain is the
|
||||
// original's weather picture 0-7); the indoor tournament has no weather
|
||||
{"attendance", int64_t(m.attendance)},
|
||||
{"weather", m.type - 1 == 0xb ? J(nullptr) : J(O{{"temperature", int(m.temperature)}, {"rain", int(m.rain)}})}});
|
||||
}
|
||||
for (const Ref& r : others) conference.push_back(almanac_match(g, *r.season, r.index));
|
||||
|
||||
|
||||
Reference in new issue
Block a user