From c4f7f157e1746551686253f079137b8e1e5f7582 Mon Sep 17 00:00:00 2001 From: Beyley Thomas Date: Sun, 25 Aug 2024 17:30:17 -0700 Subject: [PATCH] Remove automated level mod flagging from realm migrations For now, the server with `--import-assets` then `--flag-modded-levels` to properly fill out this data. --- .../Database/GameDatabaseProvider.cs | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/Refresh.GameServer/Database/GameDatabaseProvider.cs b/Refresh.GameServer/Database/GameDatabaseProvider.cs index 3445c67c..2e4018fa 100644 --- a/Refresh.GameServer/Database/GameDatabaseProvider.cs +++ b/Refresh.GameServer/Database/GameDatabaseProvider.cs @@ -337,42 +337,6 @@ protected override void Migrate(Migration migration, ulong oldVersion) newLevel.UpdateDate = DateTimeOffset.FromUnixTimeMilliseconds(oldLevel.UpdateDate); } - // In version 148, we added a "Modded" tag to levels - if (oldVersion < 148) - { - if (!newLevel.RootResource.StartsWith('g')) - { - void TraverseDependenciesRecursively(GameAsset asset, Action callback) - { - callback(asset.AssetHash, asset); - foreach (string internalAssetHash in migration.NewRealm.All().Where(d => d.Dependent == asset.AssetHash).AsEnumerable().Select(d => d.Dependency)) - { - GameAsset? internalAsset = migration.NewRealm.Find(internalAssetHash); - - // Only run this if this is null, since the next recursion will trigger its own callback - if(internalAsset == null) - callback(internalAssetHash, internalAsset); - - if(internalAsset != null) - TraverseDependenciesRecursively(internalAsset, callback); - } - } - - GameAsset? asset = migration.NewRealm.Find(newLevel.RootResource); - - if (asset != null) - { - bool modded = false; - TraverseDependenciesRecursively(asset, (hash, gameAsset) => - { - if (gameAsset != null && (gameAsset.AssetFlags & AssetFlags.Modded) != 0) - modded = true; - }); - newLevel.IsModded = modded; - } - } - } - // Version 148 is when `Modded` was added, and in 149 we renamed `Modded` to `IsModded` if (oldVersion >= 148 && oldVersion < 149) {