{"record":{"id":"343d20eaa5464349","repo":"babalae/better-genshin-impact","slug":"error-343d20","errorCode":null,"errorMessage":"地图追踪文件加载失败","messagePattern":"地图追踪文件加载失败","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/Common/Job/GoToAdventurersGuildTask.cs","lineNumber":161,"sourceCode":"        if (Bv.IsInTalkUi(talkUiCapture))\n        {\n            await _chooseTalkOptionTask.SelectLastOptionUntilEnd(ct);\n            Logger.LogInformation(\"退出当前对话\");\n        }\n    }\n\n    /// <summary>\n    /// 前往冒险家协会\n    /// </summary>\n    /// <param name=\"country\"></param>\n    /// <param name=\"ct\"></param>\n    /// <returns></returns>\n    public async Task GoToAdventurersGuild(string country, CancellationToken ct)\n    {\n        var task = PathingTask.BuildFromFilePath(Global.Absolute(@$\"GameTask\\Common\\Element\\Assets\\Json\\冒险家协会_{country}.json\"));\n        if (task == null)\n        {\n            throw new Exception(\"地图追踪文件加载失败\");\n        }\n        var pathingTask = new PathExecutor(ct)\n        {\n            PartyConfig = new PathingPartyConfig\n            {\n                Enabled = true,\n                AutoSkipEnabled = true\n            },\n            EndAction = region => Bv.FindFAndPress(region, text: this.catherineLocalizedString)\n        };\n        await pathingTask.Pathing(task);\n\n        await Delay(600, ct);\n\n        const int retryTalkTimes = 3;\n        for (int i = 0; i < retryTalkTimes; i++)\n        {\n            using var ra = CaptureToRectArea();","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/Common/Job/GoToAdventurersGuildTask.cs#L143-L179","documentation":"Thrown by GoToAdventurersGuildTask.GoToAdventurersGuild when PathingTask.BuildFromFilePath returns null for the file GameTask\\Common\\Element\\Assets\\Json\\冒险家协会_{country}.json. A null return means the pathing JSON for the requested country could not be loaded.","triggerScenarios":"PathingTask.BuildFromFilePath(Global.Absolute(@$\"...\\冒险家协会_{country}.json\")) returns null. Occurs when the file does not exist for the given country value, the JSON is malformed, or Global.Absolute resolves to a path outside the deploy directory.","commonSituations":"The country argument is an unsupported/misspelled value (e.g. '璃月' vs '璃月港', or a region with no shipped JSON); the assets folder was not deployed with the build; the JSON was hand-edited and now fails schema deserialization; case/encoding mismatch in the filename on a case-sensitive or locale-affected FS.","solutions":["Check that GameTask/Common/Element/Assets/Json/冒险家协会_{country}.json exists for the country being requested.","Validate the country value against the set of shipped JSON files before calling BuildFromFilePath.","If the JSON exists, validate it parses (open it in the pathing editor / check schema) — BuildFromFilePath returns null on parse failure.","Confirm Global.Absolute resolves to the application base directory and the file is copied to output."],"exampleFix":"// before\nvar task = PathingTask.BuildFromFilePath(Global.Absolute(@$\"GameTask\\Common\\Element\\Assets\\Json\\冒险家协会_{country}.json\"));\nif (task == null)\n{\n    throw new Exception(\"地图追踪文件加载失败\");\n}\n\n// after: surface which file and why\nvar path = Global.Absolute(@$\"GameTask\\Common\\Element\\Assets\\Json\\冒险家协会_{country}.json\");\nvar task = PathingTask.BuildFromFilePath(path);\nif (task == null)\n{\n    throw new Exception($\"地图追踪文件加载失败：{path}（文件不存在或格式无效）\");\n}","handlingStrategy":"validation","validationCode":"var path = Global.Absolute(@$\"GameTask\\Common\\Element\\Assets\\Json\\冒险家协会_{country}.json\");\nif (!File.Exists(path))\n    throw new FileNotFoundException($\"冒险家协会路径文件缺失：{path}\", path);\nvar task = PathingTask.BuildFromFilePath(path) ?? throw new Exception(\"地图追踪文件加载失败：\" + path);","typeGuard":"static bool HasGuildPathing(string country) =>\n    File.Exists(Global.Absolute($\"GameTask/Common/Element/Assets/Json/冒险家协会_{country}.json\"));","tryCatchPattern":"null","preventionTips":["Whitelist the supported country values against the shipped JSON filenames.","Mark pathing JSON assets as CopyToOutputDirectory in the .csproj.","Validate JSON parses in the pathing editor before shipping."],"tags":["pathing","config","assets","file-io"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}