mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 05:22:54 +08:00
Include executable hash when submitting multiplayer scores
This commit is contained in:
parent
bb2d9bdc7e
commit
6c7e806eac
@ -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));
|
||||
|
@ -51,6 +51,9 @@ namespace osu.Game.Scoring
|
||||
[NotMapped]
|
||||
public bool Passed { get; set; } = true;
|
||||
|
||||
[JsonProperty("version_hash")]
|
||||
public string VersionHash { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual RulesetInfo Ruleset { get; set; }
|
||||
|
||||
|
@ -465,6 +465,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
Beatmap = Beatmap.Value.BeatmapInfo,
|
||||
Ruleset = rulesetInfo,
|
||||
VersionHash = Game.VersionHash,
|
||||
Mods = Mods.Value.ToArray(),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user