feat(match): 同步比赛计时与装甲板扣血许可
- feat(client): 增加裁判比赛计时、技术暂停与选手端局域网同步 - feat(armor): 红蓝共用通用固件,按客户端选队并显示网络连接状态 - feat(armor): 仅在对局进行中允许扣血,其他阶段保留受击闪烁 - feat(client): 将计时置于血条中间并增加开赛前五秒全屏动画 - fix(client): 修复连续血条、对手镜像和图传断连灰度遮罩 - fix(client): 统一界面中文字体并整理各页面文案 - fix(maintenance): 备份迁移装甲板分区,恢复 SDK 构建与固件打包 - refactor(repo): 按 armor、vt 和 client 整理工程与脚本,移除旧参考实现 - test: 补充线路、受击许可、回环 UDP、维护和 HUD 验证 - docs: 同步构建、协议、比赛控制和硬件验证边界 验证:前端构建与 19 项相关测试通过;核心 91 项单元测试与 2 项回环 UDP 集成测试通过;装甲板规则 25 项、线路 26 项、Tauri 51 项测试通过;独立探测器 5 项与目录回归 4 项通过。完成 C3 两组阈值实际编译、导出与 ZIP 校验,检查 900×600 / 1280×720 页面、倒计时和随包中文字体。 未执行烧录、板上运行、跨电脑广播或硬件稳定性验证。
This commit is contained in:
581 files changed
+6596
-7683
No files matched your search
@@ -0,0 +1,28 @@
|
||||
"""离线检查独立探测器的线路字节,不连接设备。"""
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
spec = importlib.util.spec_from_file_location("armor_probe", Path(__file__).with_name("probe.py"))
|
||||
probe = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(probe)
|
||||
|
||||
class WireTests(unittest.TestCase):
|
||||
def test_control_golden(self):
|
||||
self.assertEqual(probe.encode_control(0x12345678, 1).hex(),
|
||||
"3143564d060100" + "00" * 20 + "7856341201")
|
||||
def test_control_rejects_wrong_team(self):
|
||||
with self.assertRaises(ValueError): probe.encode_control(1, 255)
|
||||
def test_unassigned_health(self):
|
||||
data = bytes.fromhex("3143564d05010078563412" + "00" * 16 + "ff036400")
|
||||
self.assertEqual(probe.decode(data), (255, 3, 100, 0x12345678, 1))
|
||||
def test_control_is_not_health(self):
|
||||
self.assertIsNone(probe.decode(probe.encode_control(1, 0)))
|
||||
def test_damage_control_golden(self):
|
||||
packet = bytes.fromhex("3143564d080100" + "00" * 20 + "78563412" + "0807060504030201" + "0200000000000000" + "01")
|
||||
self.assertEqual(probe.decode_damage_control(packet), (0x12345678, 0x0102030405060708, 2, True))
|
||||
self.assertEqual(probe.decode_damage_control(packet[:-1] + b'\x00')[-1], False)
|
||||
self.assertIsNone(probe.decode(packet))
|
||||
for invalid in (packet[:-1], packet + b'\x00', packet[:-1] + b'\x02', packet[:31] + bytes(8) + packet[39:]):
|
||||
self.assertIsNone(probe.decode_damage_control(invalid))
|
||||
|
||||
if __name__ == "__main__": unittest.main()
|
||||
Reference in new issue
Block a user