chore(client): 增加调试日志以导出 NBT stop 结构

用于排查非停站指令(如设置最高速度、新建时刻表区段)的 NBT 结构,
以便后续在代码中精准过滤这些非车站指令。
This commit is contained in:
2026-08-03 11:28:32 +08:00
parent eb018dbae9
commit 439ed9ea3c
+11 -1
View File
@@ -1,6 +1,6 @@
-- 1. Configuration & Constants
local APP_VERSION_TEXT = "v1.0.51"
local APP_VERSION_TEXT = "v1.0.52"
local CONFIG = {
CLOUD_URL = "ws://stabadmin.fse-media.group",
@@ -2626,6 +2626,16 @@ function Main.loop()
cleanupTimestampMap(State.announcedAlerts, now, tonumber(CONFIG.ALERT_COOLDOWN_MS) or 300000)
for i, stop in ipairs(data.TrainStops) do
-- [DEBUG] Dump first stop to file for inspection
if i == 1 and not State.dumpedStop then
State.dumpedStop = true
local f = fs.open("stop_dump.json", "w")
if f then
f.write(textutils.serializeJSON(stop))
f.close()
Utils.log("DEBUG", "Dumped stop structure to stop_dump.json")
end
end
local st = stop.Station
if st then
local trainName = st.TrainName or "Unknown"