Skip to content

Commit

Permalink
Update to Steamworks 1.59
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfairh committed May 1, 2024
1 parent df29c7b commit 932cd36
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 324 deletions.
33 changes: 14 additions & 19 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ custom_groups:
- SteamAPI
- SteamGameServerAPI
- SteamEncryptedAppTicket
- name: SteamAppList
topics:
- name: Interfaces
children:
- SteamAppList
- name: Callbacks
children:
- SteamAppInstalled
- SteamAppUninstalled
- name: SteamApps
topics:
- name: Interfaces
Expand Down Expand Up @@ -245,7 +236,6 @@ custom_groups:
- InputAnalogActionData
- InputDigitalActionData
- InputMotionData
- InputMotionDataV2
- SteamInputActionEvent
- name: Callbacks
children:
Expand Down Expand Up @@ -663,15 +653,15 @@ custom_groups:
- LowBatteryPower
- SteamAPICallCompleted
- SteamShutdown
- name: SteamVideo
topics:
- name: Interfaces
children:
- SteamVideo
- name: Callbacks
children:
- GetOPFSettingsResult
- GetVideoURLResult
- name: SteamVideo
topics:
- name: Interfaces
children:
- SteamVideo
- name: Callbacks
children:
- GetOPFSettingsResult
- GetVideoURLResult
- name: Common Types
topics:
- name: Simple types
Expand All @@ -687,6 +677,9 @@ custom_groups:
- SteamAPICall
- SteamAPIWarningMessageHook
- SteamErrMsg
- SteamUnsafeMutablePointer
- SteamUnsafeMutableRawPointer
- SteamUnsafeRawPointer
- name: Enumerations and Option Sets
children:
- AccountType
Expand All @@ -706,6 +699,7 @@ custom_groups:
- PlayerResult
- Result
- ServerMode
- SteamAPIInitResult
- SteamIPType
- SteamIPv6ConnectivityProtocol
- SteamIPv6ConnectivityState
Expand All @@ -717,6 +711,7 @@ custom_groups:
- GameID
- SteamID
- SteamIPAddress
- SteamUncheckedSendable
- name: Constants
topics:
- name: Constants
Expand Down
2 changes: 0 additions & 2 deletions DocIndex/docc-custom-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- ``SteamGameServerAPI``
- ``SteamEncryptedAppTicket``
### Interfaces
- <doc:SteamAppList-Interface>
- <doc:SteamApps-Interface>
- <doc:SteamFriends-Interface>
- <doc:SteamGameSearch-Interface>
Expand All @@ -32,7 +31,6 @@
- <doc:SteamUser-Interface>
- <doc:SteamUserStats-Interface>
- <doc:SteamUtils-Interface>
- <doc:SteamVideo-Interface>
### Common Types
- <doc:Common-Types>
- ``SteamConstants``
4 changes: 0 additions & 4 deletions DocIndex/docc-steambase-callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@
- ``onSearchForGameProgressCallback(_:)``
- ``onSearchForGameResultCallback(_:)``
- ``onSteamAPICallCompleted(_:)``
- ``onSteamAppInstalled(_:)``
- ``onSteamAppUninstalled(_:)``
- ``onSteamInputConfigurationLoaded(_:)``
- ``onSteamInputDeviceConnected(_:)``
- ``onSteamInputDeviceDisconnected(_:)``
Expand Down Expand Up @@ -257,8 +255,6 @@
- ``searchForGameProgressCallback``
- ``searchForGameResultCallback``
- ``steamAPICallCompleted``
- ``steamAppInstalled``
- ``steamAppUninstalled``
- ``steamInputConfigurationLoaded``
- ``steamInputDeviceConnected``
- ``steamInputDeviceDisconnected``
Expand Down
19 changes: 0 additions & 19 deletions DocIndex/jazzy-custom-groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@
- SteamAPI
- SteamGameServerAPI
- SteamEncryptedAppTicket
- name: SteamAppList
topics:
- name: Interfaces
children:
- SteamAppList
- name: Callbacks
children:
- SteamAppInstalled
- SteamAppUninstalled
- name: SteamApps
topics:
- name: Interfaces
Expand Down Expand Up @@ -215,7 +206,6 @@
- InputAnalogActionData
- InputDigitalActionData
- InputMotionData
- InputMotionDataV2
- SteamInputActionEvent
- name: Callbacks
children:
Expand Down Expand Up @@ -633,15 +623,6 @@
- LowBatteryPower
- SteamAPICallCompleted
- SteamShutdown
- name: SteamVideo
topics:
- name: Interfaces
children:
- SteamVideo
- name: Callbacks
children:
- GetOPFSettingsResult
- GetVideoURLResult
- name: Common Types
topics:
- name: Simple types
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![macOS](https://shields.io/badge/platform-macOS%20|%20Linux%20|%20%3F%3F-lightgrey)
![Steamworks 1.58](https://shields.io/badge/steamworks-1.58-lightgrey)
![Steamworks 1.59](https://shields.io/badge/steamworks-1.59-lightgrey)
[![Test](https://github.com/johnfairh/steamworks-swift/actions/workflows/test.yml/badge.svg)](https://github.com/johnfairh/steamworks-swift/actions/workflows/test.yml)
![MIT](https://shields.io/badge/license-MIT-black)

Expand Down
5 changes: 2 additions & 3 deletions Sources/CSteamworks/steamapi_headers.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include <steam/steam_api.h>
#include <steam/steam_gameserver.h>

// Steamworks 1.58 has api_flat & json that's missing from
// isteamvideo and it straight-up doesn't build.
enum ETimelineGameMode {};
// Steamworks 1.59 still has fucked up SteamVideo json
S_API ISteamVideo *SteamAPI_SteamVideo_v004();

#include <steam/steam_api_flat.h>
#include <steam/steamnetworkingfakeip.h>
Expand Down
7 changes: 5 additions & 2 deletions Sources/LibGenerate/DocStructure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ struct DocStructure {
"isteamgamecoordinator.h", // ??
"isteamps3overlayrenderer.h", // PS3
"isteamnetworking.h", // deprecated

"isteamvideo.h" // randomly broken in 1.59
])

guard !ignoredISteamHeaders.contains(filename) else {
Expand Down Expand Up @@ -243,7 +245,7 @@ struct DocStructure {
/// Take the URL of a header file and return a collection of all its referenced (#include'd) files
/// along with the Swift versions of the top-level types they define.
private func swiftTypesFromHeader(url: URL) throws -> SwiftTypeSets {
Dictionary(uniqueKeysWithValues: (try ClangNode(file: url).inner ?? [])
Dictionary((try ClangNode(file: url).inner ?? [])
.segmentify { $0.loc?.file != nil }
.filter { $0.filepath.hasPrefix(io.includeURL.path) }
.map { nodes in
Expand All @@ -256,7 +258,8 @@ struct DocStructure {
.map(\.unnested)
.map { nodes in
(nodes.filename, Set(nodes.compactMap { $0.swiftTypeName }))
}
},
uniquingKeysWith: { a, b in a.union(b) }
)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/LibGenerate/Resources/EXPECTED_SDK
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.58
1.59
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
- ``InputAnalogActionData``
- ``InputDigitalActionData``
- ``InputMotionData``
- ``InputMotionDataV2``
- ``SteamInputActionEvent``

### Callbacks
Expand Down
11 changes: 11 additions & 0 deletions Sources/Steamworks/Generated/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public enum SteamConstants {
/// Steamworks `k_cchFilenameMax`
public static let filenameMaxSize = Int(260)

/// Steamworks `k_usFriendGameInfoQueryPort_Error`
public static let friendGameInfoQueryPortError = UInt16(0xFFFE)

/// Steamworks `k_usFriendGameInfoQueryPort_NotInitialized`
public static let friendGameInfoQueryPortNotInitialized = UInt16(0xFFFF)

/// Steamworks `k_cchGameExtraInfoMax`
public static let gameExtraInfoMaxSize = Int(64)

Expand Down Expand Up @@ -168,6 +174,11 @@ extension InputHandle {
public static let invalid = InputHandle(0)
}

extension AccountID {
/// Steamworks `k_uAccountIdInvalid`
public static let invalid = AccountID(0)
}

extension SteamAPICall {
/// Steamworks `k_uAPICallInvalid`
public static let invalid = SteamAPICall(0x0)
Expand Down
36 changes: 27 additions & 9 deletions Sources/Steamworks/Generated/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,8 @@ public enum ItemPreviewType: CUnsignedInt, Sendable {
case environmentMapHorizontalCross = 3
/// Steamworks `k_EItemPreviewType_EnvironmentMap_LatLong`
case environmentMapLatLong = 4
/// Steamworks `k_EItemPreviewType_Clip`
case clip = 5
/// Steamworks `k_EItemPreviewType_ReservedMax`
case reservedMax = 255
/// Some undocumented value
Expand Down Expand Up @@ -1716,6 +1718,8 @@ public struct ItemState: OptionSet, Sendable {
public static let downloading = ItemState(rawValue: 16)
/// Steamworks `k_EItemStateDownloadPending`
public static let downloadPending = ItemState(rawValue: 32)
/// Steamworks `k_EItemStateDisabledLocally`
public static let disabledLocally = ItemState(rawValue: 64)
}

extension EItemState: RawConvertible { typealias From = ItemState }
Expand Down Expand Up @@ -2036,8 +2040,8 @@ public enum ParentalFeature: CUnsignedInt, Sendable {
case test = 12
/// Steamworks `k_EFeatureSiteLicense`
case siteLicense = 13
/// Steamworks `k_EFeatureKioskMode`
case kioskMode = 14
/// Steamworks `k_EFeatureKioskMode_Deprecated`
case kioskModeDeprecated = 14
/// Steamworks `k_EFeatureMax`
case max = 15
/// Some undocumented value
Expand Down Expand Up @@ -2474,8 +2478,12 @@ public enum Result: CUnsignedInt, Sendable {
case cachedCredentialInvalid = 126
/// Steamworks `K_EResultPhoneNumberIsVOIP`
case phoneNumberIsVOIP = 127
/// Steamworks `k_EResultNotSupported`
case notSupported = 128
/// Steamworks `k_EResultFamilySizeLimitExceeded`
case familySizeLimitExceeded = 129
/// Some undocumented value
case unrepresentedInSwift = 128
case unrepresentedInSwift = 130
}

extension EResult: RawConvertible { typealias From = Result }
Expand Down Expand Up @@ -2564,8 +2572,10 @@ public enum SteamDeviceFormFactor: CUnsignedInt, Sendable {
case computer = 3
/// Steamworks `k_ESteamDeviceFormFactorTV`
case tv = 4
/// Steamworks `k_ESteamDeviceFormFactorVRHeadset`
case vrHeadset = 5
/// Some undocumented value
case unrepresentedInSwift = 5
case unrepresentedInSwift = 6
}

extension ESteamDeviceFormFactor: RawConvertible { typealias From = SteamDeviceFormFactor }
Expand Down Expand Up @@ -3008,6 +3018,8 @@ public enum SteamNetworkingConfigValueSetting: CUnsignedInt, Sendable {
case fakeRateLimitRecvRate = 44
/// Steamworks `k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst`
case fakeRateLimitRecvBurst = 45
/// Steamworks `k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds`
case outOfOrderCorrectionWindowMicroseconds = 51
/// Steamworks `k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged`
case callbackConnectionStatusChanged = 201
/// Steamworks `k_ESteamNetworkingConfig_Callback_AuthStatusChanged`
Expand Down Expand Up @@ -3048,12 +3060,14 @@ public enum SteamNetworkingConfigValueSetting: CUnsignedInt, Sendable {
case sdrClientSingleSocket = 22
/// Steamworks `k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster`
case sdrClientForceRelayCluster = 29
/// Steamworks `k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress`
case sdrClientDebugTicketAddress = 30
/// Steamworks `k_ESteamNetworkingConfig_SDRClient_DevTicket`
case sdrClientDevTicket = 30
/// Steamworks `k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr`
case sdrClientForceProxyAddr = 31
/// Steamworks `k_ESteamNetworkingConfig_SDRClient_FakeClusterPing`
case sdrClientFakeClusterPing = 36
/// Steamworks `k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN`
case sdrClientLimitPingProbesToNearestN = 60
/// Steamworks `k_ESteamNetworkingConfig_LogLevel_AckRTT`
case logLevelAckRTT = 13
/// Steamworks `k_ESteamNetworkingConfig_LogLevel_PacketDecode`
Expand All @@ -3066,10 +3080,12 @@ public enum SteamNetworkingConfigValueSetting: CUnsignedInt, Sendable {
case logLevelP2PRendezvous = 17
/// Steamworks `k_ESteamNetworkingConfig_LogLevel_SDRRelayPings`
case logLevelSDRRelayPings = 18
/// Steamworks `k_ESteamNetworkingConfig_ECN`
case ecn = 999
/// Steamworks `k_ESteamNetworkingConfig_DELETED_EnumerateDevVars`
case deletedEnumerateDevVars = 35
/// Some undocumented value
case unrepresentedInSwift = 208
case unrepresentedInSwift = 1000
}

extension ESteamNetworkingConfigValue: RawConvertible { typealias From = SteamNetworkingConfigValueSetting }
Expand Down Expand Up @@ -3650,10 +3666,12 @@ public enum WorkshopFileType: CUnsignedInt, Sendable {
case steamVideo = 14
/// Steamworks `k_EWorkshopFileTypeGameManagedItem`
case gameManagedItem = 15
/// Steamworks `k_EWorkshopFileTypeClip`
case clip = 16
/// Steamworks `k_EWorkshopFileTypeMax`
case max = 16
case max = 17
/// Some undocumented value
case unrepresentedInSwift = 17
case unrepresentedInSwift = 18
}

extension EWorkshopFileType: RawConvertible { typealias From = WorkshopFileType }
Expand Down
Loading

0 comments on commit 932cd36

Please sign in to comment.