mirror of
https://github.com/ppy/osu
synced 2025-03-07 03:49:14 +00: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.Audio;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Development;
|
using osu.Framework.Development;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.IO.Stores;
|
using osu.Framework.IO.Stores;
|
||||||
@ -97,6 +98,11 @@ namespace osu.Game
|
|||||||
|
|
||||||
public virtual Version AssemblyVersion => Assembly.GetEntryAssembly()?.GetName().Version ?? new Version();
|
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 bool IsDeployedBuild => AssemblyVersion.Major > 0;
|
||||||
|
|
||||||
public virtual string Version
|
public virtual string Version
|
||||||
@ -128,6 +134,14 @@ namespace osu.Game
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
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));
|
Resources.AddStore(new DllResourceStore(OsuResources.ResourceAssembly));
|
||||||
|
|
||||||
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
|
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
|
||||||
|
@ -51,6 +51,9 @@ namespace osu.Game.Scoring
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool Passed { get; set; } = true;
|
public bool Passed { get; set; } = true;
|
||||||
|
|
||||||
|
[JsonProperty("version_hash")]
|
||||||
|
public string VersionHash { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual RulesetInfo Ruleset { get; set; }
|
public virtual RulesetInfo Ruleset { get; set; }
|
||||||
|
|
||||||
|
@ -465,6 +465,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
Beatmap = Beatmap.Value.BeatmapInfo,
|
Beatmap = Beatmap.Value.BeatmapInfo,
|
||||||
Ruleset = rulesetInfo,
|
Ruleset = rulesetInfo,
|
||||||
|
VersionHash = Game.VersionHash,
|
||||||
Mods = Mods.Value.ToArray(),
|
Mods = Mods.Value.ToArray(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user