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 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 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; 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}, diff --git a/steamworks/structs.py b/steamworks/structs.py index e93a432..e123dad 100644 --- a/steamworks/structs.py +++ b/steamworks/structs.py @@ -4,10 +4,14 @@ class FindLeaderboardResult_t(Structure): """Represents the STEAMWORKS LeaderboardFindResult_t call result type""" - _fields_ = [("leaderboardHandle", c_uint64), ("leaderboardFound", c_uint32)] + _layout_ = "ms" + _pack_ = 4 + _fields_ = [("leaderboardHandle", c_uint64), ("leaderboardFound", c_uint8)] class CreateItemResult_t(Structure): + _layout_ = "ms" + _pack_ = 4 _fields_ = [ ("result", c_int), ("publishedFileId", c_uint64), @@ -16,6 +20,8 @@ class CreateItemResult_t(Structure): class SubmitItemUpdateResult_t(Structure): + _layout_ = "ms" + _pack_ = 4 _fields_ = [ ("result", c_int), ("userNeedsToAcceptWorkshopLegalAgreement", c_bool), @@ -24,10 +30,19 @@ class SubmitItemUpdateResult_t(Structure): class ItemInstalled_t(Structure): - _fields_ = [("appId", c_uint32), ("publishedFileId", c_uint64)] + _layout_ = "ms" + _pack_ = 4 + _fields_ = [ + ("appId", c_uint32), + ("publishedFileId", c_uint64), + ("legacyContent", c_uint64), + ("manifestId", c_uint64), + ] class GetAppDependenciesResult(Structure): + _layout_ = "ms" + _pack_ = 4 _fields_ = [ ("result", c_int32), ("publishedFileId", c_uint64), @@ -46,8 +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)]