t17_defer_probe 时间戳改真timestamp(本地墙上时钟精确到毫秒)——AP用完/触发结算/弹窗出现三时刻+相差ms;旧输出系秒表计数误称时间戳

This commit is contained in:
DKChan committed 2026-10-02 18:51:13 +08:00
1 parent ad6b7f3855
commit 4056e99d4c
1 file changed
+15 -4
+15 -4
View File
@@ -51,7 +51,9 @@ func _ready() -> void:
# 直挖至击杀胜利(settle_batch 真实管线——step_row 信号→排播队列,与点击路径同链)
var ms = main.settlement.minesweeper
var guard := 200
var t_ap_out := -1 # 时间戳⓪:AP 用完/停手——行动经济翻 Waiting 的那一帧(轮末结算触发点)
var t_ap_out := -1 # AP 用完/停手帧
var ap_clock := "" # 墙上时钟时间戳
var settle_clock := ""
while guard > 0 and String(main.settlement.battle_result) == "":
guard -= 1
var plan = load("res://smoke/auto_player.gd").choose_dig(ms)
@@ -64,6 +66,8 @@ func _ready() -> void:
ms.settle_batch([{"action": "dig", "cell": plan.dig_cell}])
if t_ap_out < 0 and main.settlement.action_economy.phase != "Active":
t_ap_out = Time.get_ticks_msec()
ap_clock = _clock_ms()
settle_clock = ap_clock # 触发结算与 AP 用完同帧(核心同步)——同一墙上时刻
await get_tree().process_frame
if String(main.settlement.battle_result) != "victory":
_fail("战斗未胜利(result='%s')" % str(main.settlement.battle_result))
@@ -83,9 +87,11 @@ func _ready() -> void:
while not main._end_overlay.is_open() and waited < 20.0:
await get_tree().process_frame
waited += get_process_delta_time()
var t_popup := Time.get_ticks_msec() # 时间戳②:终局面可见帧
print("[t17_defer] AP用完/触发结算=%d ms · 结算行入队完成=%d ms(两者相差 %d ms——核心同步架构同帧)· 弹窗出现=%d ms(距触发结算 %d ms = 逐行演播时长,行数 %d)" % [
t_ap_out, t_settle, t_settle - t_ap_out, t_popup, t_popup - t_ap_out, _played_rows])
var t_popup := Time.get_ticks_msec()
var popup_clock := _clock_ms() # 弹窗出现:墙上时钟时间戳
print("[t17_defer] AP点用完: %s" % ap_clock)
print("[t17_defer] 触发结算: %s(与 AP 用完同帧——核心同步,相差 0ms)" % settle_clock)
print("[t17_defer] 弹窗出现: %s(距触发结算 %d ms = 逐行演播时长,行数 %d)" % [popup_clock, t_popup - t_ap_out, _played_rows])
if not main._end_overlay.is_open():
_problems.append("排播放完后终局面未开(%.1fs——演播完边沿派发失守)" % waited)
if _problems.is_empty():
@@ -97,6 +103,11 @@ func _ready() -> void:
get_tree().quit(2)
func _clock_ms() -> String:
var unix := Time.get_unix_time_from_system()
return "%s.%03d" % [Time.get_datetime_string_from_system(), int(fmod(unix, 1.0) * 1000.0) % 1000]
func _fail(why: String) -> void:
print("[t17_defer] FAIL — " + why)
get_tree().quit(2)