From fa9e893cbe8441e85f5ed4ecb8629a2eaf8c20de Mon Sep 17 00:00:00 2001 From: SadPencil Date: Tue, 5 Nov 2024 20:21:55 +0800 Subject: [PATCH 01/17] Add notice for non-release builds --- DXMainClient/DXGUI/GameClass.cs | 4 ++++ DXMainClient/PreStartup.cs | 4 ++++ Directory.Build.targets | 7 +++++++ GitVersion.yml | 6 +++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/DXMainClient/DXGUI/GameClass.cs b/DXMainClient/DXGUI/GameClass.cs index ee269228a..bb100d84a 100644 --- a/DXMainClient/DXGUI/GameClass.cs +++ b/DXMainClient/DXGUI/GameClass.cs @@ -69,6 +69,10 @@ protected override void Initialize() Window.Title = string.IsNullOrEmpty(windowTitle) ? string.Format("{0} Client", MainClientConstants.GAME_NAME_SHORT) : windowTitle; +#if DEVELOPMENT_BUILD + Window.Title += " (Development Build)"; +#endif + base.Initialize(); AssetLoader.Initialize(GraphicsDevice, content); diff --git a/DXMainClient/PreStartup.cs b/DXMainClient/PreStartup.cs index 955288586..54480338e 100644 --- a/DXMainClient/PreStartup.cs +++ b/DXMainClient/PreStartup.cs @@ -93,6 +93,10 @@ public static void Initialize(StartupParams parameters) Logger.Log("Client version: " + Assembly.GetAssembly(typeof(PreStartup)).GetName().Version); Logger.Log(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion); +#if DEVELOPMENT_BUILD + Logger.Log("This is a development build. Stability and reliability may not be fully guaranteed."); +#endif + // Log information about given startup params if (parameters.NoAudio) { diff --git a/Directory.Build.targets b/Directory.Build.targets index d238c0322..01a992c05 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -3,6 +3,13 @@ + + + $(DefineConstants);DEVELOPMENT_BUILD + + + + Date: Tue, 5 Nov 2024 21:27:44 +0800 Subject: [PATCH 02/17] Show non-release notice in CnCNet lobby --- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index 2a7ff5a8b..582da71f6 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -560,6 +560,14 @@ private void PostUIInit() string.Format("*** DTA CnCNet Client version {0} ***".L10N("Client:Main:CnCNetClientVersionMessage"), Assembly.GetAssembly(typeof(CnCNetLobby)).GetName().Version), lbChatMessages.FontIndex))); + { + string developBuildWarningMessage = "This is a development build. Stability and reliability may not be fully guaranteed.".L10N("Client:Main:DevelopmentBuildWarning"); +#if DEVELOPMENT_BUILD + connectionManager.MainChannel.AddMessage(new ChatMessage(Color.Red, Renderer.GetSafeString( + developBuildWarningMessage, lbChatMessages.FontIndex))); +#endif + } + connectionManager.BannedFromChannel += ConnectionManager_BannedFromChannel; loginWindow = new CnCNetLoginWindow(WindowManager); From a7d45508850b81ebf5d9a1a2c4ea91237d22a4e6 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Tue, 5 Nov 2024 22:36:52 +0800 Subject: [PATCH 03/17] Improved non-release build detection --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 01a992c05..f5a01874f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -3,7 +3,7 @@ - + $(DefineConstants);DEVELOPMENT_BUILD From 4ab4a6b99bcd9c96e242b62a5b6f409fe3fd2149 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 6 Nov 2024 01:19:33 +0800 Subject: [PATCH 04/17] Specify IncludeSourceRevisionInInformationalVersion --- Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 597d88bd5..c6b5befbd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,6 +10,8 @@ CnCNet Client Copyright © CnCNet, Rampastring 2011-2024 CnCNet + + false From 2978564b23727f75696aa7cf5b552f0eab21dcf4 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 6 Nov 2024 01:22:30 +0800 Subject: [PATCH 05/17] Add ThisAssembly.Git --- DXMainClient/DXMainClient.csproj | 4 ++++ Directory.Packages.props | 1 + 2 files changed, 5 insertions(+) diff --git a/DXMainClient/DXMainClient.csproj b/DXMainClient/DXMainClient.csproj index 3f00a7172..c5ef89d2f 100644 --- a/DXMainClient/DXMainClient.csproj +++ b/DXMainClient/DXMainClient.csproj @@ -32,6 +32,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Directory.Packages.props b/Directory.Packages.props index b748c2483..71f84fb04 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,6 +28,7 @@ + From 416c1caa9ab4eb09ba077c387798c59855b27f27 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 6 Nov 2024 01:23:42 +0800 Subject: [PATCH 06/17] Show Git branch and commit id as the non-release version string --- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 7 ++++++- DXMainClient/PreStartup.cs | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index 582da71f6..a60d4b1c6 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -556,8 +556,13 @@ private void PostUIInit() gameCreationPanel.Hide(); + string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); +#if DEVELOPMENT_BUILD + clientVersion = $"{ThisAssembly.Git.Branch} - {ThisAssembly.Git.Sha}"; +#endif + connectionManager.MainChannel.AddMessage(new ChatMessage(Color.White, Renderer.GetSafeString( - string.Format("*** DTA CnCNet Client version {0} ***".L10N("Client:Main:CnCNetClientVersionMessage"), Assembly.GetAssembly(typeof(CnCNetLobby)).GetName().Version), + string.Format("*** DTA CnCNet Client version {0} ***".L10N("Client:Main:CnCNetClientVersionMessage"), clientVersion), lbChatMessages.FontIndex))); { diff --git a/DXMainClient/PreStartup.cs b/DXMainClient/PreStartup.cs index 54480338e..580be6eb9 100644 --- a/DXMainClient/PreStartup.cs +++ b/DXMainClient/PreStartup.cs @@ -90,8 +90,14 @@ public static void Initialize(StartupParams parameters) MainClientConstants.Initialize(); Logger.Log("***Logfile for " + MainClientConstants.GAME_NAME_LONG + " client***"); - Logger.Log("Client version: " + Assembly.GetAssembly(typeof(PreStartup)).GetName().Version); - Logger.Log(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion); + + string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); +#if DEVELOPMENT_BUILD + clientVersion = $"{ThisAssembly.Git.Branch} - {ThisAssembly.Git.Sha}"; +#endif + + Logger.Log($"Client version: {clientVersion}"); + Logger.Log(Assembly.GetExecutingAssembly().GetCustomAttribute().InformationalVersion); #if DEVELOPMENT_BUILD Logger.Log("This is a development build. Stability and reliability may not be fully guaranteed."); From 99388f530201cbb35ac353e49b6b103e8cb8da94 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 6 Nov 2024 01:38:21 +0800 Subject: [PATCH 07/17] Update the version string for non-release builds --- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 2 +- DXMainClient/PreStartup.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index a60d4b1c6..be8aab0f0 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -558,7 +558,7 @@ private void PostUIInit() string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #if DEVELOPMENT_BUILD - clientVersion = $"{ThisAssembly.Git.Branch} - {ThisAssembly.Git.Sha}"; + clientVersion = $"{ThisAssembly.Git.Branch}@{ThisAssembly.Git.Sha}"; #endif connectionManager.MainChannel.AddMessage(new ChatMessage(Color.White, Renderer.GetSafeString( diff --git a/DXMainClient/PreStartup.cs b/DXMainClient/PreStartup.cs index 580be6eb9..646edffaf 100644 --- a/DXMainClient/PreStartup.cs +++ b/DXMainClient/PreStartup.cs @@ -93,7 +93,7 @@ public static void Initialize(StartupParams parameters) string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #if DEVELOPMENT_BUILD - clientVersion = $"{ThisAssembly.Git.Branch} - {ThisAssembly.Git.Sha}"; + clientVersion = $"{ThisAssembly.Git.Branch}@{ThisAssembly.Git.Sha}"; #endif Logger.Log($"Client version: {clientVersion}"); From a0131b1d57032d169709e8d7af92a1d027104bd9 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 27 Nov 2024 15:29:05 +0800 Subject: [PATCH 08/17] Update the warning message --- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 2 +- DXMainClient/PreStartup.cs | 2 +- Directory.Build.targets | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index be8aab0f0..6a28676d4 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -566,7 +566,7 @@ private void PostUIInit() lbChatMessages.FontIndex))); { - string developBuildWarningMessage = "This is a development build. Stability and reliability may not be fully guaranteed.".L10N("Client:Main:DevelopmentBuildWarning"); + string developBuildWarningMessage = "This is a development build of the client. Stability and reliability may not be fully guaranteed.".L10N("Client:Main:DevelopmentBuildWarning"); #if DEVELOPMENT_BUILD connectionManager.MainChannel.AddMessage(new ChatMessage(Color.Red, Renderer.GetSafeString( developBuildWarningMessage, lbChatMessages.FontIndex))); diff --git a/DXMainClient/PreStartup.cs b/DXMainClient/PreStartup.cs index 646edffaf..0c374e063 100644 --- a/DXMainClient/PreStartup.cs +++ b/DXMainClient/PreStartup.cs @@ -100,7 +100,7 @@ public static void Initialize(StartupParams parameters) Logger.Log(Assembly.GetExecutingAssembly().GetCustomAttribute().InformationalVersion); #if DEVELOPMENT_BUILD - Logger.Log("This is a development build. Stability and reliability may not be fully guaranteed."); + Logger.Log("This is a development build of the client. Stability and reliability may not be fully guaranteed."); #endif // Log information about given startup params diff --git a/Directory.Build.targets b/Directory.Build.targets index f5a01874f..67bef6f19 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -7,7 +7,7 @@ $(DefineConstants);DEVELOPMENT_BUILD - + From 01520351bb914ed13c59891c15ca9692659ef59e Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 27 Nov 2024 15:31:24 +0800 Subject: [PATCH 09/17] Localize develop build title --- DXMainClient/DXGUI/GameClass.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DXMainClient/DXGUI/GameClass.cs b/DXMainClient/DXGUI/GameClass.cs index bb100d84a..9460f28d1 100644 --- a/DXMainClient/DXGUI/GameClass.cs +++ b/DXMainClient/DXGUI/GameClass.cs @@ -70,7 +70,10 @@ protected override void Initialize() string.Format("{0} Client", MainClientConstants.GAME_NAME_SHORT) : windowTitle; #if DEVELOPMENT_BUILD - Window.Title += " (Development Build)"; + { + string developBuildTitle = "(Development Build)".L10N("Client:Main:DevelopmentBuildTitle"); + Window.Title += " " + developBuildTitle; + } #endif base.Initialize(); From f4f75688a0dc6bf7543de4b5c3e1ba74ae8fc4a0 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 27 Nov 2024 15:37:19 +0800 Subject: [PATCH 10/17] Add ShowDevelopmentBuildWarnings option --- ClientCore/ClientConfiguration.cs | 5 +++++ DXMainClient/DXGUI/GameClass.cs | 8 +++++--- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 8 ++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ClientCore/ClientConfiguration.cs b/ClientCore/ClientConfiguration.cs index d80fb6a05..b38170d37 100644 --- a/ClientCore/ClientConfiguration.cs +++ b/ClientCore/ClientConfiguration.cs @@ -387,6 +387,11 @@ public IEnumerable SupplementalMapFileExtensions /// public bool DisallowJoiningIncompatibleGames => clientDefinitionsIni.GetBooleanValue(SETTINGS, nameof(DisallowJoiningIncompatibleGames), false); + /// + /// Activates warnings for non-release build of XNA Client + /// + public bool ShowDevelopmentBuildWarnings => clientDefinitionsIni.GetBooleanValue(SETTINGS, nameof(ShowDevelopmentBuildWarnings), true); + #endregion #region Network definitions diff --git a/DXMainClient/DXGUI/GameClass.cs b/DXMainClient/DXGUI/GameClass.cs index 9460f28d1..412d0820e 100644 --- a/DXMainClient/DXGUI/GameClass.cs +++ b/DXMainClient/DXGUI/GameClass.cs @@ -69,12 +69,14 @@ protected override void Initialize() Window.Title = string.IsNullOrEmpty(windowTitle) ? string.Format("{0} Client", MainClientConstants.GAME_NAME_SHORT) : windowTitle; -#if DEVELOPMENT_BUILD { string developBuildTitle = "(Development Build)".L10N("Client:Main:DevelopmentBuildTitle"); - Window.Title += " " + developBuildTitle; - } + +#if DEVELOPMENT_BUILD + if (ClientConfiguration.Instance.ShowDevelopmentBuildWarnings) + Window.Title += " " + developBuildTitle; #endif + } base.Initialize(); diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index 6a28676d4..0a9570bb3 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -567,9 +567,13 @@ private void PostUIInit() { string developBuildWarningMessage = "This is a development build of the client. Stability and reliability may not be fully guaranteed.".L10N("Client:Main:DevelopmentBuildWarning"); + #if DEVELOPMENT_BUILD - connectionManager.MainChannel.AddMessage(new ChatMessage(Color.Red, Renderer.GetSafeString( - developBuildWarningMessage, lbChatMessages.FontIndex))); + if (ClientConfiguration.Instance.ShowDevelopmentBuildWarnings) + { + connectionManager.MainChannel.AddMessage(new ChatMessage(Color.Red, Renderer.GetSafeString( + developBuildWarningMessage, lbChatMessages.FontIndex))); + } #endif } From bdf95a9d99c152b2f74ba6396cfab7ac7ed6d9c2 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 27 Nov 2024 15:51:56 +0800 Subject: [PATCH 11/17] Update Directory.Build.targets --- Directory.Build.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/Directory.Build.targets b/Directory.Build.targets index 67bef6f19..1d0f867fd 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -3,6 +3,7 @@ + $(DefineConstants);DEVELOPMENT_BUILD From d08bf1e33cb11586cacfc9c3006eb28049bf972b Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Sun, 1 Dec 2024 21:25:22 +0300 Subject: [PATCH 12/17] Add `ShowDevelopmentBuildWarnings` key into `Settings` section --- DXMainClient/Resources/ClientDefinitions.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DXMainClient/Resources/ClientDefinitions.ini b/DXMainClient/Resources/ClientDefinitions.ini index 7f23c6cf4..492085d9a 100644 --- a/DXMainClient/Resources/ClientDefinitions.ini +++ b/DXMainClient/Resources/ClientDefinitions.ini @@ -96,3 +96,7 @@ DiscordAppId=680072927223218222 ; Comment out to disable mod mode and enable the updater ModMode=yes + +; Activates warnings for non-release build of XNA Client. +; Please, make sure you are not publishing stable mod version with unstable development client build. +ShowDevelopmentBuildWarnings=true From 82c05297de993a071596eba378fd47a2cdbf47c8 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Wed, 4 Dec 2024 05:17:18 +0800 Subject: [PATCH 13/17] Update GameClass.cs Co-authored-by: Kerbiter --- DXMainClient/DXGUI/GameClass.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DXMainClient/DXGUI/GameClass.cs b/DXMainClient/DXGUI/GameClass.cs index 412d0820e..2a2f4efaf 100644 --- a/DXMainClient/DXGUI/GameClass.cs +++ b/DXMainClient/DXGUI/GameClass.cs @@ -70,11 +70,11 @@ protected override void Initialize() string.Format("{0} Client", MainClientConstants.GAME_NAME_SHORT) : windowTitle; { - string developBuildTitle = "(Development Build)".L10N("Client:Main:DevelopmentBuildTitle"); + string developBuildTitle = "Development Build".L10N("Client:Main:DevelopmentBuildTitle"); #if DEVELOPMENT_BUILD if (ClientConfiguration.Instance.ShowDevelopmentBuildWarnings) - Window.Title += " " + developBuildTitle; + Window.Title += $" ({developBuildTitle})"; #endif } From 11a5c7a8944cad6c230b6b863892d09f47cb5fd5 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Thu, 5 Dec 2024 07:52:51 +0800 Subject: [PATCH 14/17] Update Directory.Build.targets --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index a272c8ed3..479cc2f14 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -4,7 +4,7 @@ - + $(DefineConstants);DEVELOPMENT_BUILD From b203fdb49a687049cbb08f1c22c36ecc4afbeb60 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Thu, 5 Dec 2024 08:13:29 +0800 Subject: [PATCH 15/17] Remove ThisAssembly.Git package --- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 2 +- DXMainClient/DXMainClient.csproj | 4 ---- DXMainClient/PreStartup.cs | 2 +- Directory.Packages.props | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index 0a9570bb3..df955c62a 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -558,7 +558,7 @@ private void PostUIInit() string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #if DEVELOPMENT_BUILD - clientVersion = $"{ThisAssembly.Git.Branch}@{ThisAssembly.Git.Sha}"; + clientVersion = $"{GitVersionInformation.BranchName}@{GitVersionInformation.ShortSha}"; #endif connectionManager.MainChannel.AddMessage(new ChatMessage(Color.White, Renderer.GetSafeString( diff --git a/DXMainClient/DXMainClient.csproj b/DXMainClient/DXMainClient.csproj index a917e6c7e..a66474c76 100644 --- a/DXMainClient/DXMainClient.csproj +++ b/DXMainClient/DXMainClient.csproj @@ -34,10 +34,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/DXMainClient/PreStartup.cs b/DXMainClient/PreStartup.cs index 0c374e063..3f05816d3 100644 --- a/DXMainClient/PreStartup.cs +++ b/DXMainClient/PreStartup.cs @@ -93,7 +93,7 @@ public static void Initialize(StartupParams parameters) string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #if DEVELOPMENT_BUILD - clientVersion = $"{ThisAssembly.Git.Branch}@{ThisAssembly.Git.Sha}"; + clientVersion = $"{GitVersionInformation.BranchName}@{GitVersionInformation.ShortSha}"; #endif Logger.Log($"Client version: {clientVersion}"); diff --git a/Directory.Packages.props b/Directory.Packages.props index 508404364..65a8c052b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,7 +28,6 @@ - From 4ac6168f4e72ea67cab9585972118f77592fc01b Mon Sep 17 00:00:00 2001 From: SadPencil Date: Thu, 5 Dec 2024 08:30:18 +0800 Subject: [PATCH 16/17] Replace assembly version with GitVersionInformation --- ClientUpdater/Updater.cs | 2 +- DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | 4 ++-- DXMainClient/PreStartup.cs | 6 +++--- SecondStageUpdater/Program.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ClientUpdater/Updater.cs b/ClientUpdater/Updater.cs index c369ca83f..684eef6c5 100644 --- a/ClientUpdater/Updater.cs +++ b/ClientUpdater/Updater.cs @@ -410,7 +410,7 @@ internal static void UpdateUserAgent(HttpClient httpClient) if (UpdaterVersion != "N/A") httpClient.DefaultRequestHeaders.UserAgent.Add(new(nameof(Updater), UpdaterVersion)); - httpClient.DefaultRequestHeaders.UserAgent.Add(new("Client", Assembly.GetEntryAssembly().GetName().Version.ToString())); + httpClient.DefaultRequestHeaders.UserAgent.Add(new("Client", GitVersionInformation.MajorMinorPatch)); } /// diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs index df955c62a..b4b7d6e41 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs @@ -556,9 +556,9 @@ private void PostUIInit() gameCreationPanel.Hide(); - string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + string clientVersion = GitVersionInformation.MajorMinorPatch; #if DEVELOPMENT_BUILD - clientVersion = $"{GitVersionInformation.BranchName}@{GitVersionInformation.ShortSha}"; + clientVersion = $"{GitVersionInformation.CommitDate} {GitVersionInformation.BranchName}@{GitVersionInformation.ShortSha}"; #endif connectionManager.MainChannel.AddMessage(new ChatMessage(Color.White, Renderer.GetSafeString( diff --git a/DXMainClient/PreStartup.cs b/DXMainClient/PreStartup.cs index 3f05816d3..f65042ca7 100644 --- a/DXMainClient/PreStartup.cs +++ b/DXMainClient/PreStartup.cs @@ -91,13 +91,13 @@ public static void Initialize(StartupParams parameters) Logger.Log("***Logfile for " + MainClientConstants.GAME_NAME_LONG + " client***"); - string clientVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + string clientVersion = GitVersionInformation.MajorMinorPatch; #if DEVELOPMENT_BUILD - clientVersion = $"{GitVersionInformation.BranchName}@{GitVersionInformation.ShortSha}"; + clientVersion = $"{GitVersionInformation.CommitDate} {GitVersionInformation.BranchName}@{GitVersionInformation.ShortSha}"; #endif Logger.Log($"Client version: {clientVersion}"); - Logger.Log(Assembly.GetExecutingAssembly().GetCustomAttribute().InformationalVersion); + Logger.Log(GitVersionInformation.InformationalVersion); #if DEVELOPMENT_BUILD Logger.Log("This is a development build of the client. Stability and reliability may not be fully guaranteed."); diff --git a/SecondStageUpdater/Program.cs b/SecondStageUpdater/Program.cs index fc5b456f6..4009a8aa5 100644 --- a/SecondStageUpdater/Program.cs +++ b/SecondStageUpdater/Program.cs @@ -73,7 +73,7 @@ private static void Main(string[] args) Logger.WriteLogFile = true; Logger.WriteToConsole = false; Logger.Log("CnCNet Client Second-Stage Updater"); - Logger.Log("Version: " + Assembly.GetAssembly(typeof(Program)).GetName().Version); + Logger.Log("Version: " + GitVersionInformation.MajorMinorPatch); Write("Base directory: " + baseDirectory.FullName); Write($"Waiting for the client ({clientExecutable}) to exit.."); From 30f2e3a66a181a837675ca3da72e8214d6b658a9 Mon Sep 17 00:00:00 2001 From: SadPencil Date: Thu, 5 Dec 2024 08:35:38 +0800 Subject: [PATCH 17/17] Increase Patch version even for develop branch since we are not following SemVer right now --- GitVersion.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index ed7bba2c2..cc04e2a4d 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -3,18 +3,17 @@ # This configuration will allow the gitversion msbuild task to auto version our executable. It uses existing tags # to determine the next version by auto incrementing the Minor, Patch, or Tag version. The Tag version is calculated # by counting the number of commits since the last tag. -# Minor version is incremented by 1 when a build is created from the develop branch. -# Patch version is incremented by 1 when a build is created from the master branch. +# Patch version is incremented by 1 when a build is created from the develop or master branch. # # Examples: # # Latest tag is "2.8.0" - -# The next commit on develop branch will start version 2.9.0-beta.1. -# That increments the Minor by 1. That also increments the beta by 1 for the 1 additional commit. -# Another commit creates 2.9.0-beta.2 and so on. +# The next commit on develop branch will start version 2.8.1-beta.1. +# That increments the Patch by 1. That also increments the beta by 1 for the 1 additional commit. +# Another commit creates 2.8.1-beta.2 and so on. # # Latest tag is "2.8.0-beta.1" - -# The next commit on develop branch is "2.8.0-beta.2". Minor version is NOT incremented, because the +# The next commit on develop branch is "2.8.0-beta.2". Patch version is NOT incremented, because the # base tag of "2.8.0-beta.1" is also a beta. # # Latest tag is "2.8.0" - @@ -41,7 +40,7 @@ branches: develop: regex: ^develop$ - increment: Minor + increment: Patch is-mainline: false mode: ContinuousDeployment tag: beta