egametang/ET · error · Exception

map copy not running: {mapInfo.MapName} {line1} {line2}

Error message

map copy not running: {mapInfo.MapName} {line1} {line2}

What it means

Thrown by MergeLinesComponent.MergeLines when either MapCopy line1 or line2 is not in MapCopyStatus.WaitMerge status. Line merging requires both copies to have been explicitly set to WaitMerge before the merge can proceed. If either copy is still Running, Finished, or in any other state, the merge is rejected.

Source

Thrown at Packages/cn.etetet.mapmanager/Scripts/Hotfix/Server/MergeLinesComponentSystem.cs:77

                    break;
                }
            }
        }
        
        // line2合并到line1
        public static async ETTask MergeLines(this MergeLinesComponent self, long line1, long line2)
        {
            MapInfo mapInfo = self.GetParent<MapInfo>();
            Log.Debug($"start merge lines: {mapInfo.MapName} {line1} {line2}");
         
            EntityRef<MapInfo> mapInfoRef = mapInfo;
            MapCopy mapCopy1 = mapInfo.GetChild<MapCopy>(line1);
            MapCopy mapCopy2 = mapInfo.GetChild<MapCopy>(line2);
            EntityRef<MapCopy> mapCopy1Ref = mapCopy1;

            if (mapCopy1.Status != MapCopyStatus.WaitMerge || mapCopy2.Status != MapCopyStatus.WaitMerge)
            {
                throw new Exception($"map copy not running: {mapInfo.MapName} {line1} {line2}");
            }
            
            MessageLocationSenderComponent messageLocationSender = self.Root().GetComponent<MessageLocationSenderComponent>();
            MessageLocationSenderOneType messageLocationSenderOneType = messageLocationSender.Get(LocationType.Unit);
            EntityRef<MessageLocationSenderOneType> messageLocationSenderOneTypeRef = messageLocationSenderOneType;
            // 通知传送
            foreach (long playerId in mapCopy2.Players.ToArray())
            {
                MapManager2Map_NotifyPlayerTransferRequest request = MapManager2Map_NotifyPlayerTransferRequest.Create();
                mapInfo = mapInfoRef;
                mapCopy1 = mapCopy1Ref;
                request.MapName = mapInfo.MapName;
                request.MapId = mapCopy1.Id;
                messageLocationSenderOneType = messageLocationSenderOneTypeRef;
                await messageLocationSenderOneType.Call(playerId, request);

                mapInfo = mapInfoRef;
                Log.Debug($"merge lines transfer: {mapInfo.MapName} transfer {playerId} to line {line1}");

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. Ensure both MapCopy instances are set to MapCopyStatus.WaitMerge before calling MergeLines.
  2. Check the status of both copies before calling MergeLines and log/skip if either is not ready.
  3. Investigate why the copy's status is not WaitMerge — look at the lifecycle code that should set it.

Example fix

// before
if (mapCopy1.Status != MapCopyStatus.WaitMerge || mapCopy2.Status != MapCopyStatus.WaitMerge)
    throw new Exception($"map copy not running: {mapInfo.MapName} {line1} {line2}");
// after: guard and log
if (mapCopy1.Status != MapCopyStatus.WaitMerge || mapCopy2.Status != MapCopyStatus.WaitMerge)
{
    Log.Error($"merge skipped, copies not in WaitMerge: {line1}({mapCopy1.Status}) {line2}({mapCopy2.Status})");
    return;
}
Defensive patterns

Strategy: validation

Validate before calling

// Before calling MergeLines, verify both copies are in WaitMerge status
MapCopy copy1 = mapInfo.GetChild<MapCopy>(line1);
MapCopy copy2 = mapInfo.GetChild<MapCopy>(line2);
if (copy1 == null || copy2 == null) { Log.Error("Merge target copy not found"); return; }
if (copy1.Status != MapCopyStatus.WaitMerge || copy2.Status != MapCopyStatus.WaitMerge)
{
    Log.Error($"Cannot merge: line {line1} status={copy1.Status}, line {line2} status={copy2.Status}");
    return;
}

Prevention

When it happens

Trigger: MergeLines(line1, line2) is called when mapCopy1.Status != WaitMerge or mapCopy2.Status != WaitMerge. This means one or both copies were not transitioned to WaitMerge before the merge was initiated.

Common situations: A copy was not properly set to WaitMerge status before requesting a merge (e.g. still Running). Race condition: the copy's status changed between the merge request and execution. The merge was triggered on the wrong pair of copies. A copy was already merged or disposed and its status was not updated.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/73fdbd63a01b0eec. Report an issue: GitHub.