babalae/better-genshin-impact · error · TimeoutException

单次传送超过 {TeleportTimeoutMs / 1000} 秒

Error message

单次传送超过 {TeleportTimeoutMs / 1000} 秒

What it means

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.

Source

Thrown at BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs:1200

            await Delay(BigMapOpenCheckIntervalMs, ct);
        }

        return false;
    }


    public async Task<(double, double)> Tp(double tpX, double tpY, string mapName = "Teyvat", bool force = false)
    {
        using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
        timeoutCts.CancelAfter(TeleportTimeoutMs);
        try
        {
            return await new TpTask(timeoutCts.Token).TpWithRetries(tpX, tpY, mapName, force);
        }
        catch (OperationCanceledException e) when (!ct.IsCancellationRequested && timeoutCts.IsCancellationRequested)
        {
            throw new TimeoutException($"单次传送超过 {TeleportTimeoutMs / 1000} 秒", e);
        }
    }

    private async Task<(double, double)> TpWithRetries(double tpX, double tpY, string mapName, bool force)
    {
        for (var i = 0; i < 3; i++)
        {
            try
            {
                return await TpOnce(tpX, tpY, mapName, force);
            }
            catch (TpPointNotActivate e)
            {
                // 未激活点位的详情面板会遮挡后续地图操作,重试前先关闭。
                // 最后一次失败也需要执行清理,避免影响脚本组中的下一个任务。
                Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_ESCAPE);
                await Delay(300, ct);
                // throw; // 不抛出异常,继续重试

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Retry the overall task — transient map-loading stalls are common.
  2. Ensure input injection (key + mouse) reaches Genshin (focus, privileges).
  3. Run at 1920x1080 so detection loops converge faster (fewer pan/zoom retries).
  4. If consistently timing out, raise TeleportTimeoutMs for slow hardware.
  5. Check the game is not paused, in a loading screen, or blocked by an overlay during teleport.
Defensive patterns

Strategy: retry

Try / catch

try { await tp.Tp(x, y, mapName, force); }
catch (TimeoutException e) when (e.Message.Contains("单次传送超过"))
{ /* single TP hung; return to main UI and retry the whole route */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


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