hch
2026-07-10 fcbc8a284aab346c04ea5777e0c6c9649983ce43
0312 同步满掉落背包优化
2个文件已修改
30 ■■■■■ 已修改文件
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/PackManager.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -176,6 +176,7 @@
        Register(typeof(HA525_tagSCFamilyAtkDefBatInfo), typeof(DTCA525_tagSCFamilyAtkDefBatInfo));
        Register(typeof(HAA90_tagSCActLianqiInfo), typeof(DTCAA90_tagSCActLianqiInfo));
        Register(typeof(HAA91_tagSCActLianqiPlayerInfo), typeof(DTCAA91_tagSCActLianqiPlayerInfo));
        Register(typeof(HA208_tagSCDropPackFull), typeof(DTCA208_tagSCDropPackFull));
    }
    //主工程注册封包
Main/System/KnapSack/PackManager.cs
@@ -170,6 +170,27 @@
            playerPackDict.Add(packType, new SinglePack(packType));
        }
        // 先删除所有物品 不止登录的时候会发,其他情况补发
        var singlePack = playerPackDict[packType];
        List<string> guidList = new List<string>();
        if (singlePack != null)
        {
            foreach (var item in singlePack.GetAllItems().Values)
            {
                guidList.Add(item.guid);
            }
            singlePack.Clear();
            foreach (var guid in guidList)
            {
                if (itemGUIDDict.ContainsKey(guid))
                {
                    if (itemGUIDDict[guid].packType == packType)
                    {
                        itemGUIDDict.Remove(guid);
                    }
                }
            }
        }
        for (int i = 0; i < packInfo.ItemCount; i++)
        {
@@ -613,6 +634,14 @@
        return PackMaxCountDict[(int)type] - GetSinglePack(type).unlockedGridCount;
    }
    public int GetPackMaxCount(PackType type)
    {
        if (!PackMaxCountDict.ContainsKey((int)type))
        {
            return 0;
        }
        return PackMaxCountDict[(int)type];
    }
    private void UpdateSecond()
    {