Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
*.dylib
!redist/windows/*.dll
!redist/osx/*.dylib
!redist/linux/*.so
!redist/linux/*.so
steamworks_sdk_*.zip
library/sdk/
2 changes: 1 addition & 1 deletion library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 7 additions & 18 deletions library/SteamworksPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions steamworks/interfaces/userstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion steamworks/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
23 changes: 21 additions & 2 deletions steamworks/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -16,6 +20,8 @@ class CreateItemResult_t(Structure):


class SubmitItemUpdateResult_t(Structure):
_layout_ = "ms"
_pack_ = 4
_fields_ = [
("result", c_int),
("userNeedsToAcceptWorkshopLegalAgreement", c_bool),
Expand All @@ -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),
Expand All @@ -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)]