feat(fifa17): definition-coverage guard, and a complete-club staging fixture
The guard classifies every definition id the game ships into exactly one of
KNOWN_OWNABLE / KNOWN_PRESENTATION_ONLY / KNOWN_UNSUPPORTED / UNKNOWN, and fails
when anything lands in UNKNOWN, so a table we cannot place is loud instead of
quietly assumed cosmetic. All 149 tables place: UNKNOWN = 0, 20,876 ownable ids.
Two tables are KNOWN_UNSUPPORTED with stated reasons rather than guessed at:
`fut_storymodehero` (80 ids; the shipped row is only {carddbid, teamid}, so no
item can be shaped without inventing one) and `fcc_misccards` (42 ids; these ARE
owned items, but their per-subtype semantics are not reverse-engineered).
It also counts by SHARED ID SPACE: `fcc_leaguelogos` and
`fcc_leaguelogostickers` both start at carddbid 8010000 and all 39 sticker ids
collide, so the union is 44 and never 83. The collision is printed so summing
cannot regress silently.
Staging now seeds the remaining club families (badge, ball, stadium, league
logo) from the client's own tables, so the rig exercises EVERY ownable class
instead of only the two the real club happens to hold.
This commit is contained in:
@@ -187,6 +187,24 @@ STAGING_KITS = [
|
||||
("away", "owned-a-kit-away", "fifa17_6400003", 6_400_003),
|
||||
]
|
||||
|
||||
# The remaining club-item families, so the rig exercises EVERY ownable class
|
||||
# rather than only the two the real club happens to hold. Every value is read
|
||||
# out of the client's own tables (fifa17-recon/data/tables), never invented:
|
||||
# fcc_badgecards 6000005 teamid 21 -> the same team as the kits above
|
||||
# fcc_balls 8120194 cardassetid 37
|
||||
# fcc_stadium 6200000 cardassetid 36 (capacity 76200)
|
||||
# fcc_leaguelogos 8010015 leagueid 53 -> the same league as the manager below
|
||||
# Each family ships a CONSTANT cardassetid (kit 35, stadium 36, ball 37,
|
||||
# badge 39, logo 40), which is what the importer gates on. A league logo has no
|
||||
# equipped slot, so it is owned as generic `misc` content.
|
||||
STAGING_CLUB_ITEMS = [
|
||||
# (slot, owned_id, card_id, resource_id, kind, subtype, card_asset_id, team_id)
|
||||
("badge", "owned-a-badge", "fifa17_6000005", 6_000_005, "badge", 11, 39, 21),
|
||||
("ball", "owned-a-ball", "fifa17_8120194", 8_120_194, "ball", 30, 37, None),
|
||||
("stadium", "owned-a-stadium", "fifa17_6200000", 6_200_000, "stadium", 10, 36, None),
|
||||
(None, "owned-a-leaguelogo", "fifa17_8010015", 8_010_015, "misc", 31, 40, None),
|
||||
]
|
||||
|
||||
# The club manager. FIFA refuses to start a match without one ("your player or
|
||||
# managers contracts have expired"), and NEITHER club owns a manager: the real
|
||||
# import has 1992 players and exactly 3 staff items, all coaches (2 fitness, 1 GK),
|
||||
@@ -527,6 +545,37 @@ def materialise(lay: Layout) -> None:
|
||||
"team_id": KIT_TEAM_ID,
|
||||
}
|
||||
|
||||
for _slot, _owned, card_id, resource_id, kind, subtype, art, team in STAGING_CLUB_ITEMS:
|
||||
if card_id not in existing:
|
||||
definitions.append({
|
||||
"id": card_id,
|
||||
"name": kind.title(),
|
||||
"overall": 0,
|
||||
"position": "",
|
||||
"nation": "",
|
||||
"league": "",
|
||||
"club": "",
|
||||
"pace": 0,
|
||||
"shooting": 0,
|
||||
"passing": 0,
|
||||
"dribbling": 0,
|
||||
"defending": 0,
|
||||
"physical": 0,
|
||||
"rarity": "bronze",
|
||||
"image_path": None,
|
||||
})
|
||||
entry = {
|
||||
"asset_id": resource_id,
|
||||
"version": 0,
|
||||
"rareflag": 0,
|
||||
"kind": kind,
|
||||
"subtype": subtype,
|
||||
"card_asset_id": art,
|
||||
}
|
||||
if team is not None:
|
||||
entry["team_id"] = team
|
||||
catalog["cards"][card_id] = entry
|
||||
|
||||
mgr = STAGING_MANAGER
|
||||
if mgr["card_id"] not in existing:
|
||||
definitions.append({
|
||||
@@ -924,6 +973,11 @@ def seed_core_db(lay: Layout, real_club: dict | None) -> None:
|
||||
TS,
|
||||
)
|
||||
)
|
||||
owned.extend(
|
||||
(owned_id, seller_club, card_id, kind, TS)
|
||||
for _slot, owned_id, card_id, _rid, kind, _st, _art, _team
|
||||
in STAGING_CLUB_ITEMS
|
||||
)
|
||||
if real_club is None:
|
||||
owned = (
|
||||
[(item, SELLER_CLUB, card, "player", TS) for item, card in SELLER_SQUAD_CARDS]
|
||||
@@ -960,6 +1014,14 @@ def seed_core_db(lay: Layout, real_club: dict | None) -> None:
|
||||
[
|
||||
(seller_club, f"{slot}_kit", owned_id, TS)
|
||||
for slot, owned_id, _card_id, _resource_id in STAGING_KITS
|
||||
]
|
||||
# badge / ball / stadium are slot-keyed exactly like the kits.
|
||||
# A league logo has no slot, so it stays owned-but-unequipped —
|
||||
# which is itself worth exercising.
|
||||
+ [
|
||||
(seller_club, slot, owned_id, TS)
|
||||
for slot, owned_id, _c, _r, _k, _s, _a, _t in STAGING_CLUB_ITEMS
|
||||
if slot is not None
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user