Skip to content

Commit

Permalink
Merge branch 'main' into allow-non-gameasset-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden authored Aug 7, 2024
2 parents 50c103c + e16a956 commit 0ac4319
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions Refresh.GameServer/Database/GameDatabaseContext.Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ public DatabaseList<GameAsset> GetAssetsUploadedByUser(GameUser? user, int skip,

public GameAssetType? GetConvertedType(string hash)
{
IQueryable<GameAsset> assets = this.GameAssets;

foreach (GameAsset asset in assets)
{
//If the asset hash is the requested hash, its not a converted file
if (asset.AssetHash == hash) return null;
GameAsset? asset = this.GameAssets.FirstOrDefault(a => a.AssetHash == hash ||
a.AsMainlineIconHash == hash ||
a.AsMipIconHash == hash);
//If the asset hash is the requested hash, its not a converted file
if (asset == null || asset.AssetHash == hash)
return null;

if (asset.AsMainlineIconHash == hash)
return GameAssetType.Png;
if (asset.AsMainlineIconHash == hash)
return GameAssetType.Png;

if (asset.AsMipIconHash == hash)
return GameAssetType.Mip;

if (asset.AsMipIconHash == hash)
return GameAssetType.Mip;
}

return null;
}

Expand Down

0 comments on commit 0ac4319

Please sign in to comment.