egametang/ET · error

scene config count is not one, zone: {zone}, sceneType: {sce

Error message

scene config count is not one, zone: {zone}, sceneType: {sceneType}, count: {configs.Count}

What it means

Error "scene config count is not one, zone: {zone}, sceneType: {sceneType}, count: {configs.Count}" thrown in egametang/ET.

Source

Thrown at Packages/cn.etetet.startconfig/Scripts/Model/Server/StartSceneConfig.cs:48

        {
            return this.sceneNameScenes[sceneName];
        }

        public List<StartSceneConfig> GetBySceneType(int zone, int sceneType)
        {
            string sceneTypeName = SceneTypeSingleton.Instance.GetSceneName(sceneType);
            return this.GetAll().Values.Where(config => config.Zone == zone && config.SceneType == sceneTypeName).ToList();
        }

        public StartSceneConfig GetOneBySceneType(int zone, int sceneType)
        {
            List<StartSceneConfig> configs = this.GetBySceneType(zone, sceneType);
            if (configs.Count == 1)
            {
                return configs[0];
            }

            throw new Exception($"scene config count is not one, zone: {zone}, sceneType: {sceneType}, count: {configs.Count}");
        }
        
        partial void EndRef()
        {
            foreach (StartSceneConfig startSceneConfig in this.GetAll().Values)
            {
                this.processScenes.Add(startSceneConfig.Process, startSceneConfig);
                this.sceneNameScenes.Add(startSceneConfig.Name, startSceneConfig);
            }
        }
    }
    
    public partial class StartSceneConfig
    {
        partial void EndInit()
        {
        }
    }

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. 检查 StartSceneConfig 配置表中该 zone 与 sceneType 的组合应恰好有一条记录
  2. 删除重复的配置行或补齐缺失行后重新导表
  3. 确认 zone 编号与 sceneType 枚举值正确

Example fix

在 Luban 配置中保证 (zone, sceneType) 唯一,重新导出配置后重启进程。

When it happens

Trigger: StartSceneConfig 按 zone + sceneType 查询到的配置数量不是 1(为 0 或多条),配置表中存在重复或缺失

Common situations: See trigger scenarios.


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