{"record":{"id":"4b7e96987c181ccb","repo":"babalae/better-genshin-impact","slug":"error-4b7e96","errorCode":null,"errorMessage":"导航到地脉花失败：超时未检测到奖励或交互文字","messagePattern":"导航到地脉花失败：超时未检测到奖励或交互文字","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":1465,"sourceCode":"            Simulation.SendInput.Mouse.MiddleButtonClick();\n            await Delay(300, _ct);\n\n            if (await NavigateTowardReward(60000))\n            {\n                _logger.LogInformation(\"已到达领取奖励页面\");\n                return;\n            }\n\n            Simulation.SendInput.SimulateAction(GIActions.MoveForward, KeyType.KeyUp);\n            Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_X);\n            await Delay(500, _ct);\n            Simulation.SendInput.SimulateAction(GIActions.MoveBackward, KeyType.KeyDown);\n            await Delay(1000, _ct);\n            Simulation.SendInput.SimulateAction(GIActions.MoveBackward, KeyType.KeyUp);\n            await Delay(500, _ct);\n        }\n\n        throw new Exception(\"导航到地脉花失败：超时未检测到奖励或交互文字\");\n    }\n\n    private async Task<bool> NavigateTowardReward(int timeoutMs)\n    {\n        var start = DateTime.UtcNow;\n        try\n        {\n            while ((DateTime.UtcNow - start).TotalMilliseconds < timeoutMs)\n            {\n                // If reward UI is detected, stop moving.\n                if (await DetectRewardPage())\n                {\n                    _logger.LogInformation(\"检测到奖励/交互文字，停止导航\");\n                    return true;\n                }\n\n                using var capture = CaptureToRectArea();\n                if (_paimonMenuRo != null && capture.Find(_paimonMenuRo).IsEmpty())","sourceCodeStart":1447,"sourceCodeEnd":1483,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L1447-L1483","documentation":"Thrown by AutoNavigateToReward (the navigation loop) when it runs for the full timeoutMs without detecting either the reward page or an interaction text. The character kept moving but never reached a confirmable interaction.","triggerScenarios":"The while-loop in the navigation method runs until (DateTime.UtcNow - start).TotalMilliseconds >= timeoutMs with no DetectRewardPage success and no interaction text found; it then presses X / moves back as cleanup and throws.","commonSituations":"Character stuck against terrain; blossom not actually nearby after teleport; vision/OCR failing to detect the interaction prompt; timeout too short for the distance.","solutions":["Increase the navigation timeout passed to the method.","Verify the character starts close to the blossom (check the teleport/route node).","Ensure resolution and OCR quality so the interaction text is readable.","Clear obstacles / use a route node that places the character in the open."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await AutoNavigateToReward(timeoutMs); }\ncatch (Exception ex) when (ex.Message.Contains(\"导航到地脉花失败\"))\n{\n    _logger.LogWarning(\"导航超时，重试一次: {Msg}\", ex.Message);\n    await AutoNavigateToReward(timeoutMs * 2);\n}","preventionTips":["Size the navigation timeout to the worst-case distance from the teleport.","Make sure the character starts in the open near the blossom.","Keep resolution/OCR quality high so interaction text is detected promptly."],"tags":["timeout","navigation","vision-recognition","ley-line"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}