From 81b2b983943dc1715f900bbc9400a8536403b3b2 Mon Sep 17 00:00:00 2001 From: Mathias Lui Date: Wed, 1 Mar 2023 23:43:32 +0100 Subject: [PATCH] Increase to .NET 7.0 & Add ugly publishing scripts * Scripts got added for DamageCalculator and ConfigManager * Batch scripts will need 7z be added to PATH, as well as the two specified profiles in order to work * Alter publish profiles to fit to the scripts, one for self-contained and one for lower file size * Add explicit cast that is now needed to remove ambiguity --- ConfigManager/publish.bat | 44 +++++++++++++++++++ .../DamageCalculator/DamageCalculator.csproj | 2 +- DamageCalculator/publish.bat | 44 +++++++++++++++++++ .../SteamShared/SteamShared/Models/NavArea.cs | 2 +- .../SteamShared/SteamShared.csproj | 2 +- 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 ConfigManager/publish.bat create mode 100644 DamageCalculator/publish.bat diff --git a/ConfigManager/publish.bat b/ConfigManager/publish.bat new file mode 100644 index 0000000..21b323b --- /dev/null +++ b/ConfigManager/publish.bat @@ -0,0 +1,44 @@ +@echo off + +:Start + +set /p "version=TYPE IN VERSION NUMBER: " + +IF "%version%" == "" GOTO Start + +mkdir publish + +echo Deleting old releases... +del /q publish\* + + + +echo Publishing framework dependent version... +dotnet publish .\ConfigManager\ConfigManager.csproj /p:PublishProfile=ConfigManager\Properties\PublishProfiles\FrameworkDependentProfile.pubxml + +echo Removing PDBs... +del ConfigManager\bin\Release\net7.0-windows\publish\CsgoConfigManager\*.pdb + +echo Zipping folder... +7z a CsgoConfigManager.zip .\ConfigManager\bin\Release\net7.0-windows\publish\CsgoConfigManager + +echo Moving and renaming file... +move /y "CsgoConfigManager.zip" "publish\csgo_config_manager_FD_%version%.zip" + + + +echo Publishing standalone (self-contained) version... +dotnet publish .\ConfigManager\ConfigManager.csproj /p:PublishProfile=ConfigManager\Properties\PublishProfiles\SelfContainedProfile.pubxml + +echo Removing PDBs... +del ConfigManager\bin\Release\net7.0-windows\publish\CsgoConfigManager\*.pdb + +echo Zipping folder... +7z a CsgoConfigManager.zip .\ConfigManager\bin\Release\net7.0-windows\publish\CsgoConfigManager + +echo Moving and renaming file... +move /y "CsgoConfigManager.zip" "publish\csgo_config_manager_SC_%version%.zip" + + + +pause \ No newline at end of file diff --git a/DamageCalculator/DamageCalculator/DamageCalculator.csproj b/DamageCalculator/DamageCalculator/DamageCalculator.csproj index 488d70f..472c25b 100644 --- a/DamageCalculator/DamageCalculator/DamageCalculator.csproj +++ b/DamageCalculator/DamageCalculator/DamageCalculator.csproj @@ -1,6 +1,6 @@  - net6.0-windows + net7.0-windows WinExe Damage_Calculator CSGO Damage Calculator diff --git a/DamageCalculator/publish.bat b/DamageCalculator/publish.bat new file mode 100644 index 0000000..97db617 --- /dev/null +++ b/DamageCalculator/publish.bat @@ -0,0 +1,44 @@ +@echo off + +:Start + +set /p "version=TYPE IN VERSION NUMBER: " + +IF "%version%" == "" GOTO Start + +mkdir publish + +echo Deleting old releases... +del /q publish\* + + + +echo Publishing framework dependent version... +dotnet publish .\DamageCalculator\DamageCalculator.csproj /p:PublishProfile=DamageCalculator\Properties\PublishProfiles\FrameworkDependentProfile.pubxml + +echo Removing PDBs... +del DamageCalculator\bin\Release\net7.0-windows\publish\DamageCalculator\*.pdb + +echo Zipping folder... +7z a DamageCalculator.zip .\DamageCalculator\bin\Release\net7.0-windows\publish\DamageCalculator + +echo Moving and renaming file... +move /y "DamageCalculator.zip" "publish\csgo_damage_calculator_FD_x64_%version%.zip" + + + +echo Publishing standalone (self-contained) version... +dotnet publish .\DamageCalculator\DamageCalculator.csproj /p:PublishProfile=DamageCalculator\Properties\PublishProfiles\SelfContainedProfile.pubxml + +echo Removing PDBs... +del DamageCalculator\bin\Release\net7.0-windows\publish\DamageCalculator\*.pdb + +echo Zipping folder... +7z a DamageCalculator.zip .\DamageCalculator\bin\Release\net7.0-windows\publish\DamageCalculator + +echo Moving and renaming file... +move /y "DamageCalculator.zip" "publish\csgo_damage_calculator_SC_x64_%version%.zip" + + + +pause \ No newline at end of file diff --git a/SteamShared/SteamShared/SteamShared/Models/NavArea.cs b/SteamShared/SteamShared/SteamShared/Models/NavArea.cs index c0bab9b..3db97a2 100644 --- a/SteamShared/SteamShared/SteamShared/Models/NavArea.cs +++ b/SteamShared/SteamShared/SteamShared/Models/NavArea.cs @@ -21,7 +21,7 @@ namespace SteamShared.Models this.ID = reader.ReadUInt32(); if (navVersion <= 8) - this.AttributeBitField = BitConverter.GetBytes(reader.ReadByte()); + this.AttributeBitField = BitConverter.GetBytes((short)reader.ReadByte()); // .NET 6 would cast the byte to a short, .NET 7 will be ambiguous between short and Half else if (navVersion <= 12) this.AttributeBitField = BitConverter.GetBytes(reader.ReadUInt16()); else if (navVersion >= 13) diff --git a/SteamShared/SteamShared/SteamShared/SteamShared.csproj b/SteamShared/SteamShared/SteamShared/SteamShared.csproj index 517afc0..3c1c7a9 100644 --- a/SteamShared/SteamShared/SteamShared/SteamShared.csproj +++ b/SteamShared/SteamShared/SteamShared/SteamShared.csproj @@ -1,7 +1,7 @@  - net6.0-windows + net7.0-windows enable true True