mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Bypass optimised existing check in SkinManager
(due to custom hashing function)
This commit is contained in:
parent
e493685c14
commit
44f875b802
@ -309,6 +309,12 @@ namespace osu.Game.Database
|
|||||||
Logger.Log($"{prefix} {message}", LoggingTarget.Database);
|
Logger.Log($"{prefix} {message}", LoggingTarget.Database);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the implementation overrides <see cref="ComputeHash"/> with a custom implementation.
|
||||||
|
/// Custom has implementations must bypass the early exit in the import flow (see <see cref="computeHashFast"/> usage).
|
||||||
|
/// </summary>
|
||||||
|
protected virtual bool HasCustomHashFunction => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a SHA-2 hash from the provided archive based on file content of all files matching <see cref="HashableFileTypes"/>.
|
/// Create a SHA-2 hash from the provided archive based on file content of all files matching <see cref="HashableFileTypes"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -365,7 +371,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
delayEvents();
|
delayEvents();
|
||||||
|
|
||||||
if (archive != null)
|
if (archive != null && !HasCustomHashFunction)
|
||||||
{
|
{
|
||||||
// fast bail to improve large import performance.
|
// fast bail to improve large import performance.
|
||||||
item.Hash = computeHashFast(archive);
|
item.Hash = computeHashFast(archive);
|
||||||
|
@ -125,6 +125,8 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
private const string unknown_creator_string = "Unknown";
|
private const string unknown_creator_string = "Unknown";
|
||||||
|
|
||||||
|
protected override bool HasCustomHashFunction => true;
|
||||||
|
|
||||||
protected override string ComputeHash(SkinInfo item, ArchiveReader reader = null)
|
protected override string ComputeHash(SkinInfo item, ArchiveReader reader = null)
|
||||||
{
|
{
|
||||||
// we need to populate early to create a hash based off skin.ini contents
|
// we need to populate early to create a hash based off skin.ini contents
|
||||||
|
Loading…
Reference in New Issue
Block a user