mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Include executable hash when submitting multiplayer scores
This commit is contained in:
@ -11,6 +11,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Development;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.IO.Stores;
|
||||
@ -97,6 +98,11 @@ namespace osu.Game
|
||||
|
||||
public virtual Version AssemblyVersion => Assembly.GetEntryAssembly()?.GetName().Version ?? new Version();
|
||||
|
||||
/// <summary>
|
||||
/// MD5 representation of the game executable.
|
||||
/// </summary>
|
||||
public string VersionHash { get; private set; }
|
||||
|
||||
public bool IsDeployedBuild => AssemblyVersion.Major > 0;
|
||||
|
||||
public virtual string Version
|
||||
@ -128,6 +134,14 @@ namespace osu.Game
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
var assembly = Assembly.GetEntryAssembly();
|
||||
|
||||
if (assembly != null)
|
||||
{
|
||||
using (var str = File.OpenRead(assembly.Location))
|
||||
VersionHash = str.ComputeMD5Hash();
|
||||
}
|
||||
|
||||
Resources.AddStore(new DllResourceStore(OsuResources.ResourceAssembly));
|
||||
|
||||
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
|
||||
|
Reference in New Issue
Block a user