From e23829962fbd475491a1bcf4df5aefb4cee204a5 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Tue, 5 Dec 2023 15:12:01 -0800 Subject: [PATCH 1/3] Upgrade steamworks and fix for Ninja build --- cmake/externals/steamworks/CMakeLists.txt | 72 +++++++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/cmake/externals/steamworks/CMakeLists.txt b/cmake/externals/steamworks/CMakeLists.txt index 47e5029206b..4654a38d900 100644 --- a/cmake/externals/steamworks/CMakeLists.txt +++ b/cmake/externals/steamworks/CMakeLists.txt @@ -4,18 +4,82 @@ set(EXTERNAL_NAME steamworks) string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER) -set(STEAMWORKS_URL "${EXTERNAL_BUILD_ASSETS}/dependencies/steamworks_sdk_137.zip") -set(STEAMWORKS_URL_MD5 "95ba9d0e3ddc04f8a8be17d2da806cbb") - +set(STEAMWORKS_URL "${EXTERNAL_BUILD_ASSETS}/dependencies/steamworks_sdk_158a.zip") +set(STEAMWORKS_URL_SHA512 "fe906a7510a2125ab1441ad349e8bc31fafc9ab8130ec3843287e615a850305a8ed303e8d9e5bae4fee06024987834fb9f64c6c10d3da3784267a4906e59c831") + +# Ninja needs to know all the files that result from this upfront, so we need to tell it what files this is going +# to generate with BUILD_BYPRODUCTS. We need to include all the files that are going to be referenced from elsewhere +# in the build. +# +# This should include both libraries and headers, since from the point of view of the build, those are the outputs +# of the project, even though we're not actually building anything here, and just unzipping an existing binary. +# +# I believe this list can't be obtained automatically from the compressed file, and needs to be generated by hand. +# Steam SDK .zip has a sdk/ subdirectory, but for ExternalProject, this gets turned into project/src/steamworks. +# So inside the SDK, sdk/redistributable_bin/steam_api.dll becomes project/src/steamworks/redistributable_bin/steam_api.dll +# This can be seen under $BUILD_DIR/ext. ExternalProject_Add( ${EXTERNAL_NAME} URL ${STEAMWORKS_URL} - URL_MD5 ${STEAMWORKS_URL_MD5} + URL_HASH SHA512=${STEAMWORKS_URL_SHA512} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" LOG_DOWNLOAD 1 DOWNLOAD_EXTRACT_TIMESTAMP 1 + BUILD_BYPRODUCTS + "project/src/steamworks/redistributable_bin/win64/steam_api64.lib" + "project/src/steamworks/redistributable_bin/win64/steam_api64.dll" + "project/src/steamworks/redistributable_bin/osx/steam_api.dylib" + "project/src/steamworks/redistributable_bin/linux64/steam_api.so" + "project/src/steamworks/redistributable_bin/linux32/steam_api.so" + "project/src/steamworks/redistributable_bin/steam_api.lib" + "project/src/steamworks/redistributable_bin/steam_api.dll" + "project/src/steamworks/public/steam/isteamapplist.h" + "project/src/steamworks/public/steam/isteamapps.h" + "project/src/steamworks/public/steam/isteamappticket.h" + "project/src/steamworks/public/steam/isteamclient.h" + "project/src/steamworks/public/steam/isteamcontroller.h" + "project/src/steamworks/public/steam/isteamdualsense.h" + "project/src/steamworks/public/steam/isteamfriends.h" + "project/src/steamworks/public/steam/isteamgamecoordinator.h" + "project/src/steamworks/public/steam/isteamgameserver.h" + "project/src/steamworks/public/steam/isteamgameserverstats.h" + "project/src/steamworks/public/steam/isteamhtmlsurface.h" + "project/src/steamworks/public/steam/isteamhttp.h" + "project/src/steamworks/public/steam/isteaminput.h" + "project/src/steamworks/public/steam/isteaminventory.h" + "project/src/steamworks/public/steam/isteammatchmaking.h" + "project/src/steamworks/public/steam/isteammusic.h" + "project/src/steamworks/public/steam/isteammusicremote.h" + "project/src/steamworks/public/steam/isteamnetworking.h" + "project/src/steamworks/public/steam/isteamnetworkingmessages.h" + "project/src/steamworks/public/steam/isteamnetworkingsockets.h" + "project/src/steamworks/public/steam/isteamnetworkingutils.h" + "project/src/steamworks/public/steam/isteamparentalsettings.h" + "project/src/steamworks/public/steam/isteamps3overlayrenderer.h" + "project/src/steamworks/public/steam/isteamremoteplay.h" + "project/src/steamworks/public/steam/isteamremotestorage.h" + "project/src/steamworks/public/steam/isteamscreenshots.h" + "project/src/steamworks/public/steam/isteamugc.h" + "project/src/steamworks/public/steam/isteamuser.h" + "project/src/steamworks/public/steam/isteamuserstats.h" + "project/src/steamworks/public/steam/isteamutils.h" + "project/src/steamworks/public/steam/isteamvideo.h" + "project/src/steamworks/public/steam/matchmakingtypes.h" + "project/src/steamworks/public/steam/steam_api_common.h" + "project/src/steamworks/public/steam/steam_api_flat.h" + "project/src/steamworks/public/steam/steam_api.h" + "project/src/steamworks/public/steam/steam_api_internal.h" + "project/src/steamworks/public/steam/steamclientpublic.h" + "project/src/steamworks/public/steam/steamencryptedappticket.h" + "project/src/steamworks/public/steam/steam_gameserver.h" + "project/src/steamworks/public/steam/steamhttpenums.h" + "project/src/steamworks/public/steam/steamnetworkingfakeip.h" + "project/src/steamworks/public/steam/steamnetworkingtypes.h" + "project/src/steamworks/public/steam/steamps3params.h" + "project/src/steamworks/public/steam/steamtypes.h" + "project/src/steamworks/public/steam/steamuniverse.h" ) set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals") From 24e3777caa503f743074f835097b841114b15083 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Tue, 5 Dec 2023 15:48:57 -0800 Subject: [PATCH 2/3] Fix Steam API plugin for latest SDK --- plugins/steamClient/src/SteamAPIPlugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/steamClient/src/SteamAPIPlugin.cpp b/plugins/steamClient/src/SteamAPIPlugin.cpp index 853a53e8813..b6e5b2ea770 100644 --- a/plugins/steamClient/src/SteamAPIPlugin.cpp +++ b/plugins/steamClient/src/SteamAPIPlugin.cpp @@ -73,7 +73,7 @@ HAuthTicket SteamTicketRequests::startRequest(TicketRequestCallback callback) { uint32 ticketSize { 0 }; char ticket[MAX_TICKET_SIZE]; - auto authTicket = SteamUser()->GetAuthSessionTicket(ticket, MAX_TICKET_SIZE, &ticketSize); + auto authTicket = SteamUser()->GetAuthSessionTicket(ticket, MAX_TICKET_SIZE, &ticketSize, NULL); qDebug() << "Got Steam auth session ticket:" << authTicket; if (authTicket == k_HAuthTicketInvalid) { @@ -282,7 +282,8 @@ void SteamAPIPlugin::runCallbacks() { return; } - Steam_RunCallbacks(steamPipe, false); + //Steam_RunCallbacks(steamPipe, false); + SteamAPI_RunCallbacks(); } void SteamAPIPlugin::requestTicket(TicketRequestCallback callback) { From a4d2fb6167ac75ad02b710fe0b834baf52d8a64d Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Wed, 6 Dec 2023 19:52:14 +0100 Subject: [PATCH 3/3] Fix Steamworks .so names on Linux --- cmake/externals/steamworks/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/externals/steamworks/CMakeLists.txt b/cmake/externals/steamworks/CMakeLists.txt index 4654a38d900..62961f46a49 100644 --- a/cmake/externals/steamworks/CMakeLists.txt +++ b/cmake/externals/steamworks/CMakeLists.txt @@ -31,8 +31,8 @@ ExternalProject_Add( "project/src/steamworks/redistributable_bin/win64/steam_api64.lib" "project/src/steamworks/redistributable_bin/win64/steam_api64.dll" "project/src/steamworks/redistributable_bin/osx/steam_api.dylib" - "project/src/steamworks/redistributable_bin/linux64/steam_api.so" - "project/src/steamworks/redistributable_bin/linux32/steam_api.so" + "project/src/steamworks/redistributable_bin/linux64/libsteam_api.so" + "project/src/steamworks/redistributable_bin/linux32/libsteam_api.so" "project/src/steamworks/redistributable_bin/steam_api.lib" "project/src/steamworks/redistributable_bin/steam_api.dll" "project/src/steamworks/public/steam/isteamapplist.h"