Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importer: Detect MATb files #376

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Refresh.GameServer/Importing/Importer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ protected GameAssetType DetermineAssetType(Span<byte> 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;
Expand Down
1 change: 1 addition & 0 deletions Refresh.GameServer/Types/Assets/AssetSafetyLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions Refresh.GameServer/Types/Assets/GameAsset.Conversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ private string TransformImage(TokenGame game, IDataStore dataStore, Func<string,
case GameAssetType.Level:
case GameAssetType.Painting:
case GameAssetType.Plan:
case GameAssetType.GfxMaterial:
case GameAssetType.Material:
case GameAssetType.Mesh:
case GameAssetType.Palette:
Expand Down
9 changes: 8 additions & 1 deletion Refresh.GameServer/Types/Assets/GameAssetType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public enum GameAssetType
/// <remarks>
/// Magic: GMTb
/// </remarks>
Material = 5,
GfxMaterial = 5,
/// <summary>
/// A mesh used for custom models.
/// </summary>
Expand Down Expand Up @@ -121,4 +121,11 @@ public enum GameAssetType
/// A file containing information about the currently playing song, uploaded during a grief report.
/// </summary>
GriefSongState = 16,
/// <summary>
/// A material file, contains information about a material's physical properties
/// </summary>
/// <remarks>
/// Magic: MATb
/// </remarks>
Material = 17,
}
Loading