Port native AVA2 itemshop with transactional purchases and verified catalogue

This commit is contained in:
shen
2026-10-19 07:08:51 -07:00
parent abda2c1cda
commit 32831010c0
21 changed files with 2676 additions and 8 deletions
+4 -2
View File
@@ -103,8 +103,10 @@ if cpacket.is_file():
assert 'static_assert(sizeof(TPacketCGSwitchbot) == 7 && sizeof(TPacketGCSwitchbot) == 7,' in client
stream=(CLIENT/'PythonNetworkStreamPhaseGame.cpp').read_bytes().decode('latin1')
# the EU branch (the one every locale.cfg build takes) keeps 1215955205 first for the atoi version check
assert 'strncpy(kVersionPacket.timestamp, "1215955205 mt20261019", sizeof(kVersionPacket.timestamp)-1);' in stream
assert 'strncpy(kVersionPacket.timestamp, "mt20261019", sizeof(kVersionPacket.timestamp)-1);' in stream
modern=re.search(r'strncpy\(kVersionPacket.timestamp, "1215955205 mt(\d{8})"',stream)
legacy=re.search(r'strncpy\(kVersionPacket.timestamp, "mt(\d{8})"',stream)
assert modern and legacy and modern.group(1)==legacy.group(1)
assert int(modern.group(1))>=20261016 # switchbot gate; newer features may advance this revision
pyswitch=(CLIENT/'PythonSwitchbot.h').read_bytes().decode('latin1')
ctable=pyswitch[pyswitch.index('struct TSwitchbotTable'):];ctable=ctable[:ctable.index('};')]
assert re.findall(r'^\s*[A-Za-z_][\w:]*\s+(\w+)(?:\[[^;]*\])?;',ctable,re.M)==table,ctable