1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 05:39:53 +08:00

Centralise logging of non-official builds

This commit is contained in:
Dan Balasescu
2025-07-15 13:18:09 +09:00
Unverified
parent 55befe9efb
commit 35a3186bf0
2 changed files with 8 additions and 4 deletions
-4
View File
@@ -8,7 +8,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Humanizer;
@@ -1055,9 +1054,6 @@ namespace osu.Game
{
base.LoadComplete();
if (RuntimeInfo.EntryAssembly.GetCustomAttribute<OfficialBuildAttribute>() == null)
Logger.Log(NotificationsStrings.NotOfficialBuild.ToString());
var languages = Enum.GetValues<Language>();
var mappings = languages.Select(language =>
+8
View File
@@ -10,6 +10,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Logging;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Localisation;
@@ -66,9 +67,16 @@ namespace osu.Game.Updater
if (FixedReleaseStream != null)
config.SetValue(OsuSetting.ReleaseStream, FixedReleaseStream.Value);
// notify the user if they're using a build that is not officially sanctioned.
if (RuntimeInfo.EntryAssembly.GetCustomAttribute<OfficialBuildAttribute>() == null)
Notifications.Post(new SimpleNotification { Text = NotificationsStrings.NotOfficialBuild });
}
else
{
// log that this is not an official build, for if users build their own game without an assembly version.
// this is only logged because a notification would be too spammy in local test builds.
Logger.Log(NotificationsStrings.NotOfficialBuild.ToString());
}
// debug / local compilations will reset to a non-release string.
// can be useful to check when an install has transitioned between release and otherwise (see OsuConfigManager's migrations).