From 35a3186bf0bdea67d82cf8d2be237079960e171d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 15 Jul 2025 13:18:09 +0900 Subject: [PATCH] Centralise logging of non-official builds --- osu.Game/OsuGame.cs | 4 ---- osu.Game/Updater/UpdateManager.cs | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index e060450a5e..bf08023242 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -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() == null) - Logger.Log(NotificationsStrings.NotOfficialBuild.ToString()); - var languages = Enum.GetValues(); var mappings = languages.Select(language => diff --git a/osu.Game/Updater/UpdateManager.cs b/osu.Game/Updater/UpdateManager.cs index 4a067e3f68..4ce3914df0 100644 --- a/osu.Game/Updater/UpdateManager.cs +++ b/osu.Game/Updater/UpdateManager.cs @@ -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() == 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).