fifa17 store: make reward packs (SBC/draft/season/...) openable
SBC completion and the other Core reward services grant packs with symbolic
definition_ids ("silver_pack", "gold_pack", ...). The FIFA 17 pack system keys
entirely on numeric catalogue ids, and entitlement_pack_ids / handle_pack_open
resolved definition_ids with definition_id.parse::<u64>(), so every symbolic
reward pack was silently dropped from the openable My Packs list. The unopened
count (recoveredPacks, = entitlement count) still counted them, so the client
showed "you have N packs" but had no tile to open -> "no pack available".
Fix (adapter-layer, Core stays game-neutral): add owned-only reward pack
catalogue entries 71-75 (bronze/silver/gold/rare_gold/icon) and a resolver
owned_pack_id_for_definition() that maps both numeric owned ids and the symbolic
reward names to their numeric owned-only pack. entitlement_pack_ids and the
pack-open entitlement selection now use it, so reward packs render as openable
My Packs tiles and redeem their entitlement for free (consume-once, no debit).
Server-verified on staging: 3 Core reward entitlements now render 3 openable
mypacks tiles matching recoveredPacks=3. Tests: adapter resolver + rendering,
host symbolic-reward open flow; full adapter + host suites green.
This commit is contained in:
@@ -73,7 +73,9 @@ use openfut_adapter_fifa17::fut::squad_projection::{
|
||||
project_squad, squad_list, user_mass_info_squad, ProjectionSlot, SquadExtInput,
|
||||
SquadProjection, SquadProjectionInput,
|
||||
};
|
||||
use openfut_adapter_fifa17::fut::store_catalog::build_purchasegroup;
|
||||
use openfut_adapter_fifa17::fut::store_catalog::{
|
||||
build_purchasegroup, owned_pack_id_for_definition,
|
||||
};
|
||||
use openfut_adapter_fifa17::fut::store_session::{
|
||||
validate_capability, SessionStore, StoreMode, SENTINEL_PACK_ID,
|
||||
};
|
||||
@@ -2216,11 +2218,14 @@ pub fn handle_credits(econ: &dyn CoreEconomy) -> WireResponse {
|
||||
}
|
||||
}
|
||||
|
||||
/// Map Core entitlements to FIFA unopened pack ids (definition_id parsed as the
|
||||
/// numeric pack id; unparseable entries are skipped, never faked).
|
||||
/// Map Core entitlements to FIFA 17 unopened pack ids. `definition_id` is either
|
||||
/// a numeric owned-only pack id (imported entitlements) or a symbolic reward-pack
|
||||
/// name granted by Core's reward services; both resolve via
|
||||
/// [`owned_pack_id_for_definition`]. Unresolvable entitlements are skipped, never
|
||||
/// faked.
|
||||
fn entitlement_pack_ids(ents: &[EconomyEntitlement]) -> Vec<u64> {
|
||||
ents.iter()
|
||||
.filter_map(|e| e.definition_id.parse::<u64>().ok())
|
||||
.filter_map(|e| owned_pack_id_for_definition(&e.definition_id))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user