Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 54c623d

Browse files
authored
Merge pull request #206 from PazerOP/msix_package
2 parents 987a1ef + a0e825e commit 54c623d

File tree

88 files changed

+3883
-1104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3883
-1104
lines changed

.github/workflows/ccpp.yml

Lines changed: 346 additions & 38 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,4 @@ staging/cfg/settings.json
346346
out/
347347
staging/debug_report.zip
348348
staging/cfg/playerlist.json
349+
staging/cfg/.non_portable

CMakeLists.txt

Lines changed: 13 additions & 272 deletions
Original file line numberDiff line numberDiff line change
@@ -1,282 +1,23 @@
1-
cmake_minimum_required(VERSION 3.17.2)
2-
project(tf2_bot_detector VERSION 1.1.0.10)
1+
cmake_minimum_required(VERSION 3.17)
32

4-
include(GenerateExportHeader)
5-
6-
message("TF2BD CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
7-
8-
option(TF2BD_IS_CI_COMPILE "Set to true if this is a compile on a CI service. Used to help determine if user has made modifications to the source code." off)
9-
if (TF2BD_IS_CI_COMPILE)
10-
add_compile_definitions(TF2BD_IS_CI_COMPILE=1)
11-
else()
12-
add_compile_definitions(TF2BD_IS_CI_COMPILE=0)
13-
endif()
3+
option(TF2BD_ENABLE_DISCORD_INTEGRATION "Enable discord integration" on)
4+
option(TF2BD_ENABLE_TESTS "Enable test compilation" off)
145

15-
# Generate PDBs for release builds - RelWithDebInfo is NOT a Release build!
16-
if (MSVC)
17-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
18-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
19-
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
20-
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
21-
endif()
6+
include(cmake/init-preproject.cmake)
7+
project(tf2_bot_detector)
8+
include(cmake/init-postproject.cmake)
229

23-
set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE true)
24-
if (MSVC AND (CMAKE_BUILD_TYPE MATCHES "Release"))
25-
add_link_options(/OPT:REF /OPT:ICF)
26-
endif()
10+
set_warning_level(1)
11+
set(ENABLE_EXAMPLES off CACHE BOOL "Build examples" FORCE)
12+
add_subdirectory("submodules/cppcoro")
2713

14+
set_warning_level(3)
2815
add_subdirectory(submodules/ValveFileVDF)
2916
add_subdirectory(submodules/SourceRCON)
3017
add_subdirectory(submodules/imgui_desktop)
3118
add_subdirectory(submodules/mh_stuff)
3219

