merge: 真时间戳
This commit is contained in:
commit
725f0ac833
1 file changed
+15
-4
@@ -51,7 +51,9 @@ func _ready() -> void:
|
|||||||
# 直挖至击杀胜利(settle_batch 真实管线——step_row 信号→排播队列,与点击路径同链)
|
# 直挖至击杀胜利(settle_batch 真实管线——step_row 信号→排播队列,与点击路径同链)
|
||||||
var ms = main.settlement.minesweeper
|
var ms = main.settlement.minesweeper
|
||||||
var guard := 200
|
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) == "":
|
while guard > 0 and String(main.settlement.battle_result) == "":
|
||||||
guard -= 1
|
guard -= 1
|
||||||
var plan = load("res://smoke/auto_player.gd").choose_dig(ms)
|
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}])
|
ms.settle_batch([{"action": "dig", "cell": plan.dig_cell}])
|
||||||
if t_ap_out < 0 and main.settlement.action_economy.phase != "Active":
|
if t_ap_out < 0 and main.settlement.action_economy.phase != "Active":
|
||||||
t_ap_out = Time.get_ticks_msec()
|
t_ap_out = Time.get_ticks_msec()
|
||||||
|
ap_clock = _clock_ms()
|
||||||
|
settle_clock = ap_clock # 触发结算与 AP 用完同帧(核心同步)——同一墙上时刻
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
if String(main.settlement.battle_result) != "victory":
|
if String(main.settlement.battle_result) != "victory":
|
||||||
_fail("战斗未胜利(result='%s')" % str(main.settlement.battle_result))
|
_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:
|
while not main._end_overlay.is_open() and waited < 20.0:
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
waited += get_process_delta_time()
|
waited += get_process_delta_time()
|
||||||
var t_popup := Time.get_ticks_msec() # 时间戳②:终局面可见帧
|
var t_popup := Time.get_ticks_msec()
|
||||||
print("[t17_defer] AP用完/触发结算=%d ms · 结算行入队完成=%d ms(两者相差 %d ms——核心同步架构同帧)· 弹窗出现=%d ms(距触发结算 %d ms = 逐行演播时长,行数 %d)" % [
|
var popup_clock := _clock_ms() # 弹窗出现:墙上时钟时间戳
|
||||||
t_ap_out, t_settle, t_settle - t_ap_out, t_popup, t_popup - t_ap_out, _played_rows])
|
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():
|
if not main._end_overlay.is_open():
|
||||||
_problems.append("排播放完后终局面未开(%.1fs——演播完边沿派发失守)" % waited)
|
_problems.append("排播放完后终局面未开(%.1fs——演播完边沿派发失守)" % waited)
|
||||||
if _problems.is_empty():
|
if _problems.is_empty():
|
||||||
@@ -97,6 +103,11 @@ func _ready() -> void:
|
|||||||
get_tree().quit(2)
|
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:
|
func _fail(why: String) -> void:
|
||||||
print("[t17_defer] FAIL — " + why)
|
print("[t17_defer] FAIL — " + why)
|
||||||
get_tree().quit(2)
|
get_tree().quit(2)
|
||||||
|
|||||||
Reference in new issue
Block a user