| CS.RIN.RU - Steam Underground Community http://cs.rin.ru/forum/ |
|
| [REL] VB STEAM API http://cs.rin.ru/forum/viewtopic.php?f=31&t=41613 |
Page 1 of 1 |
| Author: | d4op [ Saturday, 21 Oct 2006, 18:37 ] |
| Post subject: | |
hm , its not working as you posted it . for me. that how it worked for me. Private Const STEAM_USING_FILESYSTEM As Integer = &H1 Private Const STEAM_USING_LOGGING As Integer = &H2 Private Const STEAM_USING_USERID As Integer = &H4 Private Const STEAM_USING_ACCOUNT As Integer = &H8 Private Const STEAM_USING_ALL As Integer = &HF Private Enum eSteamError eSteamErrorNone = 0 'No Error eSteamErrorUnknown = 1 eSteamErrorLibraryNotInitialized = 2 eSteamErrorLibraryAlreadyInitialized = 3 eSteamErrorConfig = 4 eSteamErrorContentServerConnect = 5 eSteamErrorBadHandle = 6 eSteamErrorHandlesExhausted = 7 eSteamErrorBadArg = 8 eSteamErrorNotFound = 9 eSteamErrorRead = 10 eSteamErrorEOF = 11 eSteamErrorSeek = 12 eSteamErrorCannotWriteNonUserConfigFile = 13 eSteamErrorCacheOpen = 14 eSteamErrorCacheRead = 15 eSteamErrorCacheCorrupted = 16 eSteamErrorCacheWrite = 17 eSteamErrorCacheSession = 18 eSteamErrorCacheInternal = 19 eSteamErrorCacheBadApp = 20 eSteamErrorCacheVersion = 21 eSteamErrorCacheBadFingerPrint = 22 eSteamErrorNotFinishedProcessing = 23 eSteamErrorNothingToDo = 24 eSteamErrorCorruptEncryptedUserIDTicket = 25 eSteamErrorSocketLibraryNotInitialized = 26 eSteamErrorFailedToConnectToUserIDTicketValidationServer = 27 eSteamErrorBadProtocolVersion = 28 eSteamErrorReplayedUserIDTicketFromClient = 29 eSteamErrorReceiveResultBufferTooSmall = 30 eSteamErrorSendFailed = 31 eSteamErrorReceiveFailed = 32 eSteamErrorReplayedReplyFromUserIDTicketValidationServer = 33 eSteamErrorBadSignatureFromUserIDTicketValidationServer = 34 eSteamErrorValidationStalledSoAborted = 35 eSteamErrorInvalidUserIDTicket = 36 eSteamErrorClientLoginRateTooHigh = 37 eSteamErrorClientWasNeverValidated = 38 eSteamErrorInternalSendBufferTooSmall = 39 eSteamErrorInternalReceiveBufferTooSmall = 40 eSteamErrorUserTicketExpired = 41 eSteamErrorCDKeyAlreadyInUseOnAnotherClient = 42 eSteamErrorNotLoggedIn = 101 eSteamErrorAlreadyExists = 102 eSteamErrorAlreadySubscribed = 103 eSteamErrorNotSubscribed = 104 eSteamErrorAccessDenied = 105 eSteamErrorFailedToCreateCacheFile = 106 eSteamErrorCallStalledSoAborted = 107 eSteamErrorEngineNotRunning = 108 eSteamErrorEngineConnectionLost = 109 eSteamErrorLoginFailed = 110 eSteamErrorAccountPending = 111 eSteamErrorCacheWasMissingRetry = 112 eSteamErrorLocalTimeIncorrect = 113 eSteamErrorNetwork = 200 End Enum Private Enum EDetailedPlatformErrorType eNoDetailedErrorAvailable 'No Error eStandardCerrno eWin32LastError eWinSockLastError eDetailedPlatformErrorCount End Enum Private Type TSteamError eSteamError As eSteamError 'eSteamError code eDetailedErrorType As EDetailedPlatformErrorType 'Platform Error Type ErrCode As Long 'Error Code ErrDescription As String * 255 'Additional Description End Type Private Type TSteamProgress intValid As Integer 'If 1 Percentage will be used intPercent As Integer '0-100% (VAL) strProgress As String * 255 'Additional Progress Info End Type 'Platform API Private Declare Function SteamStartEngine Lib "steam.dll" (ByRef SteamError As TSteamError) As Integer Private Declare Function SteamStartup Lib "steam.dll" (ByVal intUsingMask As Integer, ByRef SteamError As TSteamError) As Integer 'Connection API Private Declare Function SteamProcessCall Lib "steam.dll" (ByVal SteamHandle As Integer, ByRef pProgress As TSteamProgress, ByRef SteamError As TSteamError) As Integer 'Handle API Private Declare Function SteamLogin Lib "steam.dll" (ByVal strUser As String, ByVal strPass As String, ByVal intSecure As Integer, ByRef SteamError As TSteamError) As Integer Private Function ToBool(intNum As Integer) As Boolean If intNum = 1 Then ToBool = True End Function Private Function StartEngine() As Boolean Dim TError As TSteamError StartEngine = ToBool(SteamStartEngine(TError)) If StartEngine = False Then MsgBox "Error (" & TError.eSteamError & "): " & TError.ErrDescription, vbOKOnly, "Steam Error: SteamStartEngine" End If End Function Private Function Startup() As Boolean Dim TError As TSteamError Startup = ToBool(SteamStartup(STEAM_USING_FILESYSTEM Or STEAM_USING_LOGGING Or STEAM_USING_USERID Or STEAM_USING_ACCOUNT, TError)) If Startup = False Then MsgBox "Error (" & TError.eSteamError & "): " & TError.ErrDescription, vbOKOnly, "Steam Error: SteamStartup" End If End Function Private Function Login(strUser As String, strPass As String) As Boolean Dim TError As TSteamError Dim TProgress As TSteamProgress Dim intHandle As Integer intHandle = SteamLogin(strUser, strPass, 1, TError) Do While (SteamProcessCall(intHandle, TProgress, TError) = 0) DoEvents Loop If TError.eSteamError = eSteamErrorNone Then Login = True Else If Login = False Then MsgBox "Error (" & TError.eSteamError & "): " & TError.ErrDescription, vbOKOnly, "Steam Error: SteamLogin" End If End Function |
|
| Author: | d4op [ Saturday, 21 Oct 2006, 20:31 ] |
| Post subject: | |
i know , you can simply use this to startup the engine. PrivateDeclare Function StartEngine Lib "Steam.dll" Alias "SteamStartEngine" () As Long PrivateDeclare Function Startup Lib "Steam.dll" Alias "SteamStartup" (ByRef a1 As Long) As Long Private Sub Startme_Click() Dim EngineH As Long Dim StartH As Long EngineH = StartEngine If EngineH = "0" Then 'Unable to Start SteamEngine MsgBox "Unable to Start SteamEngine", vbOKOnly, "Error" Else StartH = Startup(EngineH) If StartH = "0" Then MsgBox "SteamStartup() failed: Steam Service cant Startup." Else MsgBox "SteamStartup() Returned 1: Steam service Startup complet." End If End If End Sub |
|
| Author: | sonic_8400 [ Sunday, 22 Oct 2006, 03:49 ] |
| Post subject: | |
can u post the vb file b/c i am having troble compilng it |
|
| Author: | d4op [ Sunday, 22 Oct 2006, 04:04 ] |
| Post subject: | |
fix it yourself. |
|
| Author: | RessourectoR [ Sunday, 22 Oct 2006, 07:33 ] |
| Post subject: | |
d4op wrote: fix it yourself.
What a good and helpful suggestion. sonic_8400, I think this is not meant to be compiled yet. |
|
| Author: | Bawsack [ Sunday, 22 Oct 2006, 15:34 ] |
| Post subject: | |
G3N3R4T10N wrote: you have to place that in a module. for the beginners here Public Function can be only referenced in a Module not in a Form. You have to put that in a module and call it outside like a Form or class to get it work. Read my posts above what u have todo first
thanks for the info , LOL i was trying to save it as a vb script file. will try again to get this stuff to work as im curious. |
|
| Author: | sonic_8400 [ Sunday, 22 Oct 2006, 23:16 ] |
| Post subject: | |
thnx G3N3R4T10N i was put it as a form lol now i get it has to be a module that help. |
|
| Page 1 of 1 | All times are UTC + 3 hours |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|