33-
set(ENABLE_EXAMPLES off CACHE BOOL "Build examples" FORCE)
34-
add_subdirectory("submodules/cppcoro")
35-
36-
if (WIN32)
37-
add_library(tf2_bot_detector SHARED)
38-
set_target_properties(tf2_bot_detector PROPERTIES PDB_NAME "tf2_bot_detector_dll")
39-
40-
generate_export_header(tf2_bot_detector
41-
EXPORT_FILE_NAME "tf2_bot_detector/tf2_bot_detector_export.h"
42-
)
43-
44-
add_executable(tf2_bot_detector_launcher WIN32
45-
"tf2_bot_detector/Platform/Windows/CrashHandler.cpp"
46-
"tf2_bot_detector/Launcher/main.cpp"
47-
"tf2_bot_detector/Launcher/Resources.rc"
48-
)
49-
target_compile_definitions(tf2_bot_detector_launcher PRIVATE TF2BD_LAUNCHER_USE_WINMAIN)
50-
51-
target_include_directories(tf2_bot_detector_launcher PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tf2_bot_detector)
52-
target_link_libraries(tf2_bot_detector_launcher PRIVATE tf2_bot_detector)
53-
set_target_properties(tf2_bot_detector_launcher PROPERTIES OUTPUT_NAME "tf2_bot_detector")
54-
set_property(TARGET tf2_bot_detector_launcher PROPERTY CXX_STANDARD 17)
55-
else()
56-
add_executable(tf2_bot_detector
57-
"tf2_bot_detector/Launcher/main.cpp"
58-
)
59-
endif()
60-
61-
target_sources(tf2_bot_detector PRIVATE
62-
"tf2_bot_detector/Actions/RCONActionManager.cpp"
63-
"tf2_bot_detector/Actions/RCONActionManager.h"
64-
"tf2_bot_detector/Actions/ActionGenerators.cpp"
65-
"tf2_bot_detector/Actions/ActionGenerators.h"
66-
"tf2_bot_detector/Actions/Actions.cpp"
67-
"tf2_bot_detector/Actions/Actions.h"
68-
"tf2_bot_detector/Actions/HijackActionManager.h"
69-
"tf2_bot_detector/Actions/HijackActionManager.cpp"
70-
"tf2_bot_detector/Actions/IActionManager.h"
71-
"tf2_bot_detector/Actions/ICommandSource.h"
72-
"tf2_bot_detector/Config/ConfigHelpers.cpp"
73-
"tf2_bot_detector/Config/ConfigHelpers.h"
74-
"tf2_bot_detector/Config/DRPInfo.cpp"
75-
"tf2_bot_detector/Config/DRPInfo.h"
76-
"tf2_bot_detector/Config/PlayerListJSON.cpp"
77-
"tf2_bot_detector/Config/PlayerListJSON.h"
78-
"tf2_bot_detector/Config/Rules.cpp"
79-
"tf2_bot_detector/Config/Rules.h"
80-
"tf2_bot_detector/Config/Settings.cpp"
81-
"tf2_bot_detector/Config/Settings.h"
82-
"tf2_bot_detector/Config/SponsorsList.h"
83-
"tf2_bot_detector/Config/SponsorsList.cpp"
84-
"tf2_bot_detector/ConsoleLog/ConsoleLogParser.h"
85-
"tf2_bot_detector/ConsoleLog/ConsoleLogParser.cpp"
86-
"tf2_bot_detector/ConsoleLog/ConsoleLines.cpp"
87-
"tf2_bot_detector/ConsoleLog/ConsoleLines.h"
88-
"tf2_bot_detector/ConsoleLog/IConsoleLine.h"
89-
"tf2_bot_detector/ConsoleLog/ConsoleLineListener.cpp"
90-
"tf2_bot_detector/ConsoleLog/ConsoleLineListener.h"
91-
"tf2_bot_detector/ConsoleLog/NetworkStatus.cpp"
92-
"tf2_bot_detector/ConsoleLog/NetworkStatus.h"
93-
"tf2_bot_detector/GameData/MatchmakingQueue.h"
94-
"tf2_bot_detector/GameData/TFClassType.h"
95-
"tf2_bot_detector/GameData/TFParty.h"
96-
"tf2_bot_detector/GameData/UserMessageType.h"
97-
"tf2_bot_detector/Networking/GithubAPI.h"
98-
"tf2_bot_detector/Networking/GithubAPI.cpp"
99-
"tf2_bot_detector/Networking/HTTPClient.h"
100-
"tf2_bot_detector/Networking/HTTPClient.cpp"
101-
"tf2_bot_detector/Networking/HTTPHelpers.h"
102-
"tf2_bot_detector/Networking/HTTPHelpers.cpp"
103-
"tf2_bot_detector/Networking/NetworkHelpers.h"
104-
"tf2_bot_detector/Networking/NetworkHelpers.cpp"
105-
"tf2_bot_detector/Networking/SteamAPI.h"
106-
"tf2_bot_detector/Networking/SteamAPI.cpp"
107-
"tf2_bot_detector/Platform/Platform.h"
108-
"tf2_bot_detector/SetupFlow/BasicSettingsPage.h"
109-
"tf2_bot_detector/SetupFlow/BasicSettingsPage.cpp"
110-
"tf2_bot_detector/SetupFlow/ChatWrappersGeneratorPage.h"
111-
"tf2_bot_detector/SetupFlow/ChatWrappersGeneratorPage.cpp"
112-
"tf2_bot_detector/SetupFlow/ChatWrappersVerifyPage.h"
113-
"tf2_bot_detector/SetupFlow/ChatWrappersVerifyPage.cpp"
114-
"tf2_bot_detector/SetupFlow/ISetupFlowPage.h"
115-
"tf2_bot_detector/SetupFlow/NetworkSettingsPage.h"
116-
"tf2_bot_detector/SetupFlow/NetworkSettingsPage.cpp"
117-
"tf2_bot_detector/SetupFlow/SetupFlow.cpp"
118-
"tf2_bot_detector/SetupFlow/SetupFlow.h"
119-
"tf2_bot_detector/SetupFlow/TF2CommandLinePage.h"
120-
"tf2_bot_detector/SetupFlow/TF2CommandLinePage.cpp"
121-
"tf2_bot_detector/UI/ImGui_TF2BotDetector.cpp"
122-
"tf2_bot_detector/UI/ImGui_TF2BotDetector.h"
123-
"tf2_bot_detector/UI/MainWindow.cpp"
124-
"tf2_bot_detector/UI/MainWindow.Scoreboard.cpp"
125-
"tf2_bot_detector/UI/MainWindow.h"
126-
"tf2_bot_detector/Util/JSONUtils.h"
127-
"tf2_bot_detector/Util/PathUtils.cpp"
128-
"tf2_bot_detector/Util/PathUtils.h"
129-
"tf2_bot_detector/Util/TextUtils.cpp"
130-
"tf2_bot_detector/Util/TextUtils.h"
131-
"tf2_bot_detector/BaseTextures.h"
132-
"tf2_bot_detector/BaseTextures.cpp"
133-
"tf2_bot_detector/BatchedAction.h"
134-
"tf2_bot_detector/Bitmap.h"
135-
"tf2_bot_detector/Bitmap.cpp"
136-
"tf2_bot_detector/Clock.cpp"
137-
"tf2_bot_detector/Clock.h"
138-
"tf2_bot_detector/CompensatedTS.cpp"
139-
"tf2_bot_detector/CompensatedTS.h"
140-
"tf2_bot_detector/Config/ChatWrappers.cpp"
141-
"tf2_bot_detector/Config/ChatWrappers.h"
142-
"tf2_bot_detector/DLLMain.cpp"
143-
"tf2_bot_detector/DLLMain.h"
144-
"tf2_bot_detector/IPlayer.cpp"
145-
"tf2_bot_detector/IPlayer.h"
146-
"tf2_bot_detector/Log.cpp"
147-
"tf2_bot_detector/Log.h"
148-
"tf2_bot_detector/ModeratorLogic.cpp"
149-
"tf2_bot_detector/ModeratorLogic.h"
150-
"tf2_bot_detector/PlayerStatus.h"
151-
"tf2_bot_detector/SteamID.cpp"
152-
"tf2_bot_detector/SteamID.h"
153-
"tf2_bot_detector/TextureManager.h"
154-
"tf2_bot_detector/TextureManager.cpp"
155-
"tf2_bot_detector/TFConstants.h"
156-
"tf2_bot_detector/Version.h"
157-
"tf2_bot_detector/WorldEventListener.cpp"
158-
"tf2_bot_detector/WorldEventListener.h"
159-
"tf2_bot_detector/WorldState.cpp"
160-
"tf2_bot_detector/WorldState.h"
161-
)
162-
163-
configure_file(tf2_bot_detector/Version.base.h tf2_bot_detector/Version.h)
164-
target_include_directories(tf2_bot_detector PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tf2_bot_detector)
165-
166-
if(WIN32)
167-
if ((CMAKE_BUILD_TYPE MATCHES "Release"))
168-
set(TF2BD_RESOURCE_FILEFLAGS "0")
169-
else()
170-
set(TF2BD_RESOURCE_FILEFLAGS "VS_FF_DEBUG")
171-
endif()
172-
configure_file(tf2_bot_detector/Resources.base.rc tf2_bot_detector/Resources.rc)
173-
174-
target_sources(tf2_bot_detector PRIVATE
175-
"tf2_bot_detector/Platform/Windows/Processes.cpp"
176-
"tf2_bot_detector/Platform/Windows/Shell.cpp"
177-
"tf2_bot_detector/Platform/Windows/Steam.cpp"
178-
"tf2_bot_detector/Platform/Windows/WindowsHelpers.h"
179-
"tf2_bot_detector/Resources.rc"
180-
)
181-
endif()
182-
183-
target_include_directories(tf2_bot_detector
184-
PRIVATE tf2_bot_detector
185-
)
186-
target_compile_definitions(tf2_bot_detector PRIVATE WIN32_LEAN_AND_MEAN)
187-
188-
option(TF2BD_ENABLE_DISCORD_INTEGRATION "Enable discord integration" on)
189-
if (TF2BD_ENABLE_DISCORD_INTEGRATION)
190-
target_compile_definitions(tf2_bot_detector PRIVATE TF2BD_ENABLE_DISCORD_INTEGRATION)
191-
find_library(DISCORD_GAME_SDK discord_game_sdk)
192-
message("DISCORD_GAME_SDK = ${DISCORD_GAME_SDK}")
193-
target_link_libraries(tf2_bot_detector PRIVATE ${DISCORD_GAME_SDK})
194-
195-
find_path(GAME_SDK_INCLUDE discord-game-sdk/discord.h)
196-
target_include_directories(tf2_bot_detector PRIVATE ${DISCORD_GAME_SDK_INCLUDE})
197-
198-
find_library(DISCORD_CPP_GAME_SDK discord_game_sdk_cpp)
199-
message("DISCORD_CPP_GAME_SDK = ${DISCORD_CPP_GAME_SDK}")
200-
target_link_libraries(tf2_bot_detector PRIVATE ${DISCORD_CPP_GAME_SDK})
201-
202-
target_sources(tf2_bot_detector PRIVATE
203-
"tf2_bot_detector/DiscordRichPresence.cpp"
204-
"tf2_bot_detector/DiscordRichPresence.h"
205-
)
206-
endif()
207-
208-
find_package(OpenSSL REQUIRED)
209-
target_link_libraries(tf2_bot_detector)
210-
211-
find_path(HTTPLIB_PATH NAMES httplib.h)
212-
target_include_directories(tf2_bot_detector PRIVATE ${HTTPLIB_PATH})
213-
214-
find_package(nlohmann_json CONFIG REQUIRED)
215-
find_package(libzippp CONFIG REQUIRED)
216-
find_package(fmt CONFIG REQUIRED)
217-
218-
target_link_libraries(tf2_bot_detector PRIVATE
219-
imgui_desktop
220-
mh_stuff
221-
ValveFileVDF
222-
libzip::libzip
223-
libzippp::libzippp
224-
cppcoro
225-
SourceRCON
226-
OpenSSL::SSL # cpp-httplib requires openssl
227-
nlohmann_json::nlohmann_json
228-
fmt::fmt
229-
)
230-
231-
option(TF2BD_ENABLE_TESTS "Enable test compilation" off)
232-
if (TF2BD_ENABLE_TESTS)
233-
enable_testing()
234-
235-
find_package(Catch2 CONFIG REQUIRED)
236-
target_link_libraries(tf2_bot_detector PRIVATE Catch2::Catch2)
237-
target_compile_definitions(tf2_bot_detector PRIVATE TF2BD_ENABLE_TESTS)
238-
target_sources(tf2_bot_detector PRIVATE
239-
"tf2_bot_detector/Tests/Catch2.cpp"
240-
"tf2_bot_detector/Tests/ConsoleLineTests.cpp"
241-
"tf2_bot_detector/Tests/Tests.h"
242-
)
243-
244-
SET(TF2BD_ENABLE_CLI_EXE true)
245-
246-
add_test(NAME TF2BD_Tests COMMAND tf2_bot_detector_cli --run-tests
247-
WORKING_DIRECTORY staging
248-
)
249-
endif()
250-
251-
if(TF2BD_ENABLE_CLI_EXE)
252-
add_executable(tf2_bot_detector_cli "tf2_bot_detector/Launcher/main.cpp")
253-
target_include_directories(tf2_bot_detector_cli PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tf2_bot_detector)
254-
target_link_libraries(tf2_bot_detector_cli PRIVATE tf2_bot_detector)
255-
set_property(TARGET tf2_bot_detector_cli PROPERTY CXX_STANDARD 17)
256-
endif()
257-
258-
# TODO: Find a way to do this locally
259-
if(MSVC)
260-
target_compile_options(tf2_bot_detector PRIVATE /WX)
261-
endif()
262-
263-
set_property(TARGET tf2_bot_detector PROPERTY CXX_STANDARD 20)
264-
if (MSVC)
265-
add_definitions(/await)
266-
endif()
267-
268-
set_target_properties(tf2_bot_detector PROPERTIES
269-
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/staging"
270-
)
20+
add_subdirectory(tf2_bot_detector_common)
21+
# add_subdirectory(tf2_bot_detector_updater)
22+
add_subdirectory(tf2_bot_detector)
27123

