{"record":{"id":"86f906489458c65e","repo":"babalae/better-genshin-impact","slug":"teleporttimeoutms-1000","errorCode":null,"errorMessage":"单次传送超过 {TeleportTimeoutMs / 1000} 秒","messagePattern":"单次传送超过 (.+?) 秒","errorType":"exception","errorClass":"TimeoutException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":1200,"sourceCode":"\n            await Delay(BigMapOpenCheckIntervalMs, ct);\n        }\n\n        return false;\n    }\n\n\n    public async Task<(double, double)> Tp(double tpX, double tpY, string mapName = \"Teyvat\", bool force = false)\n    {\n        using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(ct);\n        timeoutCts.CancelAfter(TeleportTimeoutMs);\n        try\n        {\n            return await new TpTask(timeoutCts.Token).TpWithRetries(tpX, tpY, mapName, force);\n        }\n        catch (OperationCanceledException e) when (!ct.IsCancellationRequested && timeoutCts.IsCancellationRequested)\n        {\n            throw new TimeoutException($\"单次传送超过 {TeleportTimeoutMs / 1000} 秒\", e);\n        }\n    }\n\n    private async Task<(double, double)> TpWithRetries(double tpX, double tpY, string mapName, bool force)\n    {\n        for (var i = 0; i < 3; i++)\n        {\n            try\n            {\n                return await TpOnce(tpX, tpY, mapName, force);\n            }\n            catch (TpPointNotActivate e)\n            {\n                // 未激活点位的详情面板会遮挡后续地图操作，重试前先关闭。\n                // 最后一次失败也需要执行清理，避免影响脚本组中的下一个任务。\n                Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_ESCAPE);\n                await Delay(300, ct);\n                // throw; // 不抛出异常，继续重试","sourceCodeStart":1182,"sourceCodeEnd":1218,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L1182-L1218","documentation":"TimeoutException from Tp when the linked cancellation token (timeoutCts, CancelAfter(TeleportTimeoutMs=60_000)) fires before TpWithRetries completes, and the parent token ct is NOT cancelled. A single teleport sequence taking over 60s is treated as hung. The original OperationCanceledException is wrapped as the inner exception.","triggerScenarios":"TpWithRetries → TpOnce stuck in a zoom/click/wait loop that never converges; map-loading hangs; WaitForTeleportPanelAndConfirm looping the full panel timeout on every retry; input injection stalled so map never opens. Anything in the teleport pipeline exceeding the 60s budget.","commonSituations":"Slow/struggling machine where map open + zoom + click + panel wait > 60s; teleport point at an extreme edge needing many pan retries; game paused/frozen mid-teleport; input not reaching the game so each retry burns the full timeout.","solutions":["Retry the overall task — transient map-loading stalls are common.","Ensure input injection (key + mouse) reaches Genshin (focus, privileges).","Run at 1920x1080 so detection loops converge faster (fewer pan/zoom retries).","If consistently timing out, raise TeleportTimeoutMs for slow hardware.","Check the game is not paused, in a loading screen, or blocked by an overlay during teleport."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await tp.Tp(x, y, mapName, force); }\ncatch (TimeoutException e) when (e.Message.Contains(\"单次传送超过\"))\n{ /* single TP hung; return to main UI and retry the whole route */ }","preventionTips":["Ensure input injection reaches the game so teleport steps converge fast.","Run at 1920x1080 to minimize pan/zoom retries inside the TP pipeline.","Raise TeleportTimeoutMs on slow hardware; confirm the game is not paused/loading."],"tags":["teleport","timeout","retry","big-map","cancellation"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}