From 15e3a06a3e54fb94ba216cd0373d094c9f77da1c Mon Sep 17 00:00:00 2001 From: Beyley Thomas Date: Mon, 18 Mar 2024 18:30:28 -0700 Subject: [PATCH] Importer: Detect MATb files --- Refresh.GameServer/Importing/Importer.cs | 3 ++- Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs | 1 + Refresh.GameServer/Types/Assets/GameAsset.Conversion.cs | 1 + Refresh.GameServer/Types/Assets/GameAssetType.cs | 9 ++++++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Refresh.GameServer/Importing/Importer.cs b/Refresh.GameServer/Importing/Importer.cs index ce049805..60c3d062 100644 --- a/Refresh.GameServer/Importing/Importer.cs +++ b/Refresh.GameServer/Importing/Importer.cs @@ -186,9 +186,10 @@ protected GameAssetType DetermineAssetType(Span data, TokenPlatform? token // LBP assets if (MatchesMagic(data, "TEX "u8)) return GameAssetType.Texture; if (MatchesMagic(data, "GTF "u8)) return GameAssetType.GameDataTexture; + 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, "GMTb"u8)) return GameAssetType.Material; + if (MatchesMagic(data, "GMTb"u8)) return GameAssetType.GfxMaterial; if (MatchesMagic(data, "MSHb"u8)) return GameAssetType.Mesh; if (MatchesMagic(data, "PALb"u8)) return GameAssetType.Palette; if (MatchesMagic(data, "FSHb"u8)) return GameAssetType.Script; diff --git a/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs b/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs index 2ef25d3e..f660d959 100644 --- a/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs +++ b/Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs @@ -35,6 +35,7 @@ public static AssetSafetyLevel FromAssetType(GameAssetType type) GameAssetType.Mip => AssetSafetyLevel.Safe, GameAssetType.GriefSongState => AssetSafetyLevel.Safe, + GameAssetType.GfxMaterial => AssetSafetyLevel.PotentiallyUnwanted, GameAssetType.Material => AssetSafetyLevel.PotentiallyUnwanted, GameAssetType.Mesh => AssetSafetyLevel.PotentiallyUnwanted, GameAssetType.GameDataTexture => AssetSafetyLevel.PotentiallyUnwanted, diff --git a/Refresh.GameServer/Types/Assets/GameAsset.Conversion.cs b/Refresh.GameServer/Types/Assets/GameAsset.Conversion.cs index 87a6560d..fe11af45 100644 --- a/Refresh.GameServer/Types/Assets/GameAsset.Conversion.cs +++ b/Refresh.GameServer/Types/Assets/GameAsset.Conversion.cs @@ -352,6 +352,7 @@ private string TransformImage(TokenGame game, IDataStore dataStore, Func /// Magic: GMTb /// - Material = 5, + GfxMaterial = 5, /// /// A mesh used for custom models. /// @@ -121,4 +121,11 @@ public enum GameAssetType /// A file containing information about the currently playing song, uploaded during a grief report. /// GriefSongState = 16, + /// + /// A material file, contains information about a material's physical properties + /// + /// + /// Magic: MATb + /// + Material = 17, } \ No newline at end of file