272-
# "installation" aka create a build we can upload to github as a release
273-
if (WIN32)
274-
file(GLOB TF2BD_INSTALL_DEPS_DLL LIST_DIRECTORIES false "${CMAKE_BINARY_DIR}/*.dll")
275-
install(FILES ${TF2BD_INSTALL_DEPS_DLL} DESTINATION /)
276-
endif()
277-
install(DIRECTORY staging/ staging/ DESTINATION "/" FILES_MATCHING
278-
PATTERN "*"
279-
PATTERN "staging/cfg/settings.json" EXCLUDE
280-
PATTERN "staging/logs" EXCLUDE
281-
)
282-
install(TARGETS tf2_bot_detector DESTINATION /)

CMakeSettings.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
{
1+
{
22
"configurations": [
33
{
44
"name": "x64-Debug",
55
"generator": "Ninja",
66
"configurationType": "Debug",
77
"inheritEnvironments": [ "msvc_x64_x64" ],
8-
"buildRoot": "${projectDir}\\out\\build\\${name}",
9-
"installRoot": "${projectDir}\\out\\install\\${name}",
8+
"buildRoot": "${projectDir}\\out\\build_tf2_bot_detector\\${name}",
9+
"installRoot": "${projectDir}\\out\\install_tf2_bot_detector\\${name}",
1010
"cmakeCommandArgs": "",
1111
"buildCommandArgs": "",
1212
"ctestCommandArgs": "",
@@ -23,8 +23,8 @@
2323
"name": "x64-Release",
2424
"generator": "Ninja",
2525
"configurationType": "Release",
26-
"buildRoot": "${projectDir}\\out\\build\\${name}",
27-
"installRoot": "${projectDir}\\out\\install\\${name}",
26+
"buildRoot": "${projectDir}\\out\\build_tf2_bot_detector\\${name}",
27+
"installRoot": "${projectDir}\\out\\install_tf2_bot_detector\\${name}",
2828
"cmakeCommandArgs": "",
2929
"buildCommandArgs": "",
3030
"ctestCommandArgs": "",
@@ -42,8 +42,8 @@
4242
"name": "x86-Release",
4343
"generator": "Ninja",
4444
"configurationType": "Release",
45-
"buildRoot": "${projectDir}\\out\\build\\${name}",
46-
"installRoot": "${projectDir}\\out\\install\\${name}",
45+
"buildRoot": "${projectDir}\\out\\build_tf2_bot_detector\\${name}",
46+
"installRoot": "${projectDir}\\out\\install_tf2_bot_detector\\${name}",
4747
"cmakeCommandArgs": "",
4848
"buildCommandArgs": "",
4949
"ctestCommandArgs": "",
@@ -61,8 +61,8 @@
6161
"name": "x86-Debug",
6262
"generator": "Ninja",
6363
"configurationType": "Debug",
64-
"buildRoot": "${projectDir}\\out\\build\\${name}",
65-
"installRoot": "${projectDir}\\out\\install\\${name}",
64+
"buildRoot": "${projectDir}\\out\\build_tf2_bot_detector\\${name}",
65+
"installRoot": "${projectDir}\\out\\install_tf2_bot_detector\\${name}",
6666
"cmakeCommandArgs": "",
6767
"buildCommandArgs": "",
6868
"ctestCommandArgs": "",
@@ -77,4 +77,4 @@
7777
"cmakeToolchain": "submodules/vcpkg/scripts/buildsystems/vcpkg.cmake"
7878
}
7979
]
80-
}
80+
}

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
<br />
3131
-->
3232
<br />
33+
<a href="https://tf2bd-util.pazer.us/Redirect/AppInstaller?source=https://tf2bd-util.pazer.us/AppInstaller/Nightly.appinstaller">Install</a>
34+
·
3335
<a href="https://github.com/PazerOP/tf2_bot_detector/issues">Report a Bug</a>
3436
·
3537
<a href="https://github.com/PazerOP/tf2_bot_detector/issues">Request a Feature</a>
@@ -68,13 +70,16 @@
6870

