From ceb81b90ecff841b68f585ecc6efc45828c7453d Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Thu, 21 May 2026 17:09:59 +0200 Subject: [PATCH 1/6] Update SDK version reference to 1.64 in build README Co-Authored-By: Claude Opus 4.6 (1M context) --- library/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/README.md b/library/README.md index f32ea35..c8da19d 100644 --- a/library/README.md +++ b/library/README.md @@ -6,7 +6,7 @@ Steamworks account holders. A Steamworks account is free and can be registered at https://partner.steamgames.com -The source files can be downloaded here (log-in required): https://partner.steamgames.com/downloads/steamworks_sdk_147.zip (v1.47) +The source files can be downloaded here (log-in required): https://partner.steamgames.com/downloads/steamworks_sdk_164.zip (v1.64) Unpack the archive and place the contents of: - /sdk/public/steam in SteamworksPy/library/sdk/steam From 1e7b1f0dfae8b295ad14275394a3cfe08c6f6465 Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Thu, 21 May 2026 17:13:41 +0200 Subject: [PATCH 2/6] Fix Python struct packing and field types for SDK 1.64 compatibility Changes to steamworks/structs.py: - Added _pack_ = 4 to all structs to match Steamworks SDK alignment (#pragma pack(push, 4)) - Fixed FindLeaderboardResult_t.leaderboardFound: c_uint32 -> c_uint8 (matches SDK definition) - Added new fields to ItemInstalled_t: legacyContent (c_uint64) and manifestId (c_uint64) for SDK 1.64 This fixes field offset mismatches on Linux/Mac and ensures structs match the SDK 1.64 ABI. Struct sizes verified: ItemInstalled_t=28, FindLeaderboardResult_t=12, SubscriptionResult=12 Co-Authored-By: Claude Opus 4.6 (1M context) --- steamworks/structs.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/steamworks/structs.py b/steamworks/structs.py index e93a432..cebd732 100644 --- a/steamworks/structs.py +++ b/steamworks/structs.py @@ -4,10 +4,12 @@ class FindLeaderboardResult_t(Structure): """Represents the STEAMWORKS LeaderboardFindResult_t call result type""" - _fields_ = [("leaderboardHandle", c_uint64), ("leaderboardFound", c_uint32)] + _pack_ = 4 + _fields_ = [("leaderboardHandle", c_uint64), ("leaderboardFound", c_uint8)] class CreateItemResult_t(Structure): + _pack_ = 4 _fields_ = [ ("result", c_int), ("publishedFileId", c_uint64), @@ -16,6 +18,7 @@ class CreateItemResult_t(Structure): class SubmitItemUpdateResult_t(Structure): + _pack_ = 4 _fields_ = [ ("result", c_int), ("userNeedsToAcceptWorkshopLegalAgreement", c_bool), @@ -24,10 +27,17 @@ class SubmitItemUpdateResult_t(Structure): class ItemInstalled_t(Structure): - _fields_ = [("appId", c_uint32), ("publishedFileId", c_uint64)] + _pack_ = 4 + _fields_ = [ + ("appId", c_uint32), + ("publishedFileId", c_uint64), + ("legacyContent", c_uint64), + ("manifestId", c_uint64), + ] class GetAppDependenciesResult(Structure): + _pack_ = 4 _fields_ = [ ("result", c_int32), ("publishedFileId", c_uint64), @@ -46,8 +56,10 @@ def get_app_dependencies_list(self) -> list: class SubscriptionResult(Structure): + _pack_ = 4 _fields_ = [("result", c_int32), ("publishedFileId", c_uint64)] class MicroTxnAuthorizationResponse_t(Structure): + _pack_ = 4 _fields_ = [("appId", c_uint32), ("orderId", c_uint64), ("authorized", c_bool)] From 0a1dbafd711578fb23d7dfee9fa2f48490ef6f03 Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Thu, 21 May 2026 17:14:15 +0200 Subject: [PATCH 3/6] Remove RequestCurrentStats from Python layer RequestCurrentStats was removed from the Steamworks SDK (deprecated and removed). Removed from both the STEAMWORKS_METHODS dict and the SteamUserStats interface class. Files modified: - steamworks/methods.py: Removed RequestCurrentStats from STEAMWORKS_METHODS - steamworks/interfaces/userstats.py: Removed RequestCurrentStats() method Co-Authored-By: Claude Opus 4.6 (1M context) --- steamworks/interfaces/userstats.py | 8 -------- steamworks/methods.py | 1 - 2 files changed, 9 deletions(-) diff --git a/steamworks/interfaces/userstats.py b/steamworks/interfaces/userstats.py index 385383f..b9587dc 100644 --- a/steamworks/interfaces/userstats.py +++ b/steamworks/interfaces/userstats.py @@ -80,14 +80,6 @@ def ResetAllStats(self, achievements: bool) -> bool: return self.steam.ResetAllStats(achievements) - def RequestCurrentStats(self) -> bool: - """Request all statistics and achievements from Steam servers - - :return: bool - """ - return self.steam.RequestCurrentStats() - - def SetAchievement(self, name: str) -> bool: """Set a given achievement diff --git a/steamworks/methods.py b/steamworks/methods.py index b6f4452..b5e5304 100644 --- a/steamworks/methods.py +++ b/steamworks/methods.py @@ -110,7 +110,6 @@ class InputDigitalActionData_t(Structure): "GetStatInt": {"restype": int}, "GetStatFloat": {"restype": c_float}, "ResetAllStats": {"restype": bool}, - "RequestCurrentStats": {"restype": bool}, "SetAchievement": {"restype": bool}, "SetStatInt": {"restype": bool}, "SetStatFloat": {"restype": bool}, From c712c338e0e8f1162b0ca95edde4e4c401fa8102 Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Thu, 21 May 2026 17:14:53 +0200 Subject: [PATCH 4/6] SDK 1.64 compatibility: Update C++ wrapper for new Steamworks API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit implements three compatibility fixes for Steamworks SDK 1.64: 1. Remove automatic RequestCurrentStats() call - Removed from SteamInit() initialization (SDK 1.64 calls this automatically) - Removed standalone RequestCurrentStats() wrapper function 2. Fix GetAuthSessionTicket signature - Added NULL parameter for new pSteamNetworkingIdentity argument - Function signature changed in SDK 1.64 3. Update deprecated Controller type names to Input types - ControllerHandle_t → InputHandle_t (5 occurrences) - ControllerDigitalActionHandle_t → InputDigitalActionHandle_t (1 occurrence) - These are typedef aliases to the same uint64 type, purely cosmetic update All changes maintain backward compatibility with existing Python wrapper. Co-Authored-By: Claude Opus 4.6 (1M context) --- library/SteamworksPy.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/library/SteamworksPy.cpp b/library/SteamworksPy.cpp index 359ed7a..d060818 100644 --- a/library/SteamworksPy.cpp +++ b/library/SteamworksPy.cpp @@ -313,10 +313,6 @@ SW_PY int SteamInit() { else if (!SteamUser()->BLoggedOn()) { status = ERR_NO_CONNECTION; } - // Steam is connected and active, so load the stats and achievements - if (status == OK && SteamUserStats() != NULL) { - SteamUserStats()->RequestCurrentStats(); - } // Return the Steamworks status return status; } @@ -702,18 +698,18 @@ SW_PY uint64_t GetCurrentActionSet(uint64_t controllerHandle){ } return (uint64_t) SteamInput()->GetCurrentActionSet((InputHandle_t) controllerHandle); } -// Get the input type (device model) for the specified controller. +// Get the input type (device model) for the specified controller. SW_PY uint64_t GetInputTypeForHandle(uint64_t controllerHandle){ if(SteamInput() == NULL){ return 0; } - return (uint64_t) SteamInput()->GetInputTypeForHandle((ControllerHandle_t)controllerHandle); + return (uint64_t) SteamInput()->GetInputTypeForHandle((InputHandle_t)controllerHandle); } // Returns the current state of the supplied digital game action. SW_PY InputDigitalActionData_t GetDigitalActionData(uint64_t controllerHandle, uint64_t digitalActionHandle){ InputDigitalActionData_t data; if(SteamInput() != NULL){ - data = SteamInput()->GetDigitalActionData((ControllerHandle_t)controllerHandle, (ControllerDigitalActionHandle_t)digitalActionHandle); + data = SteamInput()->GetDigitalActionData((InputHandle_t)controllerHandle, (InputDigitalActionHandle_t)digitalActionHandle); } return data; } @@ -742,7 +738,7 @@ SW_PY int GetGamepadIndexForController(uint64_t controllerHandle){ if(SteamInput() == NULL){ return -1; } - return SteamInput()->GetGamepadIndexForController((ControllerHandle_t) controllerHandle); + return SteamInput()->GetGamepadIndexForController((InputHandle_t) controllerHandle); } // Returns raw motion data for the specified controller. @@ -786,7 +782,7 @@ SW_PY bool ShowBindingPanel(uint64_t controllerHandle){ if(SteamInput()== NULL){ return false; } - return SteamInput()->ShowBindingPanel((ControllerHandle_t) controllerHandle); + return SteamInput()->ShowBindingPanel((InputHandle_t) controllerHandle); } // Stop SteamControllers interface. @@ -801,7 +797,7 @@ SW_PY void TriggerVibration(uint64_t controllerHandle, uint16_t leftSpeed, uint1 if(SteamInput()== NULL){ return; } - SteamInput()->TriggerVibration((ControllerHandle_t) controllerHandle, (unsigned short)leftSpeed, (unsigned short)rightSpeed); + SteamInput()->TriggerVibration((InputHandle_t) controllerHandle, (unsigned short)leftSpeed, (unsigned short)rightSpeed); } ///////////////////////////////////////////////// @@ -1021,7 +1017,7 @@ SW_PY int GetAuthSessionTicket(char* buffer) { return 0; } uint32 size{}; - SteamUser()->GetAuthSessionTicket(buffer, 1024, &size); + SteamUser()->GetAuthSessionTicket(buffer, 1024, &size, NULL); return size; } @@ -1085,13 +1081,6 @@ SW_PY bool ResetAllStats(bool achievesToo) { return SteamUserStats()->ResetAllStats(achievesToo); } -SW_PY bool RequestCurrentStats() { - if (SteamUser() == NULL) { - return false; - } - return SteamUserStats()->RequestCurrentStats(); -} - SW_PY bool SetAchievement(const char *name) { if (SteamUser() == NULL) { return false; From 9465e20ec50e495619f0b2c2eca8496b363a0e63 Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Thu, 21 May 2026 17:28:54 +0200 Subject: [PATCH 5/6] Add _layout_ = "ms" to silence Python 3.14+ deprecation warnings Python 3.14 warns when _pack_ is set without _layout_ on non-Windows platforms. Becomes an error in Python 3.19. Co-Authored-By: Claude Opus 4.6 (1M context) --- steamworks/structs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/steamworks/structs.py b/steamworks/structs.py index cebd732..e123dad 100644 --- a/steamworks/structs.py +++ b/steamworks/structs.py @@ -4,11 +4,13 @@ class FindLeaderboardResult_t(Structure): """Represents the STEAMWORKS LeaderboardFindResult_t call result type""" + _layout_ = "ms" _pack_ = 4 _fields_ = [("leaderboardHandle", c_uint64), ("leaderboardFound", c_uint8)] class CreateItemResult_t(Structure): + _layout_ = "ms" _pack_ = 4 _fields_ = [ ("result", c_int), @@ -18,6 +20,7 @@ class CreateItemResult_t(Structure): class SubmitItemUpdateResult_t(Structure): + _layout_ = "ms" _pack_ = 4 _fields_ = [ ("result", c_int), @@ -27,6 +30,7 @@ class SubmitItemUpdateResult_t(Structure): class ItemInstalled_t(Structure): + _layout_ = "ms" _pack_ = 4 _fields_ = [ ("appId", c_uint32), @@ -37,6 +41,7 @@ class ItemInstalled_t(Structure): class GetAppDependenciesResult(Structure): + _layout_ = "ms" _pack_ = 4 _fields_ = [ ("result", c_int32), @@ -56,10 +61,12 @@ def get_app_dependencies_list(self) -> list: class SubscriptionResult(Structure): + _layout_ = "ms" _pack_ = 4 _fields_ = [("result", c_int32), ("publishedFileId", c_uint64)] class MicroTxnAuthorizationResponse_t(Structure): + _layout_ = "ms" _pack_ = 4 _fields_ = [("appId", c_uint32), ("orderId", c_uint64), ("authorized", c_bool)] From a323397f2f1e049f7eb7bcf0aa769955f36c1f2c Mon Sep 17 00:00:00 2001 From: Anten Skrabec Date: Thu, 21 May 2026 17:30:46 +0200 Subject: [PATCH 6/6] update .gitignore for sdk zips and sdk files --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9ab794a..c24a884 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ *.dylib !redist/windows/*.dll !redist/osx/*.dylib -!redist/linux/*.so \ No newline at end of file +!redist/linux/*.so +steamworks_sdk_*.zip +library/sdk/ \ No newline at end of file