Skip to content

Commit

Permalink
Add HardEnd build option
Browse files Browse the repository at this point in the history
  • Loading branch information
Belonit committed Mar 27, 2024
1 parent a1144e3 commit 04388e9
Show file tree
Hide file tree
Showing 29 changed files with 396 additions and 200 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ jobs:
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}
artifact-name: compiled-dll-regular-${{ github.sha }}

- name: Build HardEnd
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
artifact-name: compiled-dll-hardend-${{ github.sha }}
9 changes: 9 additions & 0 deletions .github/workflows/pr-nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
env:
SOLUTION_PATH: .
BUILD_CONFIGURATION: DevBuild
ARTIFACT_NAME: cncnet5_${{ github.ref_name }}.zip

jobs:
build:
Expand All @@ -21,3 +22,11 @@ jobs:
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}
artifact-name: compiled-dll-regular-${{ github.sha }}

- name: Build HardEnd
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
artifact-name: compiled-dll-hardend-${{ github.sha }}
22 changes: 18 additions & 4 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,28 @@ jobs:
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}
artifact-name: compiled-dll-regular-${{ github.sha }}

- name: Build HardEnd
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
artifact-name: compiled-dll-hardend-${{ github.sha }}

- name: Create Archive For Release
run: |
mkdir ./artifact
copy ./LICENSE.md ./artifact/LICENSE.md
copy ./README.md ./artifact/README.md
copy ./${{ env.BUILD_CONFIGURATION }}/cncnet5.pdb ./artifact/cncnet5.pdb
copy ./${{ env.BUILD_CONFIGURATION }}/cncnet5.dll ./artifact/cncnet5.dll
mkdir ./artifact/Regular
copy ./LICENSE.md ./artifact/Regular/LICENSE.md
copy ./README.md ./artifact/Regular/README.md
copy ./${{ env.BUILD_CONFIGURATION }}/cncnet5.pdb ./artifact/Regular/cncnet5.pdb
copy ./${{ env.BUILD_CONFIGURATION }}/cncnet5.dll ./artifact/Regular/cncnet5.dll
mkdir ./artifact/HardEnd
copy ./LICENSE.md ./artifact/HardEnd/LICENSE.md
copy ./README.md ./artifact/HardEnd/README.md
copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/cncnet5.pdb" ./artifact/HardEnd/cncnet5.pdb
copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/cncnet5.dll" ./artifact/HardEnd/cncnet5.dll
7z a ${{ env.ARTIFACT_NAME }} ./artifact/*
- name: Upload New Release
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ yrpp-spawner-private/
Release/**
DevBuild/**
Debug/**
Release-HardEnd/**
DevBuild-HardEnd/**
Debug-HardEnd/**

.vs/**
.vscode/**
Expand Down
2 changes: 2 additions & 0 deletions .vscode/c_cpp_properties.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
],
"defines": [
"SYR_VER=2",
"IS_RELEASE_VER",
"IS_HARDEND_VER",
"HAS_EXCEPTIONS=0",
"NOMINMAX",
"_CRT_SECURE_NO_WARNINGS",
Expand Down
26 changes: 23 additions & 3 deletions Spawner.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-HardEnd|Win32">
<Configuration>Release-HardEnd</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DevBuild-HardEnd|Win32">
<Configuration>DevBuild-HardEnd</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-HardEnd|Win32">
<Configuration>Debug-HardEnd</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
Expand Down Expand Up @@ -67,23 +79,31 @@
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release-HardEnd' Or '$(Configuration)'=='DevBuild-HardEnd' Or '$(Configuration)'=='Debug-HardEnd'">
<ClCompile>
<PreprocessorDefinitions>IS_HARDEND_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>IS_HARDEND_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='Release-HardEnd'">
<ClCompile>
<PreprocessorDefinitions>IS_RELEASE_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>IS_RELEASE_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='DevBuild'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='DevBuild' Or '$(Configuration)'=='DevBuild-HardEnd'">
<ClCompile>
<PreprocessorDefinitions>DevBuild;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>DevBuild;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Debug-HardEnd'">
<ClCompile>
<PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
Expand Down
11 changes: 10 additions & 1 deletion Spawner.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32929.386
MinimumVisualStudioVersion = 10.0.40219.1
Project("{4A3F0CD1-23BA-4A2A-A6A2-72D7B87E0468}") = "YRpp-Spawner", "Spawner.vcxproj", "{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YRpp-Spawner", "Spawner.vcxproj", "{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Debug-HardEnd|x86 = Debug-HardEnd|x86
DevBuild|x86 = DevBuild|x86
DevBuild-HardEnd|x86 = DevBuild-HardEnd|x86
Release|x86 = Release|x86
Release-HardEnd|x86 = Release-HardEnd|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Debug|x86.ActiveCfg = Debug|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Debug|x86.Build.0 = Debug|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Debug-HardEnd|x86.ActiveCfg = Debug-HardEnd|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Debug-HardEnd|x86.Build.0 = Debug-HardEnd|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.DevBuild|x86.ActiveCfg = DevBuild|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.DevBuild|x86.Build.0 = DevBuild|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.DevBuild-HardEnd|x86.ActiveCfg = DevBuild-HardEnd|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.DevBuild-HardEnd|x86.Build.0 = DevBuild-HardEnd|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Release|x86.ActiveCfg = Release|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Release|x86.Build.0 = Release|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Release-HardEnd|x86.ActiveCfg = Release-HardEnd|Win32
{264BD0D2-4BF7-4CFF-B33E-95A018BEA951}.Release-HardEnd|x86.Build.0 = Release-HardEnd|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
39 changes: 21 additions & 18 deletions Spawner.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,44 @@
<!-- Root -->
<ResourceCompile Include="$(ThisDir)\src\version.rc" />
<ClCompile Include="$(ThisDir)\src\Main.cpp" />
<ClCompile Include="$(ThisDir)\src\Main.Config.cpp" />
<ClCompile Include="$(ThisDir)\src\Main.Ext.cpp" />
<ClCompile Include="$(ThisDir)\src\Main.Hook.cpp" />
<ClCompile Include="$(ThisDir)\src\Main.Config.cpp" />
<!-- Ext -->
<ClCompile Include="$(ThisDir)\src\Ext\Event\Body.cpp" />
<!-- HardEndStuff -->
<ClCompile Include="$(ThisDir)\src\HardEndStuff\AppIcon.cpp" />
<ClCompile Include="$(ThisDir)\src\HardEndStuff\Misc.cpp" />
<ClCompile Include="$(ThisDir)\src\HardEndStuff\Ra2Mode.cpp" />
<!-- Misc -->
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.Perf.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.Blowfish.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.CommonCrashes.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.ExceptionCatch.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.IsoMapPack5Limit.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.Perf.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Bugfixes.SpawnManager.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\CopyProtection.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\DisableEdgeScrolling.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\InGameChat.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\NoCD.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Observers.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\Observers.Visibility.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\QuickExit.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\VideoMode.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\CopyProtection.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\SkipScoreScreen.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\SavedGamesInSubdir.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\DisableEdgeScrolling.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\InGameChat.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\SkipScoreScreen.cpp" />
<ClCompile Include="$(ThisDir)\src\Misc\VideoMode.cpp" />
<!-- Spawner -->
<ClCompile Include="$(ThisDir)\src\Spawner\Spawner.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Spawner.Hook.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Spawner.Config.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\CustomMixes.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\NetHack.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\ProtocolZero.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\ProtocolZero.Hook.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\ProtocolZero.LatencyLevel.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\QuickMatch.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Ra2Mode.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\CustomMixes.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\RandomMap.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Spawner.Config.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Spawner.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Spawner.Hook.cpp" />
<ClCompile Include="$(ThisDir)\src\Spawner\Statistics.cpp" />
<!-- Utilities -->
<ClCompile Include="$(ThisDir)\src\Utilities\Debug.cpp" />
Expand All @@ -61,24 +64,24 @@
<!-- Header files -->
<ItemGroup>
<!-- Root -->
<ClInclude Include="$(ThisDir)\src\Main.h" />
<ClInclude Include="$(ThisDir)\src\version.h" />
<ClInclude Include="$(ThisDir)\src\Main.h" />
<ClInclude Include="$(ThisDir)\src\Main.Config.h" />
<!-- Ext -->
<ClInclude Include="$(ThisDir)\src\Ext\Event\Body.h" />
<!-- HardEndStuff -->
<ClInclude Include="$(ThisDir)\src\HardEndStuff\Ra2Mode.h" />
<!-- Misc -->
<ClInclude Include="$(ThisDir)\src\Misc\NoCD.h" />
<!-- Spawner -->
<ClInclude Include="$(ThisDir)\src\Spawner\Spawner.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\Spawner.Config.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\NetHack.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\ProtocolZero.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\ProtocolZero.LatencyLevel.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\Ra2Mode.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\Spawner.Config.h" />
<ClInclude Include="$(ThisDir)\src\Spawner\Spawner.h" />
<!-- Utilities -->
<ClInclude Include="$(ThisDir)\src\Utilities\Debug.h" />
<ClInclude Include="$(ThisDir)\src\Utilities\Patch.h" />
<ClInclude Include="$(ThisDir)\src\Utilities\DumperTypes.h" />
<ClInclude Include="$(ThisDir)\src\Utilities\Macro.h" />
<ClInclude Include="$(ThisDir)\src\Utilities\Patch.h" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions scripts/build_debug-hardend.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@if not defined _echo echo off

rem Builds YRpp-Spawner Debug-HardEnd.

rem Ensure we're in correct directory.
cd /D "%~dp0"

call run_msbuild /maxCpuCount /consoleloggerparameters:NoSummary /property:Configuration=Debug-HardEnd
2 changes: 1 addition & 1 deletion scripts/build_debug.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if not defined _echo echo off

rem Builds YRpp-Spawner DevBuild.
rem Builds YRpp-Spawner Debug.

rem Ensure we're in correct directory.
cd /D "%~dp0"
Expand Down
8 changes: 8 additions & 0 deletions scripts/build_devbuild-hardend.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@if not defined _echo echo off

rem Builds YRpp-Spawner DevBuild-HardEnd.

rem Ensure we're in correct directory.
cd /D "%~dp0"

call run_msbuild /maxCpuCount /consoleloggerparameters:NoSummary /property:Configuration=DevBuild-HardEnd
2 changes: 1 addition & 1 deletion scripts/build_devbuild.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if not defined _echo echo off

rem Builds Phobos DevBuild.
rem Builds YRpp-Spawner DevBuild.

rem Ensure we're in correct directory.
cd /D "%~dp0"
Expand Down
8 changes: 8 additions & 0 deletions scripts/build_release-hardend.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@if not defined _echo echo off

rem Builds YRpp-Spawner Release-HardEnd.

rem Ensure we're in correct directory.
cd /D "%~dp0"

call run_msbuild /maxCpuCount /consoleloggerparameters:NoSummary /property:Configuration=Release-HardEnd
4 changes: 4 additions & 0 deletions scripts/clean.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ cd /D "%~dp0"
cd ..

if exist Debug\ rmdir /S /Q Debug\
if exist DevBuild\ rmdir /S /Q DevBuild\
if exist Release\ rmdir /S /Q Release\
if exist Debug-HardEnd\ rmdir /S /Q Debug-HardEnd\
if exist DevBuild-HardEnd\ rmdir /S /Q DevBuild-HardEnd\
if exist Release-HardEnd\ rmdir /S /Q Release-HardEnd\
16 changes: 16 additions & 0 deletions src/HardEndStuff/AppIcon.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifdef IS_HARDEND_VER
#include <Utilities/Macro.h>
#include "Ra2Mode.h"

HANDLE __fastcall UI_ApplyAppIcon()
{
char* iconPath = Ra2Mode::IsEnabled()
? "./Resources/ra2.ico"
: "./Resources/clienticon.ico";

return LoadImageA(NULL, iconPath, IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
}

DEFINE_PATCH(0x777C41, 0x90, 0x90, 0x90, 0x90); // Disable Phobos hook (0x777C41, UI_ApplyAppIcon, 0x9)
DEFINE_JUMP(CALL, 0x777C45, GET_OFFSET(UI_ApplyAppIcon));
#endif
Loading

0 comments on commit 04388e9

Please sign in to comment.