mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-28 07:56:51 +01:00
Two fixes taken from worthlessnorms' pull request 16. The bug it was
opened for, rewritten copies read back from the mod's folder, was fixed
separately in 6fd3845.
Mod merge (Engine/Vfs/mod_merge_cas_store.cpp, mod_merge_combine.cpp)
- To combine two mods' edits the merge reads each mod's copy from the
mod's own folder, which means turning its placement in the merged
patch back into the mod's archive and offset. It took the first of the
mod's blocks in that patch archive. A mod added while the game runs
has all its archives appended to the patch's archive 1, so a copy in
its second archive was looked for in its first, the read failed, and
the asset kept the highest-priority copy.
- unshift() picks the block the offset falls in. Of two blocks that
start at the same byte the later one is used: the earlier is an empty
archive.
- Reproduced with a cosmetic mod rebuilt as two archives and added to a
running merge: cas_main_bundlereftable "could not be combined (Cannot
read ...\cas_01.cas)" before, "combined 2 edits (101 preset(s))"
after. A launch merge gives every archive an index of its own and was
not affected; 40 installed mods merge exactly as before.
- mod_merge_unshift_tests covers an archive with its own index, three
appended blocks, bytes before the first block, and an empty archive.
Tests (CMakeLists.txt, Extension/Multiplayer/Test/mesh_tests.cpp)
- multiplayer_lobbies did not link: steam_lobbies.cpp calls
contains_bad_words and the target did not link dingosdk_word_filter.
- multiplayer_mesh did not link: four functions the session code calls
had no stub. Two are the ones the pull request adds
(update_developer_hoodie, remote_skater_generation); the developer
board has since added update_developer_board and remote_board_entity.
- Both targets build and their tests pass.
Co-authored-by: worthlessnorms <110003169+worthlessnorms@users.noreply.github.com>
139 lines
9.5 KiB
CMake
139 lines
9.5 KiB
CMake
if(WIN32)
|
|
add_executable(dingosdk_launcher WIN32 Launcher/main.cpp Launcher/launch.cpp
|
|
Launcher/gui.cpp Launcher/gui_launcher.cpp Launcher/gui_renderer.cpp Launcher/gui_home.cpp
|
|
Launcher/gui_settings.cpp Launcher/gui_sign_in.cpp Launcher/gui_mods.cpp Launcher/gui_mods_browse.cpp
|
|
Launcher/updater.cpp Launcher/mod_manager.cpp Launcher/thunderstore.cpp Launcher/problem.h)
|
|
target_link_libraries(dingosdk_launcher PRIVATE dingosdk_logging dingosdk_content_cache_install dingosdk_world_layer_scan dingosdk_launcher_support dingosdk_initfs
|
|
dingosdk_mod_list dingosdk_mods dingosdk_json dingosdk_miniz dingosdk_imgui winhttp shell32 dwmapi windowscodecs ole32)
|
|
set_target_properties(dingosdk_launcher PROPERTIES OUTPUT_NAME "ReSkateLauncher")
|
|
dingosdk_version_info(dingosdk_launcher "ReSkate launcher" "ReSkateLauncher.exe" VFT_APP)
|
|
endif()
|
|
|
|
option(DINGOSDK_BUILD_LAUNCHER_TESTS "Build launcher mod manager regression tests" OFF)
|
|
if(DINGOSDK_BUILD_LAUNCHER_TESTS AND WIN32)
|
|
enable_testing()
|
|
add_executable(dingosdk_mod_manager_tests Launcher/Test/mod_manager_tests.cpp Launcher/mod_manager.cpp)
|
|
target_link_libraries(dingosdk_mod_manager_tests PRIVATE dingosdk_mod_list dingosdk_launcher_support dingosdk_miniz shell32)
|
|
add_test(NAME launcher_mod_manager COMMAND dingosdk_mod_manager_tests)
|
|
add_executable(dingosdk_thunderstore_tests Launcher/Test/thunderstore_tests.cpp Launcher/thunderstore.cpp)
|
|
target_link_libraries(dingosdk_thunderstore_tests PRIVATE dingosdk_json dingosdk_miniz)
|
|
target_include_directories(dingosdk_thunderstore_tests PRIVATE "${PROJECT_SOURCE_DIR}")
|
|
add_test(NAME launcher_thunderstore COMMAND dingosdk_thunderstore_tests)
|
|
add_executable(dingosdk_content_catalogs_tests Engine/Vfs/Test/content_catalogs_tests.cpp)
|
|
target_link_libraries(dingosdk_content_catalogs_tests PRIVATE dingosdk_content_cache)
|
|
add_test(NAME content_catalogs COMMAND dingosdk_content_catalogs_tests)
|
|
add_executable(dingosdk_content_cache_install_tests Engine/Vfs/Test/content_cache_install_tests.cpp)
|
|
target_link_libraries(dingosdk_content_cache_install_tests PRIVATE dingosdk_content_cache_install)
|
|
add_test(NAME content_cache_install COMMAND dingosdk_content_cache_install_tests)
|
|
add_executable(dingosdk_item_thumbnails_tests Engine/Vfs/Test/item_thumbnails_tests.cpp)
|
|
target_link_libraries(dingosdk_item_thumbnails_tests PRIVATE dingosdk_game_archives)
|
|
add_test(NAME item_thumbnails COMMAND dingosdk_item_thumbnails_tests "${DINGOSDK_TEST_GAME_ROOT}")
|
|
add_executable(dingosdk_world_layer_scan_tests Engine/Vfs/Test/world_layer_scan_tests.cpp)
|
|
target_link_libraries(dingosdk_world_layer_scan_tests PRIVATE dingosdk_world_layer_scan)
|
|
add_test(NAME world_layer_scan COMMAND dingosdk_world_layer_scan_tests "${DINGOSDK_TEST_GAME_ROOT}")
|
|
add_executable(dingosdk_mod_merge_grid_tests Engine/Vfs/Test/mod_merge_grid_tests.cpp)
|
|
target_link_libraries(dingosdk_mod_merge_grid_tests PRIVATE dingosdk_mods)
|
|
add_test(NAME mod_merge_grid COMMAND dingosdk_mod_merge_grid_tests "${DINGOSDK_TEST_GAME_ROOT}")
|
|
add_executable(dingosdk_mod_build_stamp_tests Engine/Vfs/Test/mod_build_stamp_tests.cpp)
|
|
target_link_libraries(dingosdk_mod_build_stamp_tests PRIVATE dingosdk_mods)
|
|
target_include_directories(dingosdk_mod_build_stamp_tests PRIVATE "${PROJECT_SOURCE_DIR}")
|
|
add_test(NAME mod_build_stamp COMMAND dingosdk_mod_build_stamp_tests)
|
|
add_executable(dingosdk_bundle_ref_table_tests Engine/Vfs/Test/bundle_ref_table_tests.cpp)
|
|
target_link_libraries(dingosdk_bundle_ref_table_tests PRIVATE dingosdk_mods)
|
|
add_test(NAME bundle_ref_table COMMAND dingosdk_bundle_ref_table_tests)
|
|
add_executable(dingosdk_mod_scoring_tests Engine/Vfs/Test/mod_scoring_tests.cpp)
|
|
target_link_libraries(dingosdk_mod_scoring_tests PRIVATE dingosdk_mods)
|
|
add_test(NAME mod_scoring COMMAND dingosdk_mod_scoring_tests "${DINGOSDK_TEST_GAME_ROOT}")
|
|
add_executable(dingosdk_mod_merge_unshift_tests Engine/Vfs/Test/mod_merge_unshift_tests.cpp)
|
|
target_link_libraries(dingosdk_mod_merge_unshift_tests PRIVATE dingosdk_mods)
|
|
target_include_directories(dingosdk_mod_merge_unshift_tests PRIVATE "${PROJECT_SOURCE_DIR}")
|
|
add_test(NAME mod_merge_unshift COMMAND dingosdk_mod_merge_unshift_tests)
|
|
endif()
|
|
|
|
if(WIN32)
|
|
# Launcher fonts (OFL / Apache, licences beside them) and the background photo,
|
|
# embedded when present. A ReSkateLauncher.background.jpg beside the exe
|
|
# overrides the photo at runtime.
|
|
set(launcher_fonts "${PROJECT_SOURCE_DIR}/External/fonts")
|
|
set(launcher_resources
|
|
"FONT_HEADING RCDATA \"${launcher_fonts}/Montserrat-ExtraBold.ttf\"\n"
|
|
"FONT_BODY RCDATA \"${launcher_fonts}/Montserrat-SemiBold.ttf\"\n"
|
|
"FONT_BRUSH RCDATA \"${launcher_fonts}/PermanentMarker-Regular.ttf\"\n")
|
|
set(launcher_background "${PROJECT_SOURCE_DIR}/assets/launcher/background.jpg")
|
|
if(EXISTS "${launcher_background}")
|
|
list(APPEND launcher_resources "LAUNCHER_BACKGROUND RCDATA \"${launcher_background}\"\n")
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${launcher_background}")
|
|
endif()
|
|
# Tile icons: the skate tool on MODS, the wheel on SETTINGS.
|
|
foreach(tile_icon mods settings)
|
|
set(tile_icon_path "${PROJECT_SOURCE_DIR}/assets/launcher/icon_${tile_icon}.png")
|
|
if(EXISTS "${tile_icon_path}")
|
|
string(TOUPPER "${tile_icon}" tile_icon_name)
|
|
list(APPEND launcher_resources "LAUNCHER_ICON_${tile_icon_name} RCDATA \"${tile_icon_path}\"\n")
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${tile_icon_path}")
|
|
endif()
|
|
endforeach()
|
|
# Icon resource 1: the exe's icon in Explorer and the window's icon.
|
|
set(launcher_icon "${PROJECT_SOURCE_DIR}/assets/launcher/icon.ico")
|
|
if(EXISTS "${launcher_icon}")
|
|
list(PREPEND launcher_resources "1 ICON \"${launcher_icon}\"\n")
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${launcher_icon}")
|
|
endif()
|
|
string(CONCAT launcher_resources ${launcher_resources})
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated/launcher_resources.rc" "${launcher_resources}")
|
|
target_sources(dingosdk_launcher PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated/launcher_resources.rc")
|
|
endif()
|
|
|
|
# Off for local builds so a deployed development DLL is never replaced by a release.
|
|
option(DINGOSDK_LAUNCHER_AUTO_UPDATE "Let the launcher replace itself and ReSkate.dll from the launcher config" OFF)
|
|
|
|
# Updates come from the public GitHub releases of DINGOSDK_RELEASE_REPO: the launcher and
|
|
# server read launcher.json (game depot/manifest and the pinned downloads) from the latest
|
|
# release. No credentials are built in. Build folders configured before releases moved
|
|
# still cache the old private repo, which no public build can read.
|
|
if(DINGOSDK_RELEASE_REPO STREQUAL "Dingo-Shenanigans/DingoSDK")
|
|
unset(DINGOSDK_RELEASE_REPO CACHE)
|
|
endif()
|
|
set(DINGOSDK_RELEASE_REPO "Dingo-Shenanigans/ReSkate" CACHE STRING "Public GitHub owner/repo whose releases update the launcher")
|
|
set(launcher_release_repo "${DINGOSDK_RELEASE_REPO}")
|
|
if(NOT launcher_release_repo MATCHES "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$")
|
|
message(FATAL_ERROR "DINGOSDK_RELEASE_REPO must be owner/repo")
|
|
endif()
|
|
if(DINGOSDK_LAUNCHER_AUTO_UPDATE)
|
|
set(launcher_binary_updates true)
|
|
else()
|
|
set(launcher_binary_updates false)
|
|
endif()
|
|
configure_file(cmake/templates/launcher_update_config.h.in generated/launcher_update_config.h @ONLY)
|
|
|
|
if(WIN32)
|
|
# ReSkateEmotePacker: a folder of pictures and GIFs -> the chat emote pack (emotes.json +
|
|
# emotes.png) that ReSkate.dll bakes in from assets/emotes.
|
|
add_executable(dingosdk_emote_packer EmotePacker/main.cpp)
|
|
target_link_libraries(dingosdk_emote_packer PRIVATE dingosdk_json windowscodecs ole32)
|
|
set_target_properties(dingosdk_emote_packer PROPERTIES OUTPUT_NAME "ReSkateEmotePacker")
|
|
endif()
|
|
|
|
# ReSkate dedicated server: a headless session host. It runs from its own folder
|
|
# next to steam_api64.dll and the Steam client files; no game install needed.
|
|
# On Linux next to libsteam_api.so; self-update is disabled there (see server_update.cpp).
|
|
add_executable(dingosdk_server Server/main.cpp Server/server_host.cpp Server/server_party.cpp
|
|
Extension/Multiplayer/Session/party_book.cpp Server/server_config.cpp Server/steam_server.cpp
|
|
Server/server_update.cpp $<$<BOOL:${WIN32}>:Launcher/updater.cpp>
|
|
Extension/Multiplayer/Steam/steam_transport.cpp Extension/Multiplayer/Net/protocol.cpp
|
|
Extension/Multiplayer/Net/delta_codec.cpp Extension/Multiplayer/Net/wire_codec.cpp
|
|
Extension/Multiplayer/Remote/playback_buffers.cpp Extension/Multiplayer/Session/password.cpp
|
|
Server/server_activity.cpp Server/server_votes.cpp Extension/Throwdowns/throwdown_wire.cpp)
|
|
target_include_directories(dingosdk_server SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/External/steam_networking")
|
|
if(WIN32)
|
|
target_link_libraries(dingosdk_server PRIVATE dingosdk_launcher_support dingosdk_world_layer_scan dingosdk_json
|
|
dingosdk_lz4 dingosdk_zstd dingosdk_logging dingosdk_miniz dingosdk_word_filter winhttp bcrypt winmm)
|
|
set_target_properties(dingosdk_server PROPERTIES OUTPUT_NAME "ReSkateServer")
|
|
dingosdk_version_info(dingosdk_server "ReSkate dedicated server" "ReSkateServer.exe" VFT_APP)
|
|
else()
|
|
find_package(OpenSSL REQUIRED)
|
|
target_link_libraries(dingosdk_server PRIVATE dingosdk_launcher_support dingosdk_world_layer_scan dingosdk_json
|
|
dingosdk_lz4 dingosdk_zstd dingosdk_miniz dingosdk_word_filter OpenSSL::Crypto dl pthread)
|
|
set_target_properties(dingosdk_server PROPERTIES OUTPUT_NAME "ReSkateServer")
|
|
endif()
|