{"record":{"id":"5b348e3eb26e3d77","repo":"babalae/better-genshin-impact","slug":"error-5b348e","errorCode":null,"errorMessage":"切换到地表地图后校验超时","messagePattern":"切换到地表地图后校验超时","errorType":"exception","errorClass":"TimeoutException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":2534,"sourceCode":"\n                await Delay(retryInterval, ct);\n                continue;\n            }\n\n            if (!layerSwitchClicked)\n            {\n                undergroundButton.Click();\n                capture.MoveTo(capture.Width / 2, capture.Height / 2);\n                layerSwitchClicked = true;\n                await Delay(retryInterval, ct);\n                continue;\n            }\n\n            await Delay(retryInterval, ct);\n        }\n\n        Logger.LogWarning(\"切换到地表地图后校验超时\");\n        throw new TimeoutException(\"切换到地表地图后校验超时\");\n    }\n\n    public Task ClickTpPoint(\n        ImageRegion imageRegion,\n        GiTpPosition? targetTp = null,\n        string mapName = \"Teyvat\",\n        Rect bigMapInAllMapRect = default,\n        double targetX = double.NaN,\n        double targetY = double.NaN)\n    {\n        return ClickTpPoint(imageRegion, targetTp);\n    }\n\n    private async Task ClickTpPoint(\n        ImageRegion imageRegion,\n        GiTpPosition? targetTp)\n    {\n        var result = await HandleTeleportPanel(imageRegion, targetTp);","sourceCodeStart":2516,"sourceCodeEnd":2552,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L2516-L2552","documentation":"Thrown by SwitchToGroundMapLayerIfNeeded when the verification loop times out (MapGroundLayerSwitchTimeoutMs) after clicking the ground-layer button. The method polls for the underground button to disappear (indicating successful switch to surface), but if it never disappears within the timeout, a TimeoutException is thrown.","triggerScenarios":"Called from SwitchToGroundMapLayerIfNeeded. The while-loop runs until stopwatch exceeds MapGroundLayerSwitchTimeoutMs. Either the MapUndergroundToGroundButton or MapUndergroundSwitchButton detection doesn't transition as expected after clicking.","commonSituations":"Map layer switch animation is slow or stuck; the ground-layer button recognition template doesn't match; the game is in a state where layer switching isn't available; UI lag delays the transition beyond the timeout.","solutions":["Increase MapGroundLayerSwitchTimeoutMs to accommodate slower machines.","Verify the layer-switch button recognition assets match the current game UI.","Ensure the map is in a state where underground/ground layer switching is applicable.","Retry the operation; transient UI lag can cause a single timeout.","Check if the game is responsive and not in a loading state."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await task.SwitchToGroundMapLayerIfNeeded();\n}\ncatch (TimeoutException ex) when (ex.Message == \"切换到地表地图后校验超时\")\n{\n    Logger.LogWarning(\"Ground layer switch timed out. Retrying or skipping.\");\n    // Retry once or continue if ground layer is not critical\n}","preventionTips":["Increase MapGroundLayerSwitchTimeoutMs for slower machines.","Verify layer-switch button recognition assets match the current game UI.","Ensure the map is in a state where layer switching is available.","Retry the operation as transient UI lag can cause timeouts."],"tags":["map-navigation","layer-switch","timeout","ground-map"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}