feat: Implement high-value room revisit feature and enhance fudai tracking

- Added tracking for previously seen fudai in Runner and ProcRunner classes to avoid duplicate recognition.
- Extracted room title during fudai recognition for better tracking.
- Updated high_value_rooms.json with new room entries and adjusted total count.
- Introduced new GUI elements for configuring icon coordinates in webui.
- Created comprehensive documentation for the high-value room revisit functionality.
- Added tests for delay settings and icon detection logic to ensure functionality.
- Implemented a tool for analyzing step times in logs to identify performance bottlenecks.
This commit is contained in:
Your Name committed 2026-01-08 14:27:38 +08:00
1 parent 47e1a0cb2c
commit b3011dd9ce
26 files changed
+1978 -1118

No files matched your search

+15 -2
View File
@@ -133,6 +133,9 @@ class ProcRunner:
self._wins: list[dict] = []
self._wins_cap: int = 200
# 已记录福袋识别的跟踪(避免同一个直播间同一个福袋重复记录识别次数)
self._recorded_fudai_seen: set[tuple[str, str]] = set() # (room_title, fudai_content)
def _reload_log_settings(self) -> None:
"""从 config.json 读取日志设置:统一文件路径 + Web GUI 内存缓存上限。"""
try:
@@ -302,6 +305,7 @@ class ProcRunner:
# --- 福袋:抽取"最近一次"识别到的信息 ---
# 支持多种格式:旧格式"福袋内容:"和新格式"字段_内容="或"内容="
content_extracted = False
room_title = ""
if "福袋内容:" in s:
self._fudai_last["content"] = (
s.split("福袋内容:", 1)[1].strip().split()[0]
@@ -316,9 +320,18 @@ class ProcRunner:
self._fudai_last["updated_ts"] = time.time()
content_extracted = True
# 提取直播间标题
m = re.search(r"room_title[=:]\s*([^\s,]+)", s)
if m:
room_title = m.group(1).strip()
if content_extracted:
self._inc("fudai_seen")
self._record_event("fudai_seen", self._snapshot_fudai())
fudai_content = self._fudai_last.get("content", "")
key = (room_title, fudai_content)
if key not in self._recorded_fudai_seen:
self._recorded_fudai_seen.add(key)
self._inc("fudai_seen")
self._record_event("fudai_seen", self._snapshot_fudai())
# 参与人数:支持多种格式
m = re.search(r"(?:字段_)?参与人数[=:]?\s*(\d+)", s)