From 07889ee3342e24503c20278879d17a3ebc41595e Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 15 Apr 2024 23:57:52 -0400 Subject: [PATCH] Support LBP3 level chunks Closes #400 --- Refresh.GameServer/Importing/Importer.cs | 1 + Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs | 1 + Refresh.GameServer/Types/Assets/GameAssetType.cs | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/Refresh.GameServer/Importing/Importer.cs b/Refresh.GameServer/Importing/Importer.cs index eb100148..61be3828 100644 --- a/Refresh.GameServer/Importing/Importer.cs +++ b/Refresh.GameServer/Importing/Importer.cs @@ -189,6 +189,7 @@ protected GameAssetType DetermineAssetType(Span data, TokenPlatform? token if (MatchesMagic(data, "MATb"u8)) return GameAssetType.Material; if (MatchesMagic(data, "PLNb"u8)) return GameAssetType.Plan; if (MatchesMagic(data, "LVLb"u8)) return GameAssetType.Level; + if (MatchesMagic(data, "CHKb"u8)) return GameAssetType.LevelChunk; if (MatchesMagic(data, "GMTb"u8)) return GameAssetType.GfxMaterial; if (MatchesMagic(data, "MSHb"u8)) return GameAssetType.Mesh; if (MatchesMagic(data, "PALb"u8)) return GameAssetType.Palette; diff --git a/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs b/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs index c094b540..30baca05 100644 --- a/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs +++ b/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs @@ -28,6 +28,7 @@ public static AssetSafetyLevel FromAssetType(GameAssetType type) return type switch { GameAssetType.Level => AssetSafetyLevel.Safe, + GameAssetType.LevelChunk => AssetSafetyLevel.Safe, GameAssetType.Plan => AssetSafetyLevel.Safe, GameAssetType.MoveRecording => AssetSafetyLevel.Safe, GameAssetType.SyncedProfile => AssetSafetyLevel.Safe, diff --git a/Refresh.GameServer/Types/Assets/GameAssetType.cs b/Refresh.GameServer/Types/Assets/GameAssetType.cs index 76c60a6b..7889541c 100644 --- a/Refresh.GameServer/Types/Assets/GameAssetType.cs +++ b/Refresh.GameServer/Types/Assets/GameAssetType.cs @@ -142,4 +142,13 @@ public enum GameAssetType /// Magic: BEVb /// Bevel = 19, + /// + /// A chunk of a level, containing objects and such. + /// Used for 'Dynamic Thermometer' levels in LBP3. + /// + /// + /// Magic: CHKb + /// + /// + LevelChunk = 20, } \ No newline at end of file