fifa17-recon: take running-backend versions of 8 runtime files (direction fix)
The earlier reconcile committed the local working-tree versions of these files, which are OLDER than the deployed backend. The running container (C) is byte-identical to docker/fifa17-python/tools (B) and is a strict superset: it adds profile_path_for/select_account/ensure_security_question (fut_store), safe_header_for_log/safe_request_path/security_question_route (utas_server), account_sync_route/_match_call/match_ready_body, plus POW balance fields and match lifecycle support, with zero unique local functions lost. Reconciled tree is now a strict superset of B with every shared file byte-identical; verified via md5 map (0 missing, 0 differing).
This commit is contained in:
@@ -11,6 +11,8 @@ Guards the two things that would silently break the loop:
|
||||
* `destroy_match_body()` drifting from FutDestroyMatchServerResponse
|
||||
(deser 0x180121b60): a non-scalar there is the freeze class at 0x1801c7f1a,
|
||||
and a renamed key is silently SKIP'd, i.e. the reward vanishes with no error.
|
||||
* the shared base `/match` path distinguishing CREATEMATCH from PLAYGAME by
|
||||
the body-level matchId that CardsDLL serializes for subsequent operations
|
||||
|
||||
Run: python3 tools/test_match_rewards.py (exit 0 = pass)
|
||||
"""
|
||||
@@ -152,9 +154,37 @@ def test_payout_table():
|
||||
check("draw pays >= loss", U.MATCH_COINS["draw"] >= U.MATCH_COINS["loss"])
|
||||
|
||||
|
||||
def test_match_call_classification():
|
||||
"""CREATEMATCH and PLAYGAME share a path; only the latter has a matchId."""
|
||||
cases = (
|
||||
("/ut/game/fifa17/match", "POST", {}, "create"),
|
||||
("/ut/game/fifa17/match", "POST", {"matchId": 1234}, "play"),
|
||||
("/ut/game/fifa17/match/ready", "POST", {"matchId": 1234}, "ready"),
|
||||
("/ut/game/fifa17/match/end", "POST", {"matchId": 1234}, "end"),
|
||||
("/ut/game/fifa17/match/reset", "PUT", {"matchId": 1234}, "reset"),
|
||||
("/ut/game/fifa17/match/keepalive", "POST", {"matchId": 1234}, "keepalive"),
|
||||
)
|
||||
for path, method, body, want in cases:
|
||||
got = U._match_call(path, method, body)
|
||||
check("%s %s -> %s" % (method, path, want), got == want, "got %s" % got)
|
||||
|
||||
|
||||
def test_match_ready_body():
|
||||
"""FutMatchReadyServerResponse parses these two scalar identifiers."""
|
||||
body = U.match_ready_body(1234, 33068179)
|
||||
check("ready echoes matchId", body.get("matchId") == 1234, repr(body))
|
||||
check("ready has opponentPersonaId", body.get("opponentPersonaId") == 33068179,
|
||||
repr(body))
|
||||
check("ready IDs are scalar ints",
|
||||
all(isinstance(v, int) and not isinstance(v, bool) for v in body.values()),
|
||||
repr(body))
|
||||
check("ready omits unproven nested items", "items" not in body, repr(body))
|
||||
|
||||
|
||||
def main():
|
||||
for t in (test_result_detection, test_reward_body,
|
||||
test_end_reason_is_authoritative, test_payout_table):
|
||||
test_end_reason_is_authoritative, test_payout_table,
|
||||
test_match_call_classification, test_match_ready_body):
|
||||
try:
|
||||
t()
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user