Move Blitz files to the Blitz subfolder.

This commit is contained in:
Michael Dirks
2015-06-06 18:45:48 +02:00
parent b7fd6fab14
commit 355aae6a6f
3 changed files with 538 additions and 31 deletions
+165
View File
@@ -0,0 +1,165 @@
; BlitzSteam - Steam wrapper for Blitz.
; Copyright (C) 2015 Project Kube (Michael Fabian Dirks)
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation, either version 3 of the
; License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public License
; along with this program. If not, see <http:;www.gnu.org/licenses/>.
;----------------------------------------------------------------
;-- Enumerations
;----------------------------------------------------------------
Const EResultOK = 1; ; success
Const EResultFail = 2; ; generic failure
Const EResultNoConnection = 3; ; no/failed network connection
Const EResultInvalidPassword = 5; ; password/ticket is invalid
Const EResultLoggedInElsewhere = 6; ; same user logged in elsewhere
Const EResultInvalidProtocolVer = 7; ; protocol version is incorrect
Const EResultInvalidParam = 8; ; a parameter is incorrect
Const EResultFileNotFound = 9; ; file was not found
Const EResultBusy = 10; ; called method busy - action not taken
Const EResultInvalidState = 11; ; called object was in an invalid state
Const EResultInvalidName = 12; ; name is invalid
Const EResultInvalidEmail = 13; ; email is invalid
Const EResultDuplicateName = 14; ; name is not unique
Const EResultAccessDenied = 15; ; access is denied
Const EResultTimeout = 16; ; operation timed out
Const EResultBanned = 17; ; VAC2 banned
Const EResultAccountNotFound = 18; ; account not found
Const EResultInvalidSteamID = 19; ; steamID is invalid
Const EResultServiceUnavailable = 20; ; The requested service is currently unavailable
Const EResultNotLoggedOn = 21; ; The user is not logged on
Const EResultPending = 22; ; Request is pending (may be in process; or waiting on third party)
Const EResultEncryptionFailure = 23; ; Encryption or Decryption failed
Const EResultInsufficientPrivilege = 24; ; Insufficient privilege
Const EResultLimitExceeded = 25; ; Too much of a good thing
Const EResultRevoked = 26; ; Access has been revoked (used for revoked guest passes)
Const EResultExpired = 27; ; License/Guest pass the user is trying to access is expired
Const EResultAlreadyRedeemed = 28; ; Guest pass has already been redeemed by account; cannot be acked again
Const EResultDuplicateRequest = 29; ; The request is a duplicate and the action has already occurred in the past; ignored this time
Const EResultAlreadyOwned = 30; ; All the games in this guest pass redemption request are already owned by the user
Const EResultIPNotFound = 31; ; IP address not found
Const EResultPersistFailed = 32; ; failed to write change to the data store
Const EResultLockingFailed = 33; ; failed to acquire access lock for this operation
Const EResultLogonSessionReplaced = 34;
Const EResultConnectFailed = 35;
Const EResultHandshakeFailed = 36;
Const EResultIOFailure = 37;
Const EResultRemoteDisconnect = 38;
Const EResultShoppingCartNotFound = 39; ; failed to find the shopping cart requested
Const EResultBlocked = 40; ; a user didn't allow it
Const EResultIgnored = 41; ; target is ignoring sender
Const EResultNoMatch = 42; ; nothing matching the request found
Const EResultAccountDisabled = 43;
Const EResultServiceReadOnly = 44; ; this service is not accepting content changes right now
Const EResultAccountNotFeatured = 45; ; account doesn't have value; so this feature isn't available
Const EResultAdministratorOK = 46; ; allowed to take this action; but only because requester is admin
Const EResultContentVersion = 47; ; A Version mismatch in content transmitted within the Steam protocol.
Const EResultTryAnotherCM = 48; ; The current CM can't service the user making a request; user should try another.
Const EResultPasswordRequiredToKickSession = 49;; You are already logged in elsewhere; this cached credential login has failed.
Const EResultAlreadyLoggedInElsewhere = 50; ; You are already logged in elsewhere; you must wait
Const EResultSuspended = 51; ; Long running operation (content download) suspended/paused
Const EResultCancelled = 52; ; Operation canceled (typically by user: content download)
Const EResultDataCorruption = 53; ; Operation canceled because data is ill formed or unrecoverable
Const EResultDiskFull = 54; ; Operation canceled - not enough disk space.
Const EResultRemoteCallFailed = 55; ; an remote call or IPC call failed
Const EResultPasswordUnset = 56; ; Password could not be verified as it's unset server side
Const EResultExternalAccountUnlinked = 57; ; External account (PSN; Facebook...) is not linked to a Steam account
Const EResultPSNTicketInvalid = 58; ; PSN ticket was invalid
Const EResultExternalAccountAlreadyLinked = 59; ; External account (PSN; Facebook...) is already linked to some other account; must explicitly request to replace/delete the link first
Const EResultRemoteFileConflict = 60; ; The sync cannot resume due to a conflict between the local and remote files
Const EResultIllegalPassword = 61; ; The requested new password is not legal
Const EResultSameAsPreviousValue = 62; ; new value is the same as the old one ( secret question and answer )
Const EResultAccountLogonDenied = 63; ; account login denied due to 2nd factor authentication failure
Const EResultCannotUseOldPassword = 64; ; The requested new password is not legal
Const EResultInvalidLoginAuthCode = 65; ; account login denied due to auth code invalid
Const EResultAccountLogonDeniedNoMail = 66; ; account login denied due to 2nd factor auth failure - and no mail has been sent
Const EResultHardwareNotCapableOfIPT = 67; ;
Const EResultIPTInitError = 68; ;
Const EResultParentalControlRestricted = 69; ; operation failed due to parental control restrictions for current user
Const EResultFacebookQueryError = 70; ; Facebook query returned an error
Const EResultExpiredLoginAuthCode = 71; ; account login denied due to auth code expired
Const EResultIPLoginRestrictionFailed = 72;
Const EResultAccountLockedDown = 73;
Const EResultAccountLogonDeniedVerifiedEmailRequired = 74;
Const EResultNoMatchingURL = 75;
Const EResultBadResponse = 76; ; parse failure; missing field; etc.
Const EResultRequirePasswordReEntry = 77; ; The user cannot complete the action until they re-enter their password
Const EResultValueOutOfRange = 78; ; the value entered is outside the acceptable range
Const EResultUnexpectedError = 79; ; something happened that we didn't expect to ever happen
Const EResultDisabled = 80; ; The requested service has been configured to be unavailable
Const EResultInvalidCEGSubmission = 81; ; The set of files submitted to the CEG server are not valid !
Const EResultRestrictedDevice = 82; ; The device being used is not allowed to perform this action
Const EResultRegionLocked = 83; ; The action could not be complete because it is region restricted
Const EResultRateLimitExceeded = 84; ; Temporary rate limit exceeded; try again later; different from k_EResultLimitExceeded which may be permanent
Const EResultAccountLoginDeniedNeedTwoFactor = 85; ; Need two-factor code to login
Const EResultItemDeleted = 86; ; The thing we're trying to access has been deleted
Const EResultAccountLoginDeniedThrottle = 87; ; login attempt failed; try to throttle response to possible attacker
Const EResultTwoFactorCodeMismatch = 88; ; two factor code mismatch
Const EResultTwoFactorActivationCodeMismatch = 89; ; activation code for two-factor didn't match
Const EResultAccountAssociatedToMultiplePartners = 90; ; account has been associated with multiple partners
Const EResultNotModified = 91; ; data not modified
Const EResultNoMobileDevice = 92; ; the account does not have a mobile device associated with it
Const EResultTimeNotSynced = 93; ; the time presented is out of range or tolerance
Const EResultSmsCodeFailed = 94; ; SMS code failure (no match; none pending; etc.)
Const EResultAccountLimitExceeded = 95; ; Too many accounts access this resource
Const EResultAccountActivityLimitExceeded = 96; ; Too many changes to this account
Const EResultPhoneActivityLimitExceeded = 97; ; Too many changes to this phone
Const EVoiceResultOK = 0;
Const EVoiceResultNotInitialized = 1;
Const EVoiceResultNotRecording = 2;
Const EVoiceResultNoData = 3;
Const EVoiceResultBufferTooSmall = 4;
Const EVoiceResultDataCorrupted = 5;
Const EVoiceResultRestricted = 6;
Const EVoiceResultUnsupportedCodec = 7;
Const EVoiceResultReceiverOutOfDate = 8;
Const EVoiceResultReceiverDidNotAnswer = 9;
Const EDenyInvalid = 0;
Const EDenyInvalidVersion = 1;
Const EDenyGeneric = 2;
Const EDenyNotLoggedOn = 3;
Const EDenyNoLicense = 4;
Const EDenyCheater = 5;
Const EDenyLoggedInElseWhere = 6;
Const EDenyUnknownText = 7;
Const EDenyIncompatibleAnticheat = 8;
Const EDenyMemoryCorruption = 9;
Const EDenyIncompatibleSoftware = 10;
Const EDenySteamConnectionLost = 11;
Const EDenySteamConnectionError = 12;
Const EDenySteamResponseTimedOut = 13;
Const EDenySteamValidationStalled = 14;
Const EDenySteamOwnerLeftGuestUser = 15;
Const EBeginAuthSessionResultOK = 0; ; Ticket is valid for this game and this steamID.
Const EBeginAuthSessionResultInvalidTicket = 1; ; Ticket is not valid.
Const EBeginAuthSessionResultDuplicateRequest = 2; ; A ticket has already been submitted for this steamID
Const EBeginAuthSessionResultInvalidVersion = 3; ; Ticket is from an incompatible interface version
Const EBeginAuthSessionResultGameMismatch = 4; ; Ticket is not for this game
Const EBeginAuthSessionResultExpiredTicket = 5; ; Ticket has expired
Const EAuthSessionResponseOK = 0; ; Steam has verified the user is online; the ticket is valid and ticket has not been reused.
Const EAuthSessionResponseUserNotConnectedToSteam = 1; ; The user in question is not connected to steam
Const EAuthSessionResponseNoLicenseOrExpired = 2; ; The license has expired.
Const EAuthSessionResponseVACBanned = 3; ; The user is VAC banned for this game.
Const EAuthSessionResponseLoggedInElseWhere = 4; ; The user account has logged in elsewhere and the session containing the game instance has been disconnected.
Const EAuthSessionResponseVACCheckTimedOut = 5; ; VAC has been unable to perform anti-cheat checks on this user
Const EAuthSessionResponseAuthTicketCanceled = 6; ; The ticket has been canceled by the issuer
Const EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7; ; This ticket has already been used; it is not valid.
Const EAuthSessionResponseAuthTicketInvalid = 8; ; This ticket is not from a user instance currently connected to steam.
Const EAuthSessionResponsePublisherIssuedBan = 9; ; The user is banned for this game. The ban came via the web api and not VAC
Const EUserHasLicenseResultHasLicense = 0; ; User has a license for specified app
Const EUserHasLicenseResultDoesNotHaveLicense = 1; ; User does not have a license for the specified app
Const EUserHasLicenseResultNoAuth = 2; ; User has not been authenticated
+95
View File
@@ -0,0 +1,95 @@
; BlitzSteam - Steam wrapper for Blitz.
; Copyright (C) 2015 Project Kube (Michael Fabian Dirks)
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation, either version 3 of the
; License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public License
; along with this program. If not, see <http:;www.gnu.org/licenses/>.
.lib "BlitzSteam.dll"
; Steam -------------------------------------------------------------------------
BlitzSteam_Init%()
BlitzSteam_Shutdown()
BlitzSteam_IsSteamRunning%()
BlitzSteam_RestartAppIfNecessary%(unOwnAppID%)
BlitzSteam_SetMiniDumpComment(pchMsg$)
BlitzSteam_WriteMiniDump(uStructuredExceptionCode%, pvExceptionInfo%, uBuildID%)
BlitzSteam_WriteMiniDumpBank(uStructuredExceptionCode%, pvExceptionInfo*, uBuildID%) : "BlitzSteam_WriteMiniDump"
; -- Interfaces
BlitzSteamAppList%()
BlitzSteamApps%()
BlitzSteamClient%()
BlitzSteamController%()
BlitzSteamFriends%()
BlitzSteamHTTP%()
BlitzSteamHTMLSurface%()
BlitzSteamInventory%()
BlitzSteamMatchmaking%()
BlitzSteamMatchmakingServers%()
BlitzSteamMusic%()
BlitzSteamMusicRemote%()
BlitzSteamNetworking%()
BlitzSteamRemoteStorage%()
BlitzSteamScreenshots%()
BlitzSteamUGC%()
BlitzSteamUnifiedMessages%()
BlitzSteamUser%()
BlitzSteamUserStats%()
BlitzSteamUtils%()
BlitzSteamVideo%()
; -- Callbacks & Hooks
BlitzSteam_RunCallbacks()
BlitzSteam_RegisterCallback(pCallback%, iCallback%)
BlitzSteam_UnregisterCallback(pCallback%)
BlitzSteam_RegisterCallResult(pCallback%, hAPICall_L%, hAPICall_R%)
BlitzSteam_UnregisterCallResult(pCallback%, hAPICall_L%, hAPICall_R%)
; SteamAppList ------------------------------------------------------------------
BlitzSteamAppList_GetNumInstalledApps%(lpSteamAppList%)
BlitzSteamAppList_GetInstalledAppsEx%(lpSteamAppList%, pvecAppID%, unMaxIDs%) : "BlitzSteamAppList_GetInstalledApps"
BlitzSteamAppList_GetInstalledApps%(lpSteamAppList%, pvecAppIDBank*, unMaxIDs%)
BlitzSteamAppList_GetAppNameEx%(lpSteamAppList%, nAppId%, pchName%, cchNameMax%) : "BlitzSteamAppList_GetAppName"
BlitzSteamAppList_GetAppName%(lpSteamAppList%, nAppId%, pchNameBank*, cchNameMax%)
BlitzSteamAppList_GetAppInstallDirEx%(lpSteamAppList%, nAppId%, pchDirectory%, cchDirectoryMax%) : "BlitzSteamAppList_GetAppInstallDir"
BlitzSteamAppList_GetAppInstallDir%(lpSteamAppList%, nAppId%, pchDirectoryBank*, cchDirectoryMax%)
BlitzSteamAppList_GetAppBuildId%(lpSteamAppList%, nAppId%)
; SteamApps ---------------------------------------------------------------------
BlitzSteamApps_IsSubscribed%(lpSteamApps%)
BlitzSteamApps_IsLowViolence%(lpSteamApps%)
BlitzSteamApps_IsCybercafe%(lpSteamApps%)
BlitzSteamApps_IsVACBanned%(lpSteamApps%)
BlitzSteamApps_GetCurrentGameLanguage$(lpSteamApps%)
BlitzSteamApps_GetAvailableGameLanguages$(lpSteamApps%)
BlitzSteamApps_IsSubscribedApp%(lpSteamApps%, appID%)
BlitzSteamApps_IsDlcInstalled%(lpSteamApps%, appID%)
BlitzSteamApps_GetEarliestPurchaseUnixTime%(lpSteamApps%, appID%)
BlitzSteamApps_IsSubscribedFromFreeWeekend%(lpSteamApps%)
BlitzSteamApps_GetDLCCount%(lpSteamApps%)
BlitzSteamApps_GetDLCDataByIndexEx%(lpSteamApps%, iDLC%, pAppId%, pbAvailable%, pchName%, cchNameBufferSize%) : "BlitzSteamApps_GetDLCDataByIndex"
BlitzSteamApps_GetDLCDataByIndex%(lpSteamApps%, iDLC%, pAppIdBank*, pbAvailableBank*, pchNameBank*, cchNameBufferSize%)
BlitzSteamApps_InstallDLC(lpSteamApps%, nAppID%)
BlitzSteamApps_UninstallDLC(lpSteamApps%, nAppID%)
BlitzSteamApps_RequestAppProofOfPurchaseKey(lpSteamApps%, nAppID%)
BlitzSteamApps_GetCurrentBetaNameEx%(lpSteamApps%, pchName%, cchNameBufferSize%) : "BlitzSteamApps_GetCurrentBetaName"
BlitzSteamApps_GetCurrentBetaName%(lpSteamApps%, pchNameBank*, cchNameBufferSize%)
BlitzSteamApps_MarkContentCorrupt%(lpSteamApps%, bMissingFilesOnly%)
BlitzSteamApps_GetInstalledDepotsEx%(lpSteamApps%, nAppID%, pvecDepots%, cMaxDepots%) : "BlitzSteamApps_GetInstalledDepots"
BlitzSteamApps_GetInstalledDepots%(lpSteamApps%, nAppID%, pvecDepotsBank*, cMaxDepots%)
BlitzSteamApps_GetAppInstallDirEx%(lpSteamApps%, nAppID%, pchFolder%, cchFolderBufferSize%) : "BlitzSteamApps_GetAppInstallDir"
BlitzSteamApps_GetAppInstallDir%(lpSteamApps%, nAppID%, pchFolderBank*, cchFolderBufferSize%)
BlitzSteamApps_IsAppInstalled%(lpSteamApps%, nAppID%)
BlitzSteamApps_GetAppOwner%(lpSteamApps%)
BlitzSteamApps_GetLaunchQueryParam$(lpSteamApps%, pchKey$)
BlitzSteamApps_GetDlcDownloadProgress%(lpSteamApps%, nAppID%, pOutputBank*)
BlitzSteamApps_GetAppBuildId%(lpSteamApps%)
; SteamController ---------------------------------------------------------------
+471
View File
@@ -0,0 +1,471 @@
; BlitzSteam - Steam wrapper for Blitz.
; Copyright (C) 2015 Project Kube (Michael Fabian Dirks)
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation, either version 3 of the
; License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public License
; along with this program. If not, see <http:;www.gnu.org/licenses/>.
;----------------------------------------------------------------
; -- Constants
;----------------------------------------------------------------
Const BSU_NAME_LENGTH = 4096
Const BSU_INSTALLDIR_LENGTH = 4096
Const BSU_APPID_COUNT = 4096
Const BSU_INSTALLEDDEPOTS_COUNT = 4096
;----------------------------------------------------------------
; -- Globals
;----------------------------------------------------------------
Global BSUInitialized = False
Global BSUIsSteamRunning% = False
; -- Interfaces
Global BSUAppList%, BSUApps%, BSUClient%, BSUController%
Global BSUFriends%, BSUHTTP%, BSUHTMLSurface%, BSUInventory%
Global BSUMatchmaking%, BSUMatchmakingServers%, BSUMusic%
Global BSUMusicRemote%, BSUNetworking%, BSURemoteStorage%
Global BSUScreenshots%, BSUUGC%, BSUUnifiedMessages%, BSUUser%
Global BSUUserStats%, BSUUtils%, BSUVideo%
;----------------------------------------------------------------
; -- Types
;----------------------------------------------------------------
Type BSU_App
Field AppId%
Field Name$
Field InstallDir$
End Type
Type BSU_DLC
Field AppId%
Field Available%
Field Name$
End Type
Type BSU_Depot
Field DepotId%
End Type
Type BSU_DLCDownloadProgress
Field unBytesDownloaded_L
Field unBytesDownloaded_R
Field unBytesTotal_L
Field unBytesTotal_R
End Type
;----------------------------------------------------------------
; -- Functions
;----------------------------------------------------------------
; -- Utility
; Writes a C-String value to a Bank.
; Returns amount of bytes written.
Function BSU_PokeCString%(Bank%, Pos%, Value$)
If Bank Then
Local BankSz = BankSize(Bank)
If Pos < 0 Then Pos = 0
If Pos >= BankSz Then Pos = BankSz - 1
Local ValuePos, ValueLen = Len(Value)
For ValuePos = 1 To ValueLen
; Don't write over the edge, we still need space for the 0-byte
If (Pos + ValuePos) >= (BankSz - 1) Then Exit
PokeByte Bank, Pos + ValuePos, Asc(Mid(Value, ValuePos, 1))
Next
PokeByte Bank, Pos + ValuePos, 0
Return ValuePos
EndIf
End Function
; Reads a C-String value from a Bank.
; Returns read C-String
Function BSU_PeekCString$(Bank%, Pos%)
If Bank Then
Local BankSz = BankSize(Bank)
If Pos < 0 Then Pos = 0
If Pos >= BankSz Then Pos = BankSz - 1
Local OutStr$, OutLen = (BankSz - Pos)
Local BankPos
For BankPos = 0 To OutLen
If (Pos + BankPos) >= BankSz Then Exit
Local Value = PeekByte(Bank, Pos + BankPos)
If Value = 0 Then
Exit
Else
OutStr=OutStr+Chr(Value)
EndIf
Next
Return OutStr
EndIf
End Function
; -- Steam
Function BSU_Init()
BSUIsSteamRunning = BlitzSteam_IsSteamRunning()
If BSUIsSteamRunning Then
BlitzSteam_Init()
BSUAppList = BlitzSteamAppList()
BSUApps = BlitzSteamApps()
BSUClient = BlitzSteamClient()
BSUController = BlitzSteamController()
BSUFriends = BlitzSteamFriends()
BSUHTTP = BlitzSteamHTTP()
BSUHTMLSurface = BlitzSteamHTMLSurface()
BSUInventory = BlitzSteamInventory()
BSUMatchmaking = BlitzSteamMatchmaking()
BSUMatchmakingServers = BlitzSteamMatchmakingServers()
BSUMusic = BlitzSteamMusic()
BSUMusicRemote = BlitzSteamMusicRemote()
BSUNetworking = BlitzSteamNetworking()
BSURemoteStorage = BlitzSteamRemoteStorage()
BSUScreenshots = BlitzSteamScreenshots()
BSUUGC = BlitzSteamUGC()
BSUUnifiedMessages = BlitzSteamUnifiedMessages()
BSUUser = BlitzSteamUser()
BSUUserStats = BlitzSteamUserStats()
BSUUtils = BlitzSteamUtils()
BSUVideo = BlitzSteamVideo()
BSUInitialized = True
EndIf
End Function
Function BSU_Shutdown()
If BSUIsSteamRunning
BlitzSteam_Shutdown()
BSUAppList=0
BSUApps=0
BSUClient=0
BSUController=0
BSUFriends=0
BSUHTTP=0
BSUHTMLSurface=0
BSUInitialized=0
BSUMatchmaking=0
BSUMatchmakingServers=0
BSUMusic=0
BSUMusicRemote=0
BSUNetworking=0
BSURemoteStorage=0
BSUScreenshots=0
BSUUGC=0
BSUUnifiedMessages=0
BSUUser=0
BSUUserStats=0
BSUUtils=0
BSUVideo=0
BSUInitialized = False
EndIf
End Function
; -- SteamAppList
Function BSUAppList_GetInstalledApps(BankAppIdsStorage=0, BankAppNameStorage=0, BankAppInstallDirStorage=0)
Local BankAppIds, BankAppIdsSz = BSU_APPID_COUNT
Local BankAppName, BankAppNameSz = BSU_NAME_LENGTH
Local BankAppInstallDir, BankAppInstallDirSz = BSU_INSTALLDIR_LENGTH
Local AppCount%, InstalledApp.BSU_App
If BSUInitialized Then
; Clear Installed App List
Delete Each BSU_App
; Early-Exit to not waste time.
If BlitzSteamAppList_GetNumInstalledApps(BSUApps) = 0 Then Return
If BankAppIdsStorage = 0
; Create Temporary storage for AppIds.
BankAppIds = CreateBank(BankAppIdsSz * 4)
Else
; Reuse existing Bank.
BankAppIds = BankAppIdsStorage
BankAppIdsSz = Floor(BankSize(BankAppIds) / 4)
EndIf
; Request installed apps from Steam.
AppCount = BlitzSteamAppList_GetInstalledApps(BSUAppList, BankAppIds, BankAppIdsSz)
; We don't need to do this if we don't actually have any apps returned.
If AppCount > 0 Then
If BankAppNameStorage = 0 Then
; Create temporary storage for name.
BankAppName = CreateBank(BankAppNameSz)
Else
BankAppName = BankAppNameStorage
BankAppNameSz = BankSize(BankAppName)
EndIf
If BankAppInstallDirStorage = 0 Then
; Create temporary storage for installdir.
BankAppInstallDir = CreateBank(BankAppInstallDirSz)
Else
BankAppInstallDir = BankAppInstallDirStorage
BankAppInstallDirSz = BankSize(BankAppInstallDir)
EndIf
; Index all apps.
Local AppIndex
For AppIndex = 1 To AppCount
InstalledApp.BSU_App = New BSU_App
InstalledApp\AppId = PeekInt(BankAppIds, AppIndex * 4)
InstalledApp\Name = BSUAppList_GetAppName(InstalledApp\AppId, BankAppName)
InstalledApp\InstallDir = BSUAppList_GetInstallDir(InstalledApp\AppId, BankAppInstallDir)
Next
; Free temporary storage for name and installdir.
If BankAppInstallDirStorage = 0 Then FreeBank BankAppInstallDir
If BankAppNameStorage = 0 FreeBank BankAppName
EndIf
; Free temporary storage for AppIds.
If BankAppIdsStorage = 0 FreeBank BankAppIds
EndIf
End Function
Function BSUAppList_GetAppName$(AppID%, BankStorage=0)
Local Bank, BankSz = BSU_NAME_LENGTH
Local AppName$
If BSUInitialized Then
If BankStorage = 0 Then
; Create temporary storage.
Bank = CreateBank(BankSz)
Else
; Reuse existing Bank.
Bank = BankStorage
BankSz = BankSize(Bank)
EndIf
; Request App name from Steam.
BlitzSteamAppList_GetAppName(BSUAppList, AppID, Bank, BankSz)
; Read returned C-String from Bank.
AppName$ = BSU_PeekCString(Bank, 0)
; Free temporary storage.
If BankStorage = 0 Then FreeBank Bank
EndIf
; Return name read.
Return AppName
End Function
Function BSUAppList_GetInstallDir$(AppID%, BankStorage=0)
Local Bank, BankSz = BSU_INSTALLDIR_LENGTH
Local AppInstallDir$
If BSUInitialized Then
If BankStorage = 0 Then
; Create temporary storage.
Bank = CreateBank(BankSz)
Else
; Reuse existing Bank.
Bank = BankStorage
BankSz = BankSize(Bank)
EndIf
; Request App name from Steam.
BlitzSteamAppList_GetAppInstallDir(BSUAppList, AppID, Bank, BankSz)
; Read returned C-String from Bank.
AppInstallDir$ = BSU_PeekCString(Bank, 0)
; Free temporary storage.
If BankStorage = 0 Then FreeBank Bank
EndIf
; Return name read.
Return AppInstallDir
End Function
; -- SteamApps
Function BSUApps_GetDLCData(BankAppIdStorage=0, BankAvailableStorage=0, BankNameStorage=0)
Local BankAppId%, BankAvailable%
Local BankName%, BankNameSz% = BSU_NAME_LENGTH
Local DLCCount% = 0
If BSUInitialized Then
Delete Each BSU_DLC
DLCCount = BlitzSteamApps_GetDLCCount(BSUApps)
If DLCCount > 0
If BankAppIdStorage = 0 Then
; Create temporary storage for AppId.
BankAppId = CreateBank(4)
Else
; Reuse existing storage.
BankAppId = BankAppIdStorage
EndIf
If BankAvailableStorage = 0 Then
; Create temporary storage for Availability.
BankAvailable = CreateBank(4)
Else
; Reuse existing storage.
BankAvailable = BankAvailableStorage
EndIf
If BankNameStorage = 0 Then
; Create temporary storage for Availability.
BankName = CreateBank(BankNameSz)
Else
; Reuse existing storage.
BankName = BankNameStorage
BankNameSz = BankSize(BankName)
EndIf
Local DLCIndex%
For DLCIndex = 0 To DLCCount - 1
BSUApps_GetDLCDataByIndex(DLCIndex, BankAppId, BankAvailable, BankName)
Next
; Free temporary storages.
If BankNameStorage = 0 Then FreeBank BankName
If BankAvailableStorage = 0 Then FreeBank BankAvailable
If BankAppIdStorage = 0 Then FreeBank BankAppId
EndIf
EndIf
End Function
Function BSUApps_GetDLCDataByIndex.BSU_DLC(iDLC%, BankAppIdStorage=0, BankAvailableStorage=0, BankNameStorage=0)
Local BankAppId%, BankAvailable%
Local BankName%, BankNameSz% = BSU_NAME_LENGTH
Local DLC.BSU_DLC
If BSUInitialized Then
If BankAppIdStorage = 0 Then
; Create temporary storage for AppId.
BankAppId = CreateBank(4)
Else
; Reuse existing storage.
BankAppId = BankAppIdStorage
EndIf
If BankAvailableStorage = 0 Then
; Create temporary storage for Availability.
BankAvailable = CreateBank(4)
Else
; Reuse existing storage.
BankAvailable = BankAvailableStorage
EndIf
If BankNameStorage = 0 Then
; Create temporary storage for Availability.
BankName = CreateBank(BankNameSz)
Else
; Reuse existing storage.
BankName = BankNameStorage
BankNameSz = BankSize(BankName)
EndIf
; Request DLC Data from Steam.
If BlitzSteamApps_GetDLCDataByIndex(BSUApps, iDLC, BankAppId, BankAvailable, BankName, BankNameSz)
; Create a result DLC object.
DLC.BSU_DLC = New BSU_DLC
DLC\AppId = PeekInt(BankAppId, 0)
DLC\Available = PeekInt(BankAvailable, 0)
DLC\Name = BSU_PeekCString(BankName, 0)
EndIf
; Free temporary storages.
If BankNameStorage = 0 Then FreeBank BankName
If BankAvailableStorage = 0 Then FreeBank BankAvailable
If BankAppIdStorage = 0 Then FreeBank BankAppId
EndIf
; Return the result.
Return DLC
End Function
Function BSUApps_GetCurrentBetaName$(BankNameStorage=0)
Local BankName, BankNameSz = BSU_NAME_LENGTH
Local BetaName$ = ""
If BSUInitialized Then
If BankNameStorage = 0 Then
; Create temporary storage for name.
BankName = CreateBank(BankNameSz)
Else
; Reuse existing storage.
BankName = BankNameStorage
BankNameSz = BankSize(BankName)
EndIf
; Request beta name from Steam.
BlitzSteamApps_GetCurrentBetaName(BSUApps, BankName, BankNameSz)
; Read returned name.
BetaName = BSU_PeekCString(BankName, 0)
; Free temporary storage.
If BankNameStorage = 0 Then FreeBank BankName
EndIf
; Return the result.
Return BetaName
End Function
Function BSUApps_GetInstalledDepots(nAppID%, BankDepotStorage=0)
Local BankDepot, BankDepotSz = BSU_INSTALLEDDEPOTS_COUNT
Local DepotCount
If BSUInitialized Then
Delete Each BSU_Depot
If BankDepotStorage = 0 Then
; Create temporary storage.
BankDepot = CreateBank(BankDepotSz * 4)
Else
; Reuse existing storage.
BankDepot = BankDepotStorage
BankDepotSz = BankSize(BankDepot) / 4
EndIf
; Request depots from Steam.
DepotCount = BlitzSteamApps_GetInstalledDepots(BSUApps, nAppID, BankDepot, BankDepotSz)
; Read returned depots into objects.
Local DepotIndex
For DepotIndex = 0 To DepotCount - 1
Local Depot.BSU_Depot = New BSU_Depot
Depot\DepotId = PeekInt(BankDepot, DepotIndex * 4)
Next
; Free temporary storage.
If BankDepotStorage = 0 Then FreeBank BankDepot
EndIf
End Function
Function BSUApps_GetAppInstallDir$(nAppID%, BankInstallDirStorage=0)
Local BankInstallDir, BankInstallDirSz = BSU_INSTALLDIR_LENGTH
Local InstallDir$
If BSUInitialized Then
If BankInstallDirStorage = 0 Then
; Create temporary storage.
Else
; Reuse existing storage.
BankInstallDir = BankInstallDirStorage
BankInstallDirSz =
EndIf
EndIf
Return InstallDir$
End Function
;~IDEal Editor Parameters:
;~F#18#1E#24#35#4A#63#82#A0#DD#F9#116#146#178
;~C#Blitz3D