babalae/better-genshin-impact · error · RetryException

未检测进入游戏界面

Error message

未检测进入游戏界面

What it means

Thrown by ExitAndReloginJob after NewRetry.WaitForElementAppear fails to find the 'EnterGame' template within 120 attempts at 1000ms each (~2 minutes). It marks the point where the relogin flow expected the game's 'click to enter' screen but never saw it.

Source

Thrown at BetterGenshinImpact/GameTask/Common/Job/ExitAndReloginJob.cs:86

        if (_login3rdParty is { Type: Login3rdParty.The3rdPartyType.Bilibili, IsAvailabled: true })
        {
            // await Delay(1, ct);
            Thread.Sleep(100);
            _login3rdParty.Login(ct);
            Logger.LogInformation("退出重登启用 B 服模式");
        }

        // 等待进入游戏按钮出现并点击
        var enterGameAppear = await NewRetry.WaitForElementAppear(
            GetAutoWoodRecognitionObject("EnterGame"),
            () => { },
            ct,
            120,
            1000
        );
        if (!enterGameAppear)
        {
            throw new RetryException("未检测进入游戏界面");
        }

        // 点击进入游戏按钮直到它消失
        var waitForEnterGameRoDisappear = await NewRetry.WaitForElementDisappear(
            GetAutoWoodRecognitionObject("EnterGame"),
            () => GameCaptureRegion.GameRegion1080PPosClick(955, 666),
            ct,
            120,
            1000
        );
        if (!waitForEnterGameRoDisappear)
        {
            throw new RetryException("未检测到进入游戏按钮消失, 可能未点击成功");
        }


        // 等待主界面出现
        var mainUiFound = await NewRetry.WaitForElementAppear(

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Refresh the EnterGame template asset to match the current game version.
  2. Verify the 3rd-party login (Bilibili) completed; check _login3rdParty.Login did not silently fail.
  3. Confirm the capture region and scale are correct after the game restart.
  4. Increase retry count or add manual-intervention logging for the stuck frame.

Example fix

null
Defensive patterns

Strategy: retry

Validate before calling

null

Type guard

null

Try / catch

try { await job.Run(ct); }
catch (RetryException e) when (e.Message == "未检测进入游戏界面")
{ /* verify 3rd-party login completed and the EnterGame template is current, then retry */ }

Prevention

When it happens

Trigger: GetAutoWoodRecognitionObject("EnterGame") template is not matched on any captured frame during the 120×1000ms retry window. Happens if the game never reached the enter screen (stuck on a loading/error/login-3rd-party step), or the template image no longer matches the current game art.

Common situations: Bilibili 3rd-party login hung before the enter screen; a game update changed the enter-button art so the template fails; the game showed an announcement or popup overlay covering the button; capture region/scale changed after restart.

Related errors


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/c15427c920f89cd7. Report an issue: GitHub.