diff --git a/osu.Game/Beatmaps/IBeatmapInfo.cs b/osu.Game/Beatmaps/IBeatmapInfo.cs
index 3d51c5d4b6..d206cfaaed 100644
--- a/osu.Game/Beatmaps/IBeatmapInfo.cs
+++ b/osu.Game/Beatmaps/IBeatmapInfo.cs
@@ -11,7 +11,7 @@ namespace osu.Game.Beatmaps
///
/// A single beatmap difficulty.
///
- public interface IBeatmapInfo : IHasOnlineID
+ public interface IBeatmapInfo : IHasOnlineID
{
///
/// The user-specified name given to this beatmap.
diff --git a/osu.Game/Beatmaps/IBeatmapSetInfo.cs b/osu.Game/Beatmaps/IBeatmapSetInfo.cs
index 0cfb0c4242..20c46d9063 100644
--- a/osu.Game/Beatmaps/IBeatmapSetInfo.cs
+++ b/osu.Game/Beatmaps/IBeatmapSetInfo.cs
@@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
///
/// A representation of a collection of beatmap difficulties, generally packaged as an ".osz" archive.
///
- public interface IBeatmapSetInfo : IHasOnlineID
+ public interface IBeatmapSetInfo : IHasOnlineID
{
///
/// The date when this beatmap was imported.
diff --git a/osu.Game/Database/IHasOnlineID.cs b/osu.Game/Database/IHasOnlineID.cs
index 6e2be7e1f9..36ae4035c4 100644
--- a/osu.Game/Database/IHasOnlineID.cs
+++ b/osu.Game/Database/IHasOnlineID.cs
@@ -5,7 +5,7 @@
namespace osu.Game.Database
{
- public interface IHasOnlineID
+ public interface IHasOnlineID
{
///
/// The server-side ID representing this instance, if one exists. Any value 0 or less denotes a missing ID.
@@ -14,6 +14,6 @@ namespace osu.Game.Database
/// Generally we use -1 when specifying "missing" in code, but values of 0 are also considered missing as the online source
/// is generally a MySQL autoincrement value, which can never be 0.
///
- int OnlineID { get; }
+ T OnlineID { get; }
}
}
diff --git a/osu.Game/Rulesets/IRulesetInfo.cs b/osu.Game/Rulesets/IRulesetInfo.cs
index 779433dc81..c3bc6c1995 100644
--- a/osu.Game/Rulesets/IRulesetInfo.cs
+++ b/osu.Game/Rulesets/IRulesetInfo.cs
@@ -11,7 +11,7 @@ namespace osu.Game.Rulesets
///
/// A representation of a ruleset's metadata.
///
- public interface IRulesetInfo : IHasOnlineID
+ public interface IRulesetInfo : IHasOnlineID
{
///
/// The user-exposed name of this ruleset.
diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs
index 5cf22f7945..ed3b27dd22 100644
--- a/osu.Game/Scoring/ScoreInfo.cs
+++ b/osu.Game/Scoring/ScoreInfo.cs
@@ -19,7 +19,7 @@ using osu.Game.Utils;
namespace osu.Game.Scoring
{
- public class ScoreInfo : IHasFiles, IHasPrimaryKey, ISoftDelete, IEquatable, IDeepCloneable
+ public class ScoreInfo : IHasFiles, IHasPrimaryKey, ISoftDelete, IEquatable, IDeepCloneable, IHasOnlineID
{
public int ID { get; set; }
@@ -271,5 +271,11 @@ namespace osu.Game.Scoring
return ReferenceEquals(this, other);
}
+
+ #region Implementation of IHasOnlineID
+
+ public long OnlineID => OnlineScoreID ?? -1;
+
+ #endregion
}
}