6971
These instructions will give a quick overview of getting started with TF2BD. There is also a (very slightly out of date, but still useable) video by CrazyGunman#6724 [here][install-video].
7072

71-
### Prerequisites
73+
### Installation
74+
75+
#### Automatic Install
7276

73-
>A note about 64 bit vs 32 bit: If your computer was made after 2011 it is 64 bit and you should use the 64 bit version.
77+
If you are using Windows 10 1809 or newer, just click this link: [Install][msix-install-link]
7478

75-
This program requires [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019][mscr-link] ([32bit version available here][mscr86-link])
79+
#### Powershell Install
80+
`Add-AppxPackage -AppInstallerFile https://tf2bd-util.pazer.us/AppInstaller/Nightly.appinstaller`
7681

77-
### Installation
82+
#### Manual/Portable Install
7883

7984
1. Download and install the [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019][mscr-link]
8085
2. Download the [latest release][latest-64] ([32bit version][latest-86])
@@ -182,6 +187,7 @@ Huge thanks to the people sponsoring this project via [GitHub Sponsors][github-s
182187
[discord-link]: https://discord.gg/W8ZSh3Z
183188
[mscr-link]: https://aka.ms/vs/16/release/vc_redist.x64.exe
184189
[mscr86-link]: https://aka.ms/vs/16/release/vc_redist.x86.exe
190+
[msix-install-link]: https://tf2bd-util.pazer.us/Redirect/AppInstaller?source=https://tf2bd-util.pazer.us/AppInstaller/Nightly.appinstaller
185191
[zip-image]: https://i.imgur.com/ZeCuUul.png
186192
[github-sponsors-pazerop]: https://github.com/sponsors/PazerOP
187193
[wiki-customization-link]: https://github.com/PazerOP/tf2_bot_detector/wiki/Customization#third-party-player-lists

0 commit comments

Comments
 (0)