From 30beba2ada4b218ec3cfeaff0420f0d4a57a3d55 Mon Sep 17 00:00:00 2001 From: Michael Dirks Date: Tue, 23 Feb 2016 13:25:34 +0100 Subject: [PATCH] * Fix BlitzSteam.h including uneccessary headers. * Rename Callback class to BlitzCallback and add state-aware functionality (Register, RegisterResult, automatic unregistering). * Add functionality to delete Long pointers. * Add functionality to create and delete Doubles. * Add memory management functionality. * Reimplement SteamController Wrapper. * Implement SteamHTMLSurface Wrapper. * Fix up Declaration File and make it more descriptive. * Add Blitz Examples and Project. --- Blitz/BlitzSteam.bb | 806 +++++++++++++++++++++------- Blitz/BlitzSteam.decls | 183 +++++-- Blitz/BlitzSteam.ipf | 17 + Blitz/BlitzSteamUtility.bb | 302 +++++++---- Blitz/HTMLSurface_Example.bb | 268 +++++++++ Blitz/steam_appid.txt | 1 + BlitzSteam.h | 6 - BlitzSteam.vcxproj | 10 +- BlitzSteam.vcxproj.filters | 30 +- Helpers/BlitzCallback.cpp | 131 +++++ Helpers/BlitzCallback.h | 55 ++ Helpers/Callbacks.cpp | 45 -- Helpers/Callbacks.h | 29 - Helpers/Helper.cpp | 17 +- Helpers/Memory.cpp | 72 +++ Helpers/Memory.h | 30 ++ Wrapper/Steam.cpp | 22 +- Wrapper/SteamAppList.cpp | 20 +- Wrapper/SteamApps.cpp | 73 ++- Wrapper/SteamClient.cpp | 71 +-- Wrapper/SteamController.cpp | 117 +++- Wrapper/SteamFriends.cpp | 162 +++--- Wrapper/SteamGameServer.cpp | 66 +-- Wrapper/SteamGameServerStats.cpp | 14 +- Wrapper/SteamHTMLSurface.cpp | 224 +++++++- Wrapper/SteamMatchmakingServer.cpp | 23 - Wrapper/SteamMatchmakingServers.cpp | 95 ++++ 27 files changed, 2190 insertions(+), 699 deletions(-) create mode 100644 Blitz/BlitzSteam.ipf create mode 100644 Blitz/HTMLSurface_Example.bb create mode 100644 Blitz/steam_appid.txt create mode 100644 Helpers/BlitzCallback.cpp create mode 100644 Helpers/BlitzCallback.h delete mode 100644 Helpers/Callbacks.cpp delete mode 100644 Helpers/Callbacks.h create mode 100644 Helpers/Memory.cpp create mode 100644 Helpers/Memory.h delete mode 100644 Wrapper/SteamMatchmakingServer.cpp create mode 100644 Wrapper/SteamMatchmakingServers.cpp diff --git a/Blitz/BlitzSteam.bb b/Blitz/BlitzSteam.bb index fee960f..019a5b3 100644 --- a/Blitz/BlitzSteam.bb +++ b/Blitz/BlitzSteam.bb @@ -14,6 +14,7 @@ ; You should have received a copy of the GNU Lesser General Public License ; along with this program. If not, see . +;[Block] Enumeration: EDenyReason ;------------------------------------------------------------------------------ ;! Enumeration - EDenyReason ;------------------------------------------------------------------------------ @@ -34,7 +35,9 @@ Const BS_EDenyReason_SteamConnectionError = 12 Const BS_EDenyReason_SteamResponseTimedOut = 13 Const BS_EDenyReason_SteamValidationStalled = 14 Const BS_EDenyReason_SteamOwnerLeftGuestUser = 15 +;[End Block] +;[Block] Enumeration: EAccountType ;------------------------------------------------------------------------------ ;! Enumeration - EAccountType ;------------------------------------------------------------------------------ @@ -49,7 +52,9 @@ Const BS_EAccountType_Clan = 7 Const BS_EAccountType_Chat = 8 Const BS_EAccountType_ConsoleUser = 9 Const BS_EAccountType_AnonUser = 10 +;[End Block] +;[Block] Enumeration: EBeginAuthSessionResult ;------------------------------------------------------------------------------ ;! Enumeration - EBeginAuthSessionResult ;------------------------------------------------------------------------------ @@ -59,7 +64,9 @@ Const BS_EBeginAuthSessionResult_DuplicateRequest = 2 ; A ticket has already Const BS_EBeginAuthSessionResult_InvalidVersion = 3 ; Ticket is from an incompatible interface version Const BS_EBeginAuthSessionResult_GameMismatch = 4 ; Ticket is not for this game Const BS_EBeginAuthSessionResult_ExpiredTicket = 5 ; Ticket has expired +;[End Block] +;[Block] Enumeration: ECallback ;------------------------------------------------------------------------------ ;! Enumeration - ECallback ;------------------------------------------------------------------------------ @@ -110,7 +117,95 @@ Const BS_ECallback_ClientUserCallbacks = 900 Const BS_ECallback_ClientUtilsCallbacks = 1600 Const BS_ECallback_ClientVideoCallbacks = 4600 Const BS_ECallback_ClientVRCallbacks = 4200 +;[End Block] +;[Block] Enumeration: ESteamControllerPad +;------------------------------------------------------------------------------ +;! Enumeration - ESteamControllerPad +;------------------------------------------------------------------------------ +Const BS_ESteamControllerPad_Left = 0 +Const BS_ESteamControllerPad_Right = 1 +;[End Block] + +;[Block] Enumeration: EControllerSource +;------------------------------------------------------------------------------ +;! Enumeration - EControllerSourceMode +;------------------------------------------------------------------------------ +Const BS_EControllerSource_None = 0 +Const BS_EControllerSource_LeftTrackpad = 1 +Const BS_EControllerSource_RightTrackpad = 2 +Const BS_EControllerSource_Joystick = 3 +Const BS_EControllerSource_ABXY = 4 +Const BS_EControllerSource_Switch = 5 +Const BS_EControllerSource_LeftTrigger = 6 +Const BS_EControllerSource_RightTrigger = 7 +Const BS_EControllerSource_Gyro = 8 +;[End Block] + +;[Block] Enumeration: EControllerSourceMode +;------------------------------------------------------------------------------ +;! Enumeration - EControllerSourceMode +;------------------------------------------------------------------------------ +Const BS_EControllerSourceMode_None = 0 +Const BS_EControllerSourceMode_Dpad = 1 +Const BS_EControllerSourceMode_Buttons = 2 +Const BS_EControllerSourceMode_FourButtons = 3 +Const BS_EControllerSourceMode_AbsoluteMouse = 4 +Const BS_EControllerSourceMode_RelativeMouse = 5 +Const BS_EControllerSourceMode_JoystickMove = 6 +Const BS_EControllerSourceMode_JoystickCamera = 7 +Const BS_EControllerSourceMode_ScrollWheel = 8 +Const BS_EControllerSourceMode_Trigger = 9 +Const BS_EControllerSourceMode_TouchMenu = 10 +;[End Block] + +;[Block] Enumeration: EControllerActionOrigin +;------------------------------------------------------------------------------ +;! Enumeration - EControllerActionOrigin +;------------------------------------------------------------------------------ +Const BS_EControllerActionOrigin_None = 0 +Const BS_EControllerActionOrigin_A = 1 +Const BS_EControllerActionOrigin_B = 2 +Const BS_EControllerActionOrigin_X = 3 +Const BS_EControllerActionOrigin_Y = 4 +Const BS_EControllerActionOrigin_LeftBumper = 5 +Const BS_EControllerActionOrigin_RightBumper = 6 +Const BS_EControllerActionOrigin_LeftGrip = 7 +Const BS_EControllerActionOrigin_RightGrip = 8 +Const BS_EControllerActionOrigin_Start = 9 +Const BS_EControllerActionOrigin_Back = 10 +Const BS_EControllerActionOrigin_LeftPad_Touch = 11 +Const BS_EControllerActionOrigin_LeftPad_Swipe = 12 +Const BS_EControllerActionOrigin_LeftPad_Click = 13 +Const BS_EControllerActionOrigin_LeftPad_DPadNorth = 14 +Const BS_EControllerActionOrigin_LeftPad_DPadSouth = 15 +Const BS_EControllerActionOrigin_LeftPad_DPadWest = 16 +Const BS_EControllerActionOrigin_LeftPad_DPadEast = 17 +Const BS_EControllerActionOrigin_RightPad_Touch = 18 +Const BS_EControllerActionOrigin_RightPad_Swipe = 19 +Const BS_EControllerActionOrigin_RightPad_Click = 20 +Const BS_EControllerActionOrigin_RightPad_DPadNorth = 21 +Const BS_EControllerActionOrigin_RightPad_DPadSouth = 22 +Const BS_EControllerActionOrigin_RightPad_DPadWest = 23 +Const BS_EControllerActionOrigin_RightPad_DPadEast = 24 +Const BS_EControllerActionOrigin_LeftTrigger_Pull = 25 +Const BS_EControllerActionOrigin_LeftTrigger_Click = 26 +Const BS_EControllerActionOrigin_RightTrigger_Pull = 27 +Const BS_EControllerActionOrigin_RightTrigger_Click = 28 +Const BS_EControllerActionOrigin_LeftStick_Move = 29 +Const BS_EControllerActionOrigin_LeftStick_Click = 30 +Const BS_EControllerActionOrigin_LeftStick_DPadNorth = 31 +Const BS_EControllerActionOrigin_LeftStick_DPadSouth = 32 +Const BS_EControllerActionOrigin_LeftStick_DPadWest = 33 +Const BS_EControllerActionOrigin_LeftStick_DPadEast = 34 +Const BS_EControllerActionOrigin_Gyro_Move = 35 +Const BS_EControllerActionOrigin_Gyro_Pitch = 36 +Const BS_EControllerActionOrigin_Gyro_Yaw = 37 +Const BS_EControllerActionOrigin_Gyro_Roll = 38 +Const BS_EControllerActionOrigin_Count = 39 +;[End Block] + +;[Block] Enumeration: EFriendRelationShip ;------------------------------------------------------------------------------ ;! Enumeration - EFriendRelationShip ;------------------------------------------------------------------------------ @@ -122,7 +217,9 @@ Const BS_EFriendRelationShip_RequestInitiator = 4 Const BS_EFriendRelationShip_Ignored = 5 Const BS_EFriendRelationShip_IgnoredFriend = 6 Const BS_EFriendRelationShip_Suggested = 7 +;[End Block] +;[Block] Enumeration: EFriendFlags ;------------------------------------------------------------------------------ ;! Enumeration - EFriendFlags ;------------------------------------------------------------------------------ @@ -138,7 +235,28 @@ Const BS_EFriendFlags_Ignored = $00000200 Const BS_EFriendFlags_IgnoredFriend = $00000400 Const BS_EFriendFlags_Suggested = $00000800 Const BS_EFriendFlags_All = $0000FFFF +;[End Block] +;[Block] Enumeration: EHTMLMouseButton +;------------------------------------------------------------------------------ +;! Enumeration - EHTMLMouseButton +;------------------------------------------------------------------------------ +Const BS_EHTMLMouseButton_Left = 0 +Const BS_EHTMLMouseButton_Right = 1 +Const BS_EHTMLMouseButton_Middle = 2 +;[End Block] + +;[Block] Enumeration: EHTMLKeyModifiers +;------------------------------------------------------------------------------ +;! Enumeration - EHTMLKeyModifiers +;------------------------------------------------------------------------------ +Const BS_EHTMLKeyModifiers_None = 0 +Const BS_EHTMLKeyModifiers_AltDown = 1 Shl 0 +Const BS_EHTMLKeyModifiers_CtrlDown = 1 Shl 1 +Const BS_EHTMLKeyModifiers_ShiftDown = 1 Shl 2 +;[End Block] + +;[Block] Enumeration: ELeaderboardDataRequest ;------------------------------------------------------------------------------ ;! Enumeration - ELeaderboardDataRequest ;------------------------------------------------------------------------------ @@ -146,7 +264,9 @@ Const BS_ELeaderboardDataRequest_Global = 0 Const BS_ELeaderboardDataRequest_GlobalAroundUser = 1 Const BS_ELeaderboardDataRequest_Friends = 2 Const BS_ELeaderboardDataRequest_Users = 3 +;[End Block] +;[Block] Enumeration: ELeaderboardDisplayType ;------------------------------------------------------------------------------ ;! Enumeration - ELeaderboardDisplayType ;------------------------------------------------------------------------------ @@ -154,28 +274,36 @@ Const BS_ELeaderboardDisplayType_None = 0 Const BS_ELeaderboardDisplayType_Numeric = 1 ; simple numerical score Const BS_ELeaderboardDisplayType_TimeSeconds = 2 ; the score represents a time, in seconds Const BS_ELeaderboardDisplayType_TimeMilliSeconds = 3 ; the score represents a time, in milliseconds +;[End Block] +;[Block] Enumeration: ELeaderboardSortMethod ;------------------------------------------------------------------------------ ;! Enumeration - ELeaderboardSortMethod ;------------------------------------------------------------------------------ Const BS_ELeaderboardSortMethod_None = 0 Const BS_ELeaderboardSortMethod_Ascending = 1 ; top-score is lowest number Const BS_ELeaderboardSortMethod_Descending = 2 ; top-score is highest number +;[End Block] +;[Block] Enumeration: ELeaderboardUploadScoreMethod ;------------------------------------------------------------------------------ ;! Enumeration - ELeaderboardUploadScoreMethod ;------------------------------------------------------------------------------ Const BS_ELeaderboardUploadScoreMethod_None = 0 Const BS_ELeaderboardUploadScoreMethod_KeepBest = 1 ; Leaderboard will keep user's best score Const BS_ELeaderboardUploadScoreMethod_ForceUpdate = 2 ; Leaderboard will always replace score with specified +;[End Block] +;[Block] Enumeration: EOverlayToStoreFlag ;------------------------------------------------------------------------------ ;! Enumeration - EOverlayToStoreFlag ;------------------------------------------------------------------------------ Const BS_EOverlayToStoreFlag_None = 0 Const BS_EOverlayToStoreFlag_AddToCart = 1 Const BS_EOverlayToStoreFlag_AddToCartAndShow = 2 +;[End Block] +;[Block] Enumeration: EPersonaChange ;------------------------------------------------------------------------------ ;! Enumeration - EPersonaChange ;------------------------------------------------------------------------------ @@ -193,7 +321,9 @@ Const BS_EPersonaChange_NameFirstSet = $0400 Const BS_EPersonaChange_FacebookInfo = $0800 Const BS_EPersonaChange_Nickname = $1000 Const BS_EPersonaChange_SteamLevel = $2000 +;[End Block] +;[Block] Enumeration: EPersonaState ;------------------------------------------------------------------------------ ;! Enumeration - EPersonaState ;------------------------------------------------------------------------------ @@ -204,7 +334,9 @@ Const BS_EPersonaState_Away = 3 Const BS_EPersonaState_Snooze = 4 Const BS_EPersonaState_LookingToTrade = 5 Const BS_EPersonaState_LookingToPlay = 6 +;[End Block] +;[Block] Enumeration: EP2PSend ;------------------------------------------------------------------------------ ;! Enumeration - EP2PSend ;------------------------------------------------------------------------------ @@ -227,7 +359,9 @@ Const BS_EP2PSend_Reliable = 2 ; Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then ; do a normal k_EP2PSendReliable to force all the buffered data to be sent. Const BS_EP2PSend_ReliableWithBuffering = 3 +;[End Block] +;[Block] Enumeration: EP2PSessionError ;------------------------------------------------------------------------------ ;! Enumeration - EP2PSessionError ;------------------------------------------------------------------------------ @@ -241,7 +375,9 @@ Const BS_EP2PSessionError_Timeout = 4 ; target isn't responding, perhaps ; corporate firewalls can also block this (NAT traversal is not firewall traversal) ; make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction Const BS_EP2PSessionError_Max = 5 +;[End Block] +;[Block] Enumeration: EResult ;------------------------------------------------------------------------------ ;! Enumeration - EResult ;------------------------------------------------------------------------------ @@ -346,7 +482,9 @@ Const BS_EResult_RefundToWallet = 98 ; Cannot refund to payment method, m Const BS_EResult_EmailSendFailure = 99 ; Cannot send an email Const BS_EResult_NotSettled = 100 ; Can't perform operation till payment has settled Const BS_EResult_NeedCaptcha = 101 ; Needs to provide a valid captcha +;[End Block] +;[Block] Enumeration: EServerMode ;------------------------------------------------------------------------------ ;! Enumeration - EServerMode ;------------------------------------------------------------------------------ @@ -354,7 +492,9 @@ Const BS_EServerMode_Invalid = 0 Const BS_EServerMode_NoAuthentication = 1 Const BS_EServerMode_Authentication = 2 Const BS_EServerMode_AuthenticationAndSecure = 3 +;[End Block] +;[Block] Enumeration: EServerFlag ;------------------------------------------------------------------------------ ;! Enumeration - EServerFlag ;------------------------------------------------------------------------------ @@ -368,14 +508,18 @@ Const BS_EServerFlag_Private = $20 ; server shouldn't list on master serv ; won't enforce authentication of users that connect to the server. ; Useful when you run a server where the clients may not ; be connected to the internet but you want them to play (i.e LANs) +;[End Block] +;[Block] Enumeration: EUserHasLicenseResult ;------------------------------------------------------------------------------ ;! Enumeration - EUserHasLicenseResult ;------------------------------------------------------------------------------ Const BS_EUserHasLicenseResult_HasLicense = 0 ; User has a license for specified app Const BS_EUserHasLicenseResult_DoesNotHaveLicense = 1 ; User does not have a license for the specified app Const BS_EUserHasLicenseResult_NoAuth = 2 ; User has not been authenticated +;[End Block] +;[Block] Enumeration: EUserRestriction ;------------------------------------------------------------------------------ ;! Enumeration - EUserRestriction ;------------------------------------------------------------------------------ @@ -387,7 +531,9 @@ Const BS_EUserRestrictionGroupChat = 8 Const BS_EUserRestrictionRating = 16 Const BS_EUserRestrictionGameInvites = 32 Const BS_EUserRestrictionTrading = 64 +;[End Block] +;[Block] Enumeration: EVoiceResult ;------------------------------------------------------------------------------ ;! Enumeration - EVoiceResult ;------------------------------------------------------------------------------ @@ -401,78 +547,53 @@ Const BS_EVoiceResult_Restricted = 6 Const BS_EVoiceResult_UnsupportedCodec = 7 Const BS_EVoiceResult_ReceiverOutOfDate = 8 Const BS_EVoiceResult_ReceiverDidNotAnswer = 9 +;[End Block] - - -;[Block] Old -;! AppList --------------------------------------------------------------------- +;[Block] API: AppList +;------------------------------------------------------------------------------ +;! AppList +;------------------------------------------------------------------------------ Const BS_CALLBACK_AppInstalled = BS_ECallback_SteamAppListCallbacks + 1 Const BS_CALLBACK_AppUninstalled = BS_ECallback_SteamAppListCallbacks + 2 -;! Apps ------------------------------------------------------------------------ + +;[End Block] + +;[Block] API: Apps +;------------------------------------------------------------------------------ +;! Apps +;------------------------------------------------------------------------------ Const BS_CALLBACK_DLCInstalled = BS_ECallback_SteamAppsCallbacks + 5 Const BS_CALLBACK_APPProofOfPurchaseKeyResponse = BS_ECallback_SteamAppsCallbacks + 13 Const BS_CALLBACK_NewLaunchQueryParameters = BS_ECallback_SteamAppsCallbacks + 14 +;[End Block] -;! Controller ------------------------------------------------------------------ -Const BS_MASK_RIGHT_TRIGGER = $00000001 -Const BS_MASK_LEFT_TRIGGER = $00000002 -Const BS_MASK_RIGHT_BUMPER = $00000004 -Const BS_MASK_LEFT_BUMPER = $00000008 -Const BS_MASK_BUTTON_0 = $00000010 -Const BS_MASK_BUTTON_1 = $00000020 -Const BS_MASK_BUTTON_2 = $00000040 -Const BS_MASK_BUTTON_3 = $00000080 -Const BS_MASK_TOUCH_0 = $00000100 -Const BS_MASK_TOUCH_1 = $00000200 -Const BS_MASK_TOUCH_2 = $00000400 -Const BS_MASK_TOUCH_3 = $00000800 -Const BS_MASK_BUTTON_MENU = $0001000 -Const BS_MASK_BUTTON_STEAM = $0002000 -Const BS_MASK_BUTTON_ESCAPE = $0004000 -Const BS_MASK_BUTTON_BACK_LEFT = $0008000 -Const BS_MASK_BUTTON_BACK_RIGHT = $0010000 -Const BS_MASK_BUTTON_LEFTPAD_CLICKED = $0020000 -Const BS_MASK_BUTTON_RIGHTPAD_CLICKED = $0040000 -Const BS_MASK_LEFTPAD_FINGERDOWN = $0080000 -Const BS_MASK_RIGHTPAD_FINGERDOWN = $0100000 -Const BS_MASK_JOYSTICK_BUTTON = $0400000 -Const BS_ESteamControllerPad_Left = 0 -Const BS_ESteamControllerPad_Right = 1 +;[Block] API: Controller +;------------------------------------------------------------------------------ +;! Controller +;------------------------------------------------------------------------------ -Type BS_ControllerState - Field unPacketNum% - Field ulButtonsL%, ulButtonsR% - Field sLeftPadXY ; Left/High = X, Right/Low = Y - Field sRightPadXY ; Left/High = X, Right/Low = Y -End Type - -;! Friends --------------------------------------------------------------------- -Const BS_cchMaxFriendsGroupName = 64 -Const BS_cFriendsGroupLimit = 100 -Const BS_FriendsGroupID_Invalid = -1 -Const BS_cEnumerateFollowersMax = 50 -Const BS_cchPersonaNameMax = 128 -Const BS_cwchPersonaNameMax = 32 - -Type BS_FriendGameInfo - Field m_gameID% - Field m_unGameIP% - Field m_usGamePortQueryPort% ; Left/High GamePort, Right/Low QueryPort - Field m_steamIDLobby% -End Type - - -Type BS_FriendSessionStateInfo - Field m_uiOnlineSessionInstances - Field m_uiPublishedToFriendsSessionInstance -End Type - -Const BS_cubChatMetadataMax = 8192 -Const BS_cchMaxRichPresenceKeys = 20 -Const BS_cchMaxRichPresenceKeyLength = 64 -Const BS_cchMaxRichPresenceValueLength = 256 +; Memory Structure: ControllerAnalogActionData_t +; Offs. Len Description +; // Type of data coming from this action, this will match what got specified in the action set +; 0 4 eMode +; // The current state of this action; will be delta updates for mouse actions +; 4 4 x +; 8 4 y +; // Whether or not this action is currently available to be bound in the active action set +; 12 1 bActive; +; Memory Structure: ControllerDigitalActionData_t +; Offs. Len Description +; // The current state of this action; will be true if currently pressed +; 0 1 bState; +; // Whether or not this action is currently available to be bound in the active action set +; 1 1 bActive; +;[End Block] +;[Block] API: Friends +;------------------------------------------------------------------------------ +;! Friends +;------------------------------------------------------------------------------ Const BS_CALLBACK_PersonaStateChange = BS_ECallback_SteamFriendsCallbacks + 4 Const BS_CALLBACK_GameOverlayActivated = BS_ECallback_SteamFriendsCallbacks + 31 Const BS_CALLBACK_GameServerChangeRequested = BS_ECallback_SteamFriendsCallbacks + 32 @@ -492,71 +613,324 @@ Const BS_CALLBACK_FriendsIsFollowing = BS_ECallback_SteamFriendsCallbacks + Const BS_CALLBACK_FriendsEnumerateFollowingList = BS_ECallback_SteamFriendsCallbacks + 46 Const BS_CALLBACK_SetPersonaNameResponse = BS_ECallback_SteamFriendsCallbacks + 47 -;! GameServer ------------------------------------------------------------------ +Const BS_cchMaxFriendsGroupName = 64 +Const BS_cFriendsGroupLimit = 100 +Const BS_FriendsGroupID_Invalid = -1 +Const BS_cEnumerateFollowersMax = 50 +Const BS_cchPersonaNameMax = 128 +Const BS_cwchPersonaNameMax = 32 +Const BS_cubChatMetadataMax = 8192 +Const BS_cchMaxRichPresenceKeys = 20 +Const BS_cchMaxRichPresenceKeyLength = 64 +Const BS_cchMaxRichPresenceValueLength = 256 -; client has been approved to connect to this game server -Const BS_CALLBACK_GSClientApprove = BS_ECallback_SteamGameServerCallbacks + 1 +Type BS_FriendGameInfo_t + Field m_gameID% + Field m_unGameIP% + Field m_usGamePortQueryPort% ; Left/High GamePort, Right/Low QueryPort + Field m_steamIDLobby% +End Type + +Type BS_FriendSessionStateInfo_t + Field m_uiOnlineSessionInstances + Field m_uiPublishedToFriendsSessionInstance +End Type +;[End Block] + +;[Block] API: HTMLSurface +;------------------------------------------------------------------------------ +;! HTMLSurface +;------------------------------------------------------------------------------ + +;//----------------------------------------------------------------------------- +;// Purpose: The browser is ready for use +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_BrowserReady = BS_ECallback_SteamHTMLSurfaceCallbacks + 1 +;DEFINE_CALLBACK( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages +;END_DEFINE_CALLBACK_1() + +;//----------------------------------------------------------------------------- +;// Purpose: the browser has a pending paint +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_NeedsPaint = BS_ECallback_SteamHTMLSurfaceCallbacks + 2 +;DEFINE_CALLBACK(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) +;CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint +;CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called +;CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture +;CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture +;CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update +;CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update +;CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update +;CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update +;CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered +;CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered +;CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered +;CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages +;END_DEFINE_CALLBACK_12() + +;//----------------------------------------------------------------------------- +;// Purpose: The browser wanted to navigate to a new page +;// NOTE - you MUST call AllowStartRequest in response to this callback +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_StartRequest = BS_ECallback_SteamHTMLSurfaceCallbacks + 3 +;DEFINE_CALLBACK(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) +;CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating +;CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to +;CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) +;CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request +;CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request +;END_DEFINE_CALLBACK_5() + +;//----------------------------------------------------------------------------- +;// Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_CloseBrowser = BS_ECallback_SteamHTMLSurfaceCallbacks + 4 +;DEFINE_CALLBACK(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) +;CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface +;END_DEFINE_CALLBACK_1() + +;//----------------------------------------------------------------------------- +;// Purpose: the browser is navigating to a new url +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_URLChanged = BS_ECallback_SteamHTMLSurfaceCallbacks + 5 +;DEFINE_CALLBACK( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating +;CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to +;CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request +;CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request +;CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page +;CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page +;END_DEFINE_CALLBACK_6() + +;//----------------------------------------------------------------------------- +;// Purpose: A page is finished loading +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_FinishedRequest = BS_ECallback_SteamHTMLSurfaceCallbacks + 6 +;DEFINE_CALLBACK( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchURL ) // +;CALLBACK_MEMBER( 2, Const char *, pchPageTitle ) // +;END_DEFINE_CALLBACK_3() + +;//----------------------------------------------------------------------------- +;// Purpose: a request To load this url in a New tab +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_OpenLinkInNewTab = BS_ECallback_SteamHTMLSurfaceCallbacks + 7 +;DEFINE_CALLBACK( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchURL ) // +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: the page has a New title now +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_ChangedTitle = BS_ECallback_SteamHTMLSurfaceCallbacks + 8 +;DEFINE_CALLBACK( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchTitle ) // +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: results from a search +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_SearchResults = BS_ECallback_SteamHTMLSurfaceCallbacks + 9 +;DEFINE_CALLBACK( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, uint32, unResults ) // +;CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // +;END_DEFINE_CALLBACK_3() + +;//----------------------------------------------------------------------------- +;// Purpose: page history status changed on the ability To go backwards And forward +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_CanGoBackAndForward = BS_ECallback_SteamHTMLSurfaceCallbacks + 10 +;DEFINE_CALLBACK( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, bool, bCanGoBack ) // +;CALLBACK_MEMBER( 2, bool, bCanGoForward ) // +;END_DEFINE_CALLBACK_3() + +;//----------------------------------------------------------------------------- +;// Purpose: details on the visibility And size of the horizontal scrollbar +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_HorizontalScroll = BS_ECallback_SteamHTMLSurfaceCallbacks + 11 +;DEFINE_CALLBACK( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +;CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +;CALLBACK_MEMBER( 3, Float, flPageScale ) // +;CALLBACK_MEMBER( 4, bool , bVisible ) // +;CALLBACK_MEMBER( 5, uint32, unPageSize ) // +;END_DEFINE_CALLBACK_6() + +;//----------------------------------------------------------------------------- +;// Purpose: details on the visibility And size of the vertical scrollbar +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_VerticalScroll = BS_ECallback_SteamHTMLSurfaceCallbacks + 12 +;DEFINE_CALLBACK( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +;CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +;CALLBACK_MEMBER( 3, Float, flPageScale ) // +;CALLBACK_MEMBER( 4, bool, bVisible ) // +;CALLBACK_MEMBER( 5, uint32, unPageSize ) // +;END_DEFINE_CALLBACK_6() + +;//----------------------------------------------------------------------------- +;// Purpose: response To GetLinkAtPosition call +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_LinkAtPosition = BS_ECallback_SteamHTMLSurfaceCallbacks + 13 +;DEFINE_CALLBACK( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set +;CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set +;CALLBACK_MEMBER( 3, Const char *, pchURL ) // +;CALLBACK_MEMBER( 4, bool, bInput ) // +;CALLBACK_MEMBER( 5, bool, bLiveLink ) // +;END_DEFINE_CALLBACK_6() + +;//----------------------------------------------------------------------------- +;// Purpose: show a Javascript alert dialog, call JSDialogResponse +;// when the user dismisses this dialog (Or Right away To ignore it) +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_JSAlert = BS_ECallback_SteamHTMLSurfaceCallbacks + 14 +;DEFINE_CALLBACK( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchMessage ) // +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: show a Javascript confirmation dialog, call JSDialogResponse +;// when the user dismisses this dialog (Or Right away To ignore it) +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_JSConfirm = BS_ECallback_SteamHTMLSurfaceCallbacks + 15 +;DEFINE_CALLBACK( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchMessage ) // +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: when received show a file open dialog +;// Then call FileLoadDialogResponse with the file(s) the user selected. +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_FileOpenDialog = BS_ECallback_SteamHTMLSurfaceCallbacks + 16 +;DEFINE_CALLBACK( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchTitle ) // +;CALLBACK_MEMBER( 2, Const char *, pchInitialFile ) // +;END_DEFINE_CALLBACK_3() + +;//----------------------------------------------------------------------------- +;// Purpose: a New html window has been created +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_NewWindow = BS_ECallback_SteamHTMLSurfaceCallbacks + 21 +;DEFINE_CALLBACK( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the current surface +;CALLBACK_MEMBER( 1, Const char *, pchURL ) // the page To load +;CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page To display the popup +;CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page To display the popup +;CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture +;CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture +;CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle ) // the Handle of the New window surface +;END_DEFINE_CALLBACK_7() + +;//----------------------------------------------------------------------------- +;// Purpose: change the cursor To display +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_SetCursor = BS_ECallback_SteamHTMLSurfaceCallbacks + 22 +;DEFINE_CALLBACK( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor To display +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: informational message from the browser +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_StatusText = BS_ECallback_SteamHTMLSurfaceCallbacks + 23 +;DEFINE_CALLBACK( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchMsg ) // the EMouseCursor To display +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: show a tooltip +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_ShowToolTip = BS_ECallback_SteamHTMLSurfaceCallbacks + 24 +;DEFINE_CALLBACK( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchMsg ) // the EMouseCursor To display +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: update the Text of an existing tooltip +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_UpdateToolTip = BS_ECallback_SteamHTMLSurfaceCallbacks + 25 +;DEFINE_CALLBACK( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;CALLBACK_MEMBER( 1, Const char *, pchMsg ) // the EMouseCursor To display +;END_DEFINE_CALLBACK_2() + +;//----------------------------------------------------------------------------- +;// Purpose: hide the tooltip you are showing +;//----------------------------------------------------------------------------- +Const BS_HTMLSurface_HideToolTip = BS_ECallback_SteamHTMLSurfaceCallbacks + 26 +;DEFINE_CALLBACK( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) +;CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the Handle of the surface +;END_DEFINE_CALLBACK_1() +;[End Block] + +;[Block] API: GameServer +;------------------------------------------------------------------------------ +;! GameServer +;------------------------------------------------------------------------------ +Const BS_CALLBACK_GSClientApprove = BS_ECallback_SteamGameServerCallbacks + 1 ; client has been approved to connect to this game server Type BS_GSClientApprove_t Field SteamIDHigh%, SteamIDLow% ; SteamID of approved player Field OwnerSteamIDHigh%, OwnerSteamIDLow% ; SteamID of original owner for game license End Type - -; client has been denied to connection to this game server -Const BS_CALLBACK_GSClientDeny = BS_ECallback_SteamGameServerCallbacks + 2 +Const BS_CALLBACK_GSClientDeny = BS_ECallback_SteamGameServerCallbacks + 2 ; client has been denied to connection to this game server Type BS_GSClientDeny_t Field SteamIDHigh%, SteamIDLow% Field eDenyReason%, pad0% Field rgchOptionalText%[31] ; 128 Bytes of Optional Text End Type - -; request the game server should kick the user -Const BS_CALLBACK_GSClientKick = BS_ECallback_SteamGameServerCallbacks + 3 +Const BS_CALLBACK_GSClientKick = BS_ECallback_SteamGameServerCallbacks + 3 ; request the game server should kick the user Type BS_GSClientKick_t Field SteamIDHigh%, SteamIDLow% Field eDenyReason%, pad0% End Type - -; client achievement info -Const BS_CALLBACK_GSClientAchievementStatus = BS_ECallback_SteamGameServerCallbacks + 6 +Const BS_CALLBACK_GSClientAchievementStatus = BS_ECallback_SteamGameServerCallbacks + 6 ; client achievement info Type BS_GSClientAchievementStatus_t Field SteamIDHigh%, SteamIDLow% Field pchAchievement[31] ; 128 byte C-String Achievement Field bUnlocked%, pad0% End Type - -; received when the game server requests to be displayed as secure (VAC protected) -; m_bSecure is true if the game server should display itself as secure to users, false otherwise -Const BS_CALLBACK_GSPolicyResponse = BS_ECallback_SteamUserCallbacks + 15 -Type BS_GSPolicyResponse_t +Const BS_CALLBACK_GSPolicyResponse = BS_ECallback_SteamUserCallbacks + 15 ; received when the game server requests to be displayed as secure (VAC protected) +Type BS_GSPolicyResponse_t ; m_bSecure is true if the game server should display itself as secure to users, false otherwise Field m_bSecure%, pad0% End Type - -; GS gameplay stats info -Const BS_CALLBACK_GSGameplayStats = BS_ECallback_SteamGameServerCallbacks + 7 +Const BS_CALLBACK_GSGameplayStats = BS_ECallback_SteamGameServerCallbacks + 7 ; GS gameplay stats info Type BS_GSGameplayStats_t Field eResult%, pad0% ; Result of the call Field nRank%, pad1% ; Overall rank of the server (0-based) Field unTotalConnects%, pad2% ; Total number of clients who have ever connected to the server Field unTotalMinutesPlayed%, pad3% ; Total number of minutes ever played on the server End Type - -; send as a reply to RequestUserGroupStatus() -Const BS_CALLBACK_GSClientGroupStatus = BS_ECallback_SteamGameServerCallbacks + 8 +Const BS_CALLBACK_GSClientGroupStatus = BS_ECallback_SteamGameServerCallbacks + 8 ; Sent as a reply to RequestUserGroupStatus() Type BS_GSClientGroupStatus_t Field SteamIDUserHigh%, SteamIDUserLow% Field SteamIDGroupHigh%, SteamIDGroupLow% Field bMember%, pad0% Field bOfficer%, pad1% End Type - -; Sent as a reply to GetServerReputation() -Const BS_CALLBACK_GSReputation = BS_ECallback_SteamGameServerCallbacks + 9 +Const BS_CALLBACK_GSReputation = BS_ECallback_SteamGameServerCallbacks + 9 ; Sent as a reply to GetServerReputation() Type BS_GSReputation_t Field eResult%, pad0% ; Result of the call Field unReputationScore%, pad1% ; The reputation score for the game server Field bBanned%, pad2% ; True if the server is banned from the Steam ; master servers - + ; The following members are only filled out if m_bBanned is true. They will all ; be set to zero otherwise. Master server bans are by IP so it is possible to be ; banned even when the score is good high if there is a bad server on another port. @@ -566,15 +940,11 @@ Type BS_GSReputation_t Field ulBannedGameIDHigh%, ulBannedGameIDLow% ; The game ID the banned server is serving Field unBanExpires%, pad5% ; Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) End Type - -; Sent as a reply to AssociateWithClan() -Const BS_CALLBACK_AssociateWithClanResult = BS_ECallback_SteamGameServerCallbacks + 10 +Const BS_CALLBACK_AssociateWithClanResult = BS_ECallback_SteamGameServerCallbacks + 10; Sent as a reply to AssociateWithClan() Type BS_AssociateWithClanResult_t Field eResult% ; Result of the call End Type - -; Sent as a reply to ComputeNewPlayerCompatibility() -Const BS_CALLBACK_ComputeNewPlayerCompatibilityResult = BS_ECallback_SteamGameServerCallbacks + 11 +Const BS_CALLBACK_ComputeNewPlayerCompatibilityResult = BS_ECallback_SteamGameServerCallbacks + 11; Sent as a reply to ComputeNewPlayerCompatibility() Type BS_ComputeNewPlayerCompatibilityResult_t Field eResult%, pad0% ; Result of the call Field cPlayersThatDontLikeCandidate%, pad1% @@ -582,9 +952,151 @@ Type BS_ComputeNewPlayerCompatibilityResult_t Field cClanPlayersThatDontLikeCandidate%, pad3% Field SteamIDCandidateHigh%, SteamIDCandidateLow% End Type +;[End Block] -;! Networking ------------------------------------------------------------------ +;[Block] API: User +;------------------------------------------------------------------------------ +;! User +;------------------------------------------------------------------------------ +Type BS_CallbackMsg_t + Field m_hSteamUser% + Field m_iCallback% + Field m_pubParamPtr% + Field m_cubParam% +End Type +; Purpose: called when a connections to the Steam back-end has been established +; this means the Steam client now has a working connection to the Steam servers +; usually this will have occurred before the game has launched, and should +; only be seen if the user has dropped connection due to a networking issue +; or a Steam server update +Const BS_SteamServersConnected = BS_ECallback_SteamUserCallbacks + 1 +; Purpose: called when a connection attempt has failed +; this will occur periodically if the Steam client is not connected, +; and has failed in it's retry to establish a connection +Const BS_SteamServerConnectFailure = BS_ECallback_SteamUserCallbacks + 2 +; Purpose: called if the client has lost connection to the Steam servers +; real-time services will be disabled until a matching SteamServersConnected_t has been posted +Const BS_SteamServersDisconnected = BS_ECallback_SteamUserCallbacks + 3 +; Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, +; which it may be in the process of or already connected to. +; The game client should immediately disconnect upon receiving this message. +; This can usually occur if the user doesn't have rights to play on the game server. +Const BS_ClientGameServerDeny = BS_ECallback_SteamUserCallbacks + 13 +; Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) +; When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect. +; This usually occurs in the rare event the Steam client has some kind of fatal error. +Const BS_EIPCFailureType_FlushedCallbackQueue = 0 +Const BS_EIPCFailureType_PipeFail = 1 +Const BS_IPCFailure = BS_ECallback_SteamUserCallbacks + 17 +; Purpose: Signaled whenever licenses change +Const BS_LicensesUpdated = BS_ECallback_SteamUserCallbacks + 25 +; callback for BeginAuthSession +Const BS_ValidateAuthTicketResponse = BS_ECallback_SteamUserCallbacks + 43 +; Purpose: called when a user has responded to a microtransaction authorization request +Const BS_MicroTxnAuthorizationResponse = BS_ECallback_SteamUserCallbacks + 52 +; Purpose: Result from RequestEncryptedAppTicket +Const BS_EncryptedAppTicketResponse = BS_ECallback_SteamUserCallbacks + 54 +; callback for GetAuthSessionTicket +Const BS_GetAuthSessionTicketResponse = BS_ECallback_SteamUserCallbacks + 63 +; Purpose: sent to your game in response to a steam//gamewebcallback/ command +Const BS_GameWebCallback = BS_ECallback_SteamUserCallbacks + 64 +; Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL +Const BS_StoreAuthURLResponse = BS_ECallback_SteamUserCallbacks + 65 +;[End Block] + +;[Block] API: UserStats +;------------------------------------------------------------------------------ +;! UserStats +;------------------------------------------------------------------------------ +Const BS_cchStatNameMax = 128 +Const BS_cchLeaderboardNameMax = 128 +Const BS_cLeaderboardDetailsMax = 64 + +Type BS_LeaderboardEntry_t + Field SteamId_High%, SteamId_Low% + Field nGlobalRank% + Field nScore% + Field cDetails% + Field hUGC_High%, hUGC_Low% +End Type + +Const BS_CALLBACK_UserStatsReceived = BS_ECallback_SteamUserStatsCallbacks + 1 +Type BS_UserStatsReceived_t + Field nGameId_High%, nGameId_Low% ; Game these stats are for + Field eResult% ; Success / error fetching the stats + Field steamIDUser_High%, steamIDUser_Low% ; The user for whom the stats are retrieved for +End Type +Const BS_CALLBACK_UserStatsStored = BS_ECallback_SteamUserStatsCallbacks + 2 +Type BS_UserStatsStored_t + Field nGameId_High%, nGameId_Low% ; Game these stats are for + Field eResult% ; Success / error +End Type +Const BS_CALLBACK_UserAchievementStored = BS_ECallback_SteamUserStatsCallbacks + 3 +Type BS_UserAchievementStored_t + Field nGameId_High%, nGameId_Low% ; Game this is for + Field bGroupAchievement% ; if this is a "group" achievement + Field rgchAchievementName[BS_cchStatNameMax] ; name of the achievement + Field nCurProgress ; current progress towards the achievement + Field nMaxProgress ; "out of" this many +End Type +Const BS_CALLBACK_LeaderboardFindResult = BS_ECallback_SteamUserStatsCallbacks + 4 +Type BS_LeaderboardFindResult_t + Field hSteamLeaderboard_High%, hSteamLeaderboard_Low% ; handle to the leaderboard serarched for, 0 if no leaderboard found + Field bLeaderboardFound% ; 0 if no leaderboard found +End Type +Const BS_CALLBACK_LeaderboardScoresDownloaded = BS_ECallback_SteamUserStatsCallbacks + 5 +Type BS_LeaderboardScoresDownloaded_t + Field hSteamLeaderboard_High, hSteamLeaderboard_Low ; + Field hSteamLeaderboardEntries_High, hSteamLeaderboardEntries_Low; the handle to pass into GetDownloadedLeaderboardEntries() + Field cEntryCount ; the number of entries downloaded +End Type +Const BS_CALLBACK_LeaderboardScoreUploaded = BS_ECallback_SteamUserStatsCallbacks + 6 +Type BS_LeaderboardScoreUploaded_t + Field bSuccess ; 1 if the call was successful + Field hSteamLeaderboard_High, hSteamLeaderboard_Low ; the leaderboard handle that was + Field nScore ; the score that was attempted to set + Field bScoreChanged ; true if the score in the leaderboard change, false if the existing score was better + Field nGlobalRankNew ; the new global rank of the user in this leaderboard + Field nGlobalRankPrevious ; the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard +End Type +Const BS_CALLBACK_NumberOfCurrentPlayers = BS_ECallback_SteamUserStatsCallbacks + 7 +Type BS_NumberOfCurrentPlayers_t + Field bSuccess ; 1 if the call was successful + Field cPlayers ; Number of players currently playing +End Type +Const BS_CALLBACK_UserStatsUnloaded = BS_ECallback_SteamUserStatsCallbacks + 8 +Type BS_UserStatsUnloaded_t + Field steamIDUser_High, steamIDUser_Low ; User whose stats have been unloaded +End Type +Const BS_CALLBACK_UserAchievementIconFetched = BS_ECallback_SteamUserStatsCallbacks + 9 +Type BS_UserAchievementIconFetched_t + Field nGameID_High, nGameID_Low ; Game this is for + Field rgchAchievementName[BS_cchStatNameMax] ; name of the achievement + Field bAchieved ; Is the icon for the achieved or not achieved version? + Field nIconHandle ; Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement +End Type +Const BS_CALLBACK_GlobalAchievementPercentagesReady = BS_ECallback_SteamUserStatsCallbacks + 10 +Type BS_GlobalAchievementPercentagesReady_t + Field nGameID_High, nGameID_Low ; Game this is for + Field eResult ; Result of the operation +End Type +Const BS_CALLBACK_LeaderboardUGCSet = BS_ECallback_SteamUserStatsCallbacks + 11 +Type BS_LeaderboardUGCSet_t + Field eResult ; The result of the operation + Field hSteamLeaderboard_High, hSteamLeaderboard_Low ; the leaderboard handle that was +End Type +Const BS_CALLBACK_GlobalStatsReceived = BS_ECallback_SteamUserStatsCallbacks + 12 +Type BS_GlobalStatsReceived_t + Field nGameID_High, nGameId_Low ; Game global stats were requested for + Field eResult ; The result of the request +End Type +;[End Block] + +;[Block] API: Networking +;------------------------------------------------------------------------------ +;! Networking +;------------------------------------------------------------------------------ Type BS_P2PSessionState_t Field bConnectionActive%, pad0% Field bConnecting%, pad1% @@ -611,105 +1123,9 @@ Type BS_P2PSessionConnectFail_t Field steamIDRemoteHigh%, steamIDRemoteLow% ; user we were sending packets to Field eP2PSessionError ; EP2PSessionError indicating why we're having trouble End Type - -;! User ------------------------------------------------------------------------ - -;! UserStats ------------------------------------------------------------------- -Const BS_cchStatNameMax = 128 -Const BS_cchLeaderboardNameMax = 128 -Const BS_cLeaderboardDetailsMax = 64 - -Type BS_LeaderboardEntry - Field SteamId_High%, SteamId_Low% - Field nGlobalRank% - Field nScore% - Field cDetails% - Field hUGC_High%, hUGC_Low% -End Type - -Const BS_CALLBACK_UserStatsReceived = BS_ECallback_SteamUserStatsCallbacks + 1 -Type BS_UserStatsReceived - Field nGameId_High%, nGameId_Low% ; Game these stats are for - Field eResult% ; Success / error fetching the stats - Field steamIDUser_High%, steamIDUser_Low% ; The user for whom the stats are retrieved for -End Type - -Const BS_CALLBACK_UserStatsStored = BS_ECallback_SteamUserStatsCallbacks + 2 -Type BS_UserStatsStored - Field nGameId_High%, nGameId_Low% ; Game these stats are for - Field eResult% ; Success / error -End Type - -Const BS_CALLBACK_UserAchievementStored = BS_ECallback_SteamUserStatsCallbacks + 3 -Type BS_UserAchievementStored - Field nGameId_High%, nGameId_Low% ; Game this is for - Field bGroupAchievement% ; if this is a "group" achievement - Field rgchAchievementName[BS_cchStatNameMax] ; name of the achievement - Field nCurProgress ; current progress towards the achievement - Field nMaxProgress ; "out of" this many -End Type - -Const BS_CALLBACK_LeaderboardFindResult = BS_ECallback_SteamUserStatsCallbacks + 4 -Type BS_LeaderboardFindResult - Field hSteamLeaderboard_High%, hSteamLeaderboard_Low% ; handle to the leaderboard serarched for, 0 if no leaderboard found - Field bLeaderboardFound% ; 0 if no leaderboard found -End Type - -Const BS_CALLBACK_LeaderboardScoresDownloaded = BS_ECallback_SteamUserStatsCallbacks + 5 -Type BS_LeaderboardScoresDownloaded - Field hSteamLeaderboard_High, hSteamLeaderboard_Low ; - Field hSteamLeaderboardEntries_High, hSteamLeaderboardEntries_Low; the handle to pass into GetDownloadedLeaderboardEntries() - Field cEntryCount ; the number of entries downloaded -End Type - -Const BS_CALLBACK_LeaderboardScoreUploaded = BS_ECallback_SteamUserStatsCallbacks + 6 -Type BS_LeaderboardScoreUploaded - Field bSuccess ; 1 if the call was successful - Field hSteamLeaderboard_High, hSteamLeaderboard_Low ; the leaderboard handle that was - Field nScore ; the score that was attempted to set - Field bScoreChanged ; true if the score in the leaderboard change, false if the existing score was better - Field nGlobalRankNew ; the new global rank of the user in this leaderboard - Field nGlobalRankPrevious ; the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard -End Type - -Const BS_CALLBACK_NumberOfCurrentPlayers = BS_ECallback_SteamUserStatsCallbacks + 7 -Type BS_NumberOfCurrentPlayers - Field bSuccess ; 1 if the call was successful - Field cPlayers ; Number of players currently playing -End Type - -Const BS_CALLBACK_UserStatsUnloaded = BS_ECallback_SteamUserStatsCallbacks + 8 -Type BS_UserStatsUnloaded - Field steamIDUser_High, steamIDUser_Low ; User whose stats have been unloaded -End Type - -Const BS_CALLBACK_UserAchievementIconFetched = BS_ECallback_SteamUserStatsCallbacks + 9 -Type BS_UserAchievementIconFetched - Field nGameID_High, nGameID_Low ; Game this is for - Field rgchAchievementName[BS_cchStatNameMax] ; name of the achievement - Field bAchieved ; Is the icon for the achieved or not achieved version? - Field nIconHandle ; Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement -End Type - -Const BS_CALLBACK_GlobalAchievementPercentagesReady = BS_ECallback_SteamUserStatsCallbacks + 10 -Type BS_GlobalAchievementPercentagesReady - Field nGameID_High, nGameID_Low ; Game this is for - Field eResult ; Result of the operation -End Type - -Const BS_CALLBACK_LeaderboardUGCSet = BS_ECallback_SteamUserStatsCallbacks + 11 -Type BS_LeaderboardUGCSet - Field eResult ; The result of the operation - Field hSteamLeaderboard_High, hSteamLeaderboard_Low ; the leaderboard handle that was -End Type - -Const BS_CALLBACK_GlobalStatsReceived = BS_ECallback_SteamUserStatsCallbacks + 12 -Type BS_GlobalStatsReceived - Field nGameID_High, nGameId_Low ; Game global stats were requested for - Field eResult ; The result of the request -End Type - ;[End Block] + ;~IDEal Editor Parameters: -;~F#196#1B9 +;~F#10#27#38#44#79#81#90#A1#CF#DD#EF#F8#102#10C#116#11F#128#131#145#152 +;~F#16B#17B#1E6#1F0#200#209#217#227#230#239#250#372#3BC#3EF#447 ;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/BlitzSteam.decls b/Blitz/BlitzSteam.decls index d04c3e4..fd01df8 100644 --- a/Blitz/BlitzSteam.decls +++ b/Blitz/BlitzSteam.decls @@ -27,8 +27,8 @@ BS_Steam_WriteMiniDumpEx(uStructuredExceptionCode%, pvExceptionInfo%, uBuildID%) BS_Steam_RunCallbacks() BS_Steam_RegisterCallback(pCallback%, iCallback%) BS_Steam_UnregisterCallback(pCallback%) -BS_Steam_RegisterCallResult(pCallback%, hAPICall_L%, hAPICall_R%) -BS_Steam_UnregisterCallResult(pCallback%, hAPICall_L%, hAPICall_R%) +BS_Steam_RegisterCallResult(pCallback%, hAPICall%) +BS_Steam_UnregisterCallResult(pCallback%, hAPICall%) ; AppList --------------------------------------------------------------------- BS_AppList%() @@ -37,8 +37,8 @@ BS_AppList_GetInstalledApps%(lpSteamAppList%, pvecAppID*, unMaxIDs%) BS_AppList_GetInstalledAppsEx%(lpSteamAppList%, pvecAppID%, unMaxIDs%) : "BS_AppList_GetInstalledApps" BS_AppList_GetAppNameEx%(lpSteamAppList%, nAppId%, pchName%, cchNameMax%) : "BS_AppList_GetAppName" BS_AppList_GetAppName%(lpSteamAppList%, nAppId%, pchName*, cchNameMax%) -BS_AppList_GetAppInstallDir%(lpSteamAppList%, nAppId%, pchDirectory*, cchDirectoryMax%) -BS_AppList_GetAppInstallDirEx%(lpSteamAppList%, nAppId%, pchDirectory%, cchDirectoryMax%) : "BS_AppList_GetAppInstallDir" +BS_AppList_GetAppInstallDir%(lpSteamAppList%, nAppId%, pchDirectoryBuffer*, cchDirectoryMax%) +BS_AppList_GetAppInstallDirEx%(lpSteamAppList%, nAppId%, pchDirectoryBuffer%, cchDirectoryMax%) : "BS_AppList_GetAppInstallDir" BS_AppList_GetAppBuildId%(lpSteamAppList%, nAppId%) ; Apps ------------------------------------------------------------------------ @@ -54,23 +54,23 @@ BS_Apps_IsDlcInstalled%(lpSteamApps%, appID%) BS_Apps_GetEarliestPurchaseUnixTime%(lpSteamApps%, appID%) BS_Apps_IsSubscribedFromFreeWeekend%(lpSteamApps%) BS_Apps_GetDLCCount%(lpSteamApps%) -BS_Apps_GetDLCDataByIndex%(lpSteamApps%, iDLC%, pAppId*, pbAvailable*, pchName*, cchNameBufferSize%) -BS_Apps_GetDLCDataByIndexEx%(lpSteamApps%, iDLC%, pAppId%, pbAvailable%, pchName%, cchNameBufferSize%) : "BS_Apps_GetDLCDataByIndex" +BS_Apps_GetDLCDataByIndex%(lpSteamApps%, iDLC%, pAppIdBuffer*, pbAvailableBuffer*, pchNameBuffer*, cchNameBufferSize%) +BS_Apps_GetDLCDataByIndexEx%(lpSteamApps%, iDLC%, pAppIdBuffer%, pbAvailableBuffer%, pchNameBuffer%, cchNameBufferSize%) : "BS_Apps_GetDLCDataByIndex" BS_Apps_InstallDLC(lpSteamApps%, nAppID%) BS_Apps_UninstallDLC(lpSteamApps%, nAppID%) BS_Apps_RequestAppProofOfPurchaseKey(lpSteamApps%, nAppID%) -BS_Apps_GetCurrentBetaName%(lpSteamApps%, pchName*, cchNameBufferSize%) -BS_Apps_GetCurrentBetaNameEx%(lpSteamApps%, pchName%, cchNameBufferSize%) : "BS_Apps_GetCurrentBetaName" +BS_Apps_GetCurrentBetaName%(lpSteamApps%, pchNameBuffer*, cchNameBufferSize%) +BS_Apps_GetCurrentBetaNameEx%(lpSteamApps%, pchNameBuffer%, cchNameBufferSize%) : "BS_Apps_GetCurrentBetaName" BS_Apps_MarkContentCorrupt%(lpSteamApps%, bMissingFilesOnly%) -BS_Apps_GetInstalledDepots%(lpSteamApps%, nAppID%, pvecDepots*, cMaxDepots%) -BS_Apps_GetInstalledDepotsEx%(lpSteamApps%, nAppID%, pvecDepots%, cMaxDepots%) : "BS_Apps_GetInstalledDepots" -BS_Apps_GetAppInstallDir%(lpSteamApps%, nAppID%, pchFolder*, cchFolderBufferSize%) -BS_Apps_GetAppInstallDirEx%(lpSteamApps%, nAppID%, pchFolder%, cchFolderBufferSize%) : "BS_Apps_GetAppInstallDir" +BS_Apps_GetInstalledDepots%(lpSteamApps%, nAppID%, pDepotsBuffer*, cMaxDepots%) +BS_Apps_GetInstalledDepotsEx%(lpSteamApps%, nAppID%, pDepotsBuffer%, cMaxDepots%) : "BS_Apps_GetInstalledDepots" +BS_Apps_GetAppInstallDir%(lpSteamApps%, nAppID%, pchFolderBuffer*, cchFolderBufferSize%) +BS_Apps_GetAppInstallDirEx%(lpSteamApps%, nAppID%, pchFolderBuffer%, cchFolderBufferSize%) : "BS_Apps_GetAppInstallDir" BS_Apps_IsAppInstalled%(lpSteamApps%, nAppID%) BS_Apps_GetAppOwner%(lpSteamApps%) BS_Apps_GetLaunchQueryParam$(lpSteamApps%, pchKey$) -BS_Apps_GetDlcDownloadProgress%(lpSteamApps%, nAppID%, punBytesDownloaded*, punBytesTotal*) -BS_Apps_GetDlcDownloadProgressEx%(lpSteamApps%, nAppID%, punBytesDownloaded%, punBytesTotal%) : "BS_Apps_GetDlcDownloadProgress" +BS_Apps_GetDlcDownloadProgress%(lpSteamApps%, nAppID%, pLLBytesDownloaded*, pLLBytesTotal*) +BS_Apps_GetDlcDownloadProgressEx%(lpSteamApps%, nAppID%, pLLBytesDownloaded%, pLLBytesTotal%) : "BS_Apps_GetDlcDownloadProgress" BS_Apps_GetAppBuildId%(lpSteamApps%) ; Client ---------------------------------------------------------------------- @@ -116,18 +116,40 @@ BS_Controller%() BS_Controller_Init%(lpSteamController%, pchAbsolutePathToControllerConfigVDF$) BS_Controller_Shutdown%(lpSteamController%) BS_Controller_RunFrame(lpSteamController%) -BS_Controller_GetControllerStateEx%(lpSteamController%, unControllerIndex%, pState%) : "BS_Controller_GetControllerState" -BS_Controller_GetControllerState%(lpSteamController%, unControllerIndex%, pState*) -BS_Controller_TriggerHapticPulse(lpSteamController%, unControllerIndex%, eTargetPad%, usDurationMicroSec%) -BS_Controller_SetOverrideMode(lpSteamController%, pchMode$) +BS_Controller_GetConnectedControllersEx%(lpSteamController%, pHandlesOut*) +BS_Controller_GetConnectedControllersExEx%(lpSteamController%, pHandlesOut%) : "BS_Controller_GetConnectedControllersEx" +BS_Controller_GetConnectedControllers%(lpSteamController%) +BS_Controller_GetConnectedControllers_Index%(index%) +BS_Controller_ShowBindingPanel%(lpSteamController%, pControllerHandle%) +BS_Controller_GetActionSetHandle%(lpSteamController%, pszActionSetName$) +;! Function above returns a ControllerActionSetHandle_t*, clean it up afterwards! +BS_Controller_ActivateActionSet(lpSteamController%, pControllerHandle%, pActionSetHandle%) +BS_Controller_GetCurrentActionSet%(lpSteamController%, ) +;! Function above returns a ControllerActionSetHandle_t*, clean it up afterwards! +BS_Controller_GetDigitalActionHandle%(lpSteamController%, pszActionName$) +;! Function above returns a ControllerDigitalActionHandle_t*, clean it up afterwards! +BS_Controller_GetDigitalActionData%(lpSteamController%, pControllerHandle%, pDigitalActionHandle%) +;! Function above returns a ControllerDigitalActionData_t*, clean it up afterwards? +BS_Controller_GetDigitalActionOrigins%(lpSteamController%, pControllerHandle%, pActionSetHandle%, pDigitalActionHandle%, pEControllerActionOrigin*) +BS_Controller_GetDigitalActionOriginsEx%(lpSteamController%, pControllerHandle%, pActionSetHandle%, pDigitalActionHandle%, pEControllerActionOrigin%) : "BS_Controller_GetDigitalActionOrigins" +BS_Controller_GetAnalogActionHandle%(lpSteamController%, pszActionName$) +;! Function above returns a ControllerAnalogActionHandle_t*, clean it up afterwards! +BS_Controller_GetAnalogActionData%(lpSteamController%, pControllerHandle%, pAnalogActionHandle%) +;! Function above returns a ControllerAnalogActionData_t*, clean it up afterwards? +BS_Controller_GetAnalogActionOrigins%(lpSteamController%, pControllerHandle%, pActionSetHandle%, pAnalogActionHandle%, pEControllerActionOrigin*) +BS_Controller_GetAnalogActionOriginsEx%(lpSteamController%, pControllerHandle%, pActionSetHandle%, pAnalogActionHandle%, pEControllerActionOrigin*) : "BS_Controller_GetAnalogActionOrigins" +BS_Controller_StopAnalogActionMomentum(lpSteamController%, pControllerHandle%, pAnalogActionHandle%) +BS_Controller_TriggerHapticPulse(lpSteamController%, pControllerHandle%, ESteamControllerPad%, usDurationMicroSec%) ; Friends --------------------------------------------------------------------- BS_Friends%() BS_Friends_GetPersonaName$(lpSteamFriends%) BS_Friends_SetPersonaName%(lpSteamFriends%, pchPersonaName$) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_Friends_GetPersonaState%(lpSteamFriends%) BS_Friends_GetFriendCount%(lpSteamFriends%, iFriendFlags%) BS_Friends_GetFriendByIndex%(lpSteamFriends%, iFriend%, iFriendFlags%) +;! Function above returns a CSteamID*, clean it up afterwards! BS_Friends_GetFriendRelationship%(lpSteamFriends%, steamIDFriend%) BS_Friends_GetFriendPersonaState%(lpSteamFriends%, steamIDFriend%) BS_Friends_GetFriendPersonaName$(lpSteamFriends%, steamIDFriend%) @@ -168,6 +190,7 @@ BS_Friends_RequestClanOfficerList%(lpSteamFriends%, steamIDClan%) BS_Friends_GetClanOwner%(lpSteamFriends%, steamIDClan%) BS_Friends_GetClanOfficerCount%(lpSteamFriends%, steamIDClan%) BS_Friends_GetClanOfficerByIndex%(lpSteamFriends%, steamIDClan%, iOfficer%) +;! Function above returns a CSteamID*, clean it up afterwards! BS_Friends_GetUserRestrictions%(lpSteamFriends%) BS_Friends_SetRichPresence%(lpSteamFriends%, pchKey$, pchValue$) BS_Friends_ClearRichPresence(lpSteamFriends%) @@ -178,12 +201,15 @@ BS_Friends_RequestFriendRichPresence(lpSteamFriends%, steamIDFriend%) BS_Friends_InviteUserToGame%(lpSteamFriends%, steamIDFriend%, pchConnectString%) BS_Friends_GetCoplayFriendCount%(lpSteamFriends%) BS_Friends_GetCoplayFriend%(lpSteamFriends%, iCoplayFriend%) +;! Function above returns a CSteamID*, clean it up afterwards! BS_Friends_GetFriendCoplayTime%(lpSteamFriends%, steamIDFriend%) BS_Friends_GetFriendCoplayGame%(lpSteamFriends%, steamIDFriend%) BS_Friends_JoinClanChatRoom%(lpSteamFriends%, steamIDClan%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_Friends_LeaveClanChatRoom%(lpSteamFriends%, steamIDClan%) BS_Friends_GetClanChatMemberCount%(lpSteamFriends%, steamIDClan%) BS_Friends_GetChatMemberByIndex%(lpSteamFriends%, steamIDClan%, iUser%) +;! Function above returns a CSteamID*, clean it up afterwards! BS_Friends_SendClanChatMessage%(lpSteamFriends%, steamIDClanChat%, pchText$) BS_Friends_GetClanChatMessage%(lpSteamFriends%, steamIDClanChat%, iMessage%, prgchText*, cchTextMax%, peChatEntryType*, psteamidChatter*) BS_Friends_GetClanChatMessageEx%(lpSteamFriends%, steamIDClanChat%, iMessage%, prgchText%, cchTextMax%, peChatEntryType%, psteamidChatter%) : "BS_Friends_GetClanChatMessage" @@ -196,17 +222,21 @@ BS_Friends_ReplyToFriendMessage%(lpSteamFriends%, steamIDFriend%, pchMsgToSend$) BS_Friends_GetFriendMessage%(lpSteamFriends%, steamIDFriend%, iMessageID%, pvData*, cubData%, peChatEntryType*) BS_Friends_GetFriendMessageEx%(lpSteamFriends%, steamIDFriend%, iMessageID%, pvData%, cubData%, peChatEntryType%) : "BS_Friends_GetFriendMessage" BS_Friends_GetFollowerCount%(lpSteamFriends%, steamID%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_Friends_IsFollowing%(lpSteamFriends%, steamID%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_Friends_EnumerateFollowingList%(lpSteamFriends%, unStartIndex%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! ; GameServer ------------------------------------------------------------------ +BS_SteamGameServer_Init%(unIP%, usSteamPort%, usGamePort%, usQueryPort%, eServerMode%, pchVersionString$) +BS_SteamGameServer_Shutdown() +BS_SteamGameServer_RunCallbacks() +BS_SteamGameServer_GetHSteamPipe%() +BS_SteamGameServer_IsSecure%() +BS_SteamGameServer_GetSteamID%() +;! Function above returns a CSteamID*, clean it up afterwards! BS_GameServer%() -BS_GameServer_Init%(unIP%, usSteamPort%, usGamePort%, usQueryPort%, eServerMode%, pchVersionString%) -BS_GameServer_Shutdown() -BS_GameServer_RunCallbacks() -BS_GameServer_GetHSteamPipe%() -BS_GameServer_IsSecureC%() -BS_GameServer_GetSteamIDC%() BS_GameServer_InitGameServer%(pSteamGameServer%, unIP%, usGamePort%, usQueryPort%, unFlags%, nGameAppId%, pchVersionString$) BS_GameServer_SetProduct(pSteamGameServer%, pszProduct$) BS_GameServer_SetGameDescription(pSteamGameServer%, pszGameDescription$) @@ -234,6 +264,7 @@ BS_GameServer_SetRegion(pSteamGameServer%, pszRegion$) BS_GameServer_SendUserConnectAndAuthenticate%(pSteamGameServer%, unIPClient%, pvAuthBlob*, cubAuthBlobSize%, pSteamIDUser%) BS_GameServer_SendUserConnectAndAuthenticateEx%(pSteamGameServer%, unIPClient%, pvAuthBlob%, cubAuthBlobSize%, pSteamIDUser%) : "BS_GameServer_SendUserConnectAndAuthenticate" BS_GameServer_CreateUnauthenticatedUserConnection%(pSteamGameServer%) +;! Function above returns a CSteamID*, clean it up afterwards! BS_GameServer_SendUserDisconnect(pSteamGameServer%, pSteamIDUser%) BS_GameServer_UpdateUserData%(pSteamGameServer%, pSteamIDUser%, pchPlayerName$, uScore%) BS_GameServer_GetAuthSessionTicket%(pSteamGameServer%, pTicket*, cbMaxTicket%, pcbTicket%) @@ -246,6 +277,7 @@ BS_GameServer_UserHasLicenseForApp%(pSteamGameServer%, pSteamID%, appID%) BS_GameServer_RequestUserGroupStatus%(pSteamGameServer%, pSteamIDUser%, pSteamIDGroup%) BS_GameServer_GetGameplayStats(pSteamGameServer%) BS_GameServer_GetServerReputation%(pSteamGameServer%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_GameServer_GetPublicIP%(pSteamGameServer%) BS_GameServer_HandleIncomingPacket%(pSteamGameServer%, pData*, cbData%, srvIP%, srvPort%) BS_GameServer_HandleIncomingPacketEx%(pSteamGameServer%, pData%, cbData%, srvIP%, srvPort%) : "BS_GameServer_HandleIncomingPacket" @@ -255,12 +287,16 @@ BS_GameServer_EnableHeartbeats(pSteamGameServer%, bActive%) BS_GameServer_SetHeartbeatInterval(pSteamGameServer%, iHeartbeatInterval%) BS_GameServer_ForceHeartbeat(pSteamGameServer%) BS_GameServer_AssociateWithClan%(pSteamGameServer%, pSteamIDClan%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_GameServer_ComputeNewPlayerCompatibility%(pSteamGameServer%, pSteamIDNewPlayer%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! ; GameServerStats ------------------------------------------------------------- BS_GameServerStats%() BS_GameServerStats_RequestUserStats%(pSteamGameServerStats%, steamIDUser%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_GameServerStats_StoreUserStats%(pSteamGameServerStats%, steamIDUser%) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! BS_GameServerStats_GetUserStat%(pSteamGameServerStats%, steamIDUser%, pchName$, pData*) BS_GameServerStats_GetUserStatEx%(pSteamGameServerStats%, steamIDUser%, pchName$, pData%) : "BS_GameServerStats_GetUserStat" BS_GameServerStats_GetUserStatF%(pSteamGameServerStats%, steamIDUser%, pchName$, pData*) @@ -270,9 +306,49 @@ BS_GameServerStats_GetUserAchievementEx%(pSteamGameServerStats%, steamIDUser%, p BS_GameServerStats_SetUserStat%(pSteamGameServerStats%, steamIDUser%, pchName%, nData%) BS_GameServerStats_SetUserStatF%(pSteamGameServerStats%, steamIDUser%, pchName%, fData#) BS_GameServerStats_UpdateUserAvgRateStat%(pSteamGameServerStats%, steamIDUser%, pchName$, flCountThisSession#, pdSessionLength%) +;! Function above takes a Double* as last parameter. BS_GameServerStats_SetUserAchievement%(pSteamGameServerStats%, steamIDUser%, pchName$) BS_GameServerStats_ClearUserAchievement%(pSteamGameServerStats%, steamIDUser%, pchName$) +; HTMLSurface ----------------------------------------------------------------- +BS_HTMLSurface%() +BS_HTMLSurface_Init%(pSteamHTMLSurface%) +BS_HTMLSurface_Shutdown%(pSteamHTMLSurface%) +BS_HTMLSurface_CreateBrowser%(pSteamHTMLSurface%, pchUserAgent$, pchUserCSS$) +;! Function above returns a SteamAPICall_t*, clean it up afterwards! +BS_HTMLSurface_RemoveBrowser(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_LoadURL(pSteamHTMLSurface%, unBrowserHandle%, pchURL$, pchPostData$) +BS_HTMLSurface_SetSize(pSteamHTMLSurface%, unBrowserHandle%, unWidth%, unHeight%) +BS_HTMLSurface_StopLoad(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_Reload(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_GoBack(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_GoForward(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_AddHeader(pSteamHTMLSurface%, unBrowserHandle%, pchKey$, pchValue$) +BS_HTMLSurface_ExecuteJavascript(pSteamHTMLSurface%, unBrowserHandle%, pchScript$) +BS_HTMLSurface_MouseUp(pSteamHTMLSurface%, unBrowserHandle%, EMouseButton%) +BS_HTMLSurface_MouseDown(pSteamHTMLSurface%, unBrowserHandle%, EMouseButton%) +BS_HTMLSurface_MouseDoubleClick(pSteamHTMLSurface%, unBrowserHandle%, EMouseButton%) +BS_HTMLSurface_MouseMove(pSteamHTMLSurface%, unBrowserHandle%, X%, Y%) +BS_HTMLSurface_MouseWheel(pSteamHTMLSurface%, unBrowserHandle%, nDelta%) +BS_HTMLSurface_KeyDown(pSteamHTMLSurface%, unBrowserHandle%, nNativeKeyCode%, EHTMLKeyModifiers%) +BS_HTMLSurface_KeyUp(pSteamHTMLSurface%, unBrowserHandle%, nNativeKeyCode%, EHTMLKeyModifiers%) +BS_HTMLSurface_KeyChar(pSteamHTMLSurface%, unBrowserHandle%, cUnicodeChar%, EHTMLKeyModifiers%) +BS_HTMLSurface_SetHorizontalScroll(pSteamHTMLSurface%, unBrowserHandle%, nAbsolutePixelScroll%) +BS_HTMLSurface_SetVerticalScroll(pSteamHTMLSurface%, unBrowserHandle%, nAbsolutePixelScroll%) +BS_HTMLSurface_SetKeyFocus(pSteamHTMLSurface%, unBrowserHandle%, bHasKeyFocus%) +BS_HTMLSurface_ViewSource(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_CopyToClipboard(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_PasteFromClipboard(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_Find(pSteamHTMLSurface%, unBrowserHandle%, pchSearchStr$, bCurrentlyInFind%, bReverse%) +BS_HTMLSurface_StopFind(pSteamHTMLSurface%, unBrowserHandle%) +BS_HTMLSurface_GetLinkAtPosition(pSteamHTMLSurface%, unBrowserHandle%, X%, Y%) +BS_HTMLSurface_SetCookie(pSteamHTMLSurface%, unBrowserHandle%, pchHostname$, pchKey$, pchValue$, pchPath$, nExpires%, bSecure%, bHTTPOnly%) +BS_HTMLSurface_SetPageScaleFactor(pSteamHTMLSurface%, unBrowserHandle%, flZoom#, nPointX%, nPointY%) +BS_HTMLSurface_SetBackgroundMode(pSteamHTMLSurface%, unBrowserHandle%, bBackgroundMode%) +BS_HTMLSurface_AllowStartRequest(pSteamHTMLSurface%, unBrowserHandle%, bAllowed%) +BS_HTMLSurface_JSDialogResponse(pSteamHTMLSurface%, unBrowserHandle%, bResult%) +BS_HTMLSurface_FileLoadDialogResponse(pSteamHTMLSurface%, unBrowserHandle%, pchSelectedFiles%) + ; Networking ------------------------------------------------------------------ BS_Networking%() BS_GameServerNetworking%() @@ -383,8 +459,30 @@ BS_UserStats_GetGlobalStatHistoryLLEx%(lpSteamUserStats, pchStatName$, pData%, c BS_UserStats_GetGlobalStatHistoryD%(lpSteamUserStats, pchStatName$, pData*, cubData%) BS_UserStats_GetGlobalStatHistoryDEx%(lpSteamUserStats, pchStatName$, pData%, cubData%) : "BS_UserStats_GetGlobalStatHistoryD" +; -- Interfaces +BS_HTTP%() +BS_GameServerHTTP%() +BS_Inventory%() +BS_GameServerInventory%() +BS_Matchmaking%() +BS_MatchmakingServers%() +BS_Music%() +BS_MusicRemote%() +BS_RemoteStorage%() +BS_Screenshots%() +BS_UGC%() +BS_GameServerUGC%() +BS_UnifiedMessages%() +BS_Utils%() +BS_GameServerUtils%() +BS_Video%() + ; Helpers --------------------------------------------------------------------- +; -- Generic BS_Helper_FormatUnixTime$(unixTime%, pchFormat$) +BS_Helper_DeleteLong(longlong%) +BS_Helper_CreateDouble%(value#) +BS_Helper_DeleteDouble(pDouble%) ; -- CSteamID BS_CSteamID_New%() BS_CSteamID_FromID%(unAccountID%, eUniverse%, eAccountType%) @@ -425,21 +523,24 @@ BS_CSteamID_SetEUniverse(pSteamID%, eUniverse%) BS_CSteamID_IsValid%(pSteamID%) BS_CSteamID_Compare%(pSteamID%, pSteamIDOther%) ; -- Callbacks -BS_Callback_Create%(pFunction%) +BS_Callback_Create%(pFunctionPointer%) BS_Callback_Destroy%(pCallback%) - - -; -- Interfaces -BS_HTTP%() -BS_HTMLSurface%() -BS_Inventory%() -BS_Matchmaking%() -BS_MatchmakingServers%() -BS_Music%() -BS_MusicRemote%() -BS_RemoteStorage%() -BS_Screenshots%() -BS_UGC%() -BS_UnifiedMessages%() -BS_Utils%() -BS_Video%() \ No newline at end of file +BS_Callback_IsRegistered%(pCallback%) +BS_Callback_IsGameServer%(pCallback%) +BS_Callback_SetGameServerFlag%(pCallback%, bIsGameServer%) +BS_Callback_Register(pCallback%, iCallback%) +BS_Callback_Unregister(pCallback%) +BS_Callback_RegisterResult(pCallback%, pSteamAPICall%) +BS_Callback_UnregisterResult(pCallback%) +; -- Memory +BS_Memory_Alloc%(iSize%) +BS_Memory_ReAlloc%(pMemory%, iSize%) +BS_Memory_Free(pMemory%) +BS_Memory_PeekByte%(pMemory%, offset%) +BS_Memory_PeekShort%(pMemory%, offset%) +BS_Memory_PeekInt%(pMemory%, offset%) +BS_Memory_PeekFloat#(pMemory%, offset%) +BS_Memory_PokeByte(pMemory%, offset%, value%) +BS_Memory_PokeShort(pMemory%, offset%, value%) +BS_Memory_PokeInt(pMemory%, offset%, value%) +BS_Memory_PokeFloat(pMemory%, offset%, value#) \ No newline at end of file diff --git a/Blitz/BlitzSteam.ipf b/Blitz/BlitzSteam.ipf new file mode 100644 index 0000000..9e42b06 --- /dev/null +++ b/Blitz/BlitzSteam.ipf @@ -0,0 +1,17 @@ +[IDEal Project file] + + Version="1" + Expanded="True" + Icon="" + MainFile="HTMLSurface_Example.bb" + Compiler="Blitz3D" + CommandLine="" + + + AbsPath="\Examples" Expanded="True" + + + AbsPath="\BlitzSteam.bb" PrjFolder="" Line="0" Column="0" Tip="0" Visible="False" + AbsPath="\BlitzSteamUtility.bb" PrjFolder="" Line="0" Column="0" Tip="0" Visible="False" + AbsPath="\HTMLSurface_Example.bb" PrjFolder="\Examples" Line="0" Column="0" Tip="0" Visible="False" + diff --git a/Blitz/BlitzSteamUtility.bb b/Blitz/BlitzSteamUtility.bb index e663fa5..c8b8a40 100644 --- a/Blitz/BlitzSteamUtility.bb +++ b/Blitz/BlitzSteamUtility.bb @@ -14,130 +14,61 @@ ; You should have received a copy of the GNU Lesser General Public License ; along with this program. If not, see . -;---------------------------------------------------------------- -; -- Constants -;---------------------------------------------------------------- +;------------------------------------------------------------------------------ +;! Constants +;------------------------------------------------------------------------------ Const BSU_NAME_LENGTH = 4096 Const BSU_INSTALLDIR_LENGTH = 4096 Const BSU_APPID_COUNT = 4096 Const BSU_INSTALLEDDEPOTS_COUNT = 4096 -;---------------------------------------------------------------- -; -- Globals -;---------------------------------------------------------------- +;------------------------------------------------------------------------------ +;! Globals +;------------------------------------------------------------------------------ Global BSU_Initialized = False Global BSU_IsSteamRunning% = False ; -- Interfaces -Global BSU_AppList%, BSU_Apps%, BSU_Client%, BSU_Controller% -Global BSU_Friends%, BSU_HTTP%, BSU_HTMLSurface%, BSU_Inventory% -Global BSU_Matchmaking%, BSU_MatchmakingServers%, BSU_Music% -Global BSU_MusicRemote%, BSU_Networking%, BSU_RemoteStorage% -Global BSU_Screenshots%, BSU_UGC%, BSU_UnifiedMessages%, BSU_User% -Global BSU_UserStats%, BSU_Utils%, BSU_Video% +Global BSU_AppList% +Global BSU_Apps% +Global BSU_Client% +Global BSU_Controller% +Global BSU_Friends% +Global BSU_GameServer% +Global BSU_GameServerStats% +Global BSU_HTMLSurface% +Global BSU_HTTP% +Global BSU_Inventory% +Global BSU_Matchmaking% +Global BSU_MatchmakingServers% +Global BSU_Music% +Global BSU_MusicRemote% +Global BSU_Networking% +Global BSU_RemoteStorage% +Global BSU_Screenshots% +Global BSU_UGC% +Global BSU_UnifiedMessages% +Global BSU_User% +Global BSU_UserStats% +Global BSU_Utils% +Global BSU_Video% -;---------------------------------------------------------------- -; -- 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_Friend - Field SteamID_L, SteamID_R - - Field Name$ - Field NickName$ - - Field Index% - Field Relationship% - Field State% - Field SteamLevel% -End Type - -;---------------------------------------------------------------- -; -- Globals -;---------------------------------------------------------------- -Global BSU_AppCount -Global BSU_DLCCount -Global BSU_DepotCount -Global BSU_FriendCount - -;---------------------------------------------------------------- -; -- 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%, Len%=-1) - 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 And Len = -1) Or (Pos > Len) Then - Exit - Else - OutStr=OutStr+Chr(Value) - EndIf - Next - Return OutStr - EndIf -End Function - -; -- Steam +;[Block] API: Steam +;------------------------------------------------------------------------------ +;! API: Steam +;------------------------------------------------------------------------------ Function BSU_Init() BSU_IsSteamRunning = BS_Steam_IsSteamRunning() - If BSU_IsSteamRunning Then - BS_Steam_Init() + If BSU_IsSteamRunning And BS_Steam_Init() Then BSU_AppList = BS_AppList() BSU_Apps = BS_Apps() BSU_Client = BS_Client() BSU_Controller = BS_Controller() BSU_Friends = BS_Friends() - BSU_HTTP = BS_HTTP() + BSU_GameServer = BS_GameServer() + BSU_GameServerStats = BS_GameServerStats() BSU_HTMLSurface = BS_HTMLSurface() + BSU_HTTP = BS_HTTP() BSU_Inventory = BS_Inventory() BSU_Matchmaking = BS_Matchmaking() BSU_MatchmakingServers = BS_MatchmakingServers() @@ -159,15 +90,18 @@ End Function Function BSU_Shutdown() If BSU_IsSteamRunning + BS_GameServer_Shutdown() BS_Steam_Shutdown() + BSU_AppList=0 BSU_Apps=0 BSU_Client=0 BSU_Controller=0 BSU_Friends=0 + BSU_GameServer=0 + BSU_GameServerStats=0 BSU_HTTP=0 BSU_HTMLSurface=0 - BSU_Initialized=0 BSU_Matchmaking=0 BSU_MatchmakingServers=0 BSU_Music=0 @@ -185,8 +119,19 @@ Function BSU_Shutdown() BSU_Initialized = False EndIf End Function +;[End Block] + +;[Block] API: AppList +;------------------------------------------------------------------------------ +;! API: AppList +;------------------------------------------------------------------------------ +Type BSU_App + Field AppId% + Field Name$ + Field InstallDir$ +End Type +Global BSU_AppCount = 0 -; -- AppList Function BSU_AppList_GetInstalledApps(BankAppIdsStorage=0, BankAppNameStorage=0, BankAppInstallDirStorage=0) Local BankAppIds, BankAppIdsSz = BSU_APPID_COUNT Local BankAppName, BankAppNameSz = BSU_NAME_LENGTH @@ -240,11 +185,11 @@ Function BSU_AppList_GetInstalledApps(BankAppIdsStorage=0, BankAppNameStorage=0, ; Free temporary storage for name and installdir. If BankAppInstallDirStorage = 0 Then FreeBank BankAppInstallDir - If BankAppNameStorage = 0 FreeBank BankAppName + If BankAppNameStorage = 0 Then FreeBank BankAppName EndIf - + ; Free temporary storage for AppIds. - If BankAppIdsStorage = 0 FreeBank BankAppIds + If BankAppIdsStorage = 0 Then FreeBank BankAppIds EndIf End Function @@ -303,8 +248,24 @@ Function BSU_AppList_GetInstallDir$(AppID%, BankStorage=0) ; Return name read. Return AppInstallDir End Function +;[End Block] + +;[Block] API: Apps +;------------------------------------------------------------------------------ +;! API: Apps +;------------------------------------------------------------------------------ +Type BSU_DLC + Field AppId% + Field Available% + Field Name$ +End Type +Global BSU_DLCCount + +Type BSU_Depot + Field DepotId% +End Type +Global BSU_DepotCount -; -- SteamApps Function BSU_Apps_GetDLCData(BankAppIdStorage=0, BankAvailableStorage=0, BankNameStorage=0) Local BankAppId%, BankAvailable% Local BankName%, BankNameSz% = BSU_NAME_LENGTH @@ -516,9 +477,26 @@ Function BSU_Apps_GetDLCDownloadProgress#(nAppID%) EndIf Return Progress End Function +;[End Block] -; -- SteamFriends -Function BSU_Friends_GetFriends(iFriendFlags=BS_EFriendFlags_All) +;[Block] API: Apps +;------------------------------------------------------------------------------ +;! API: Friends +;------------------------------------------------------------------------------ +Type BSU_Friend + Field SteamID_L, SteamID_R + + Field Name$ + Field NickName$ + + Field Index% + Field Relationship% + Field State% + Field SteamLevel% +End Type +Global BSU_FriendCount + +Function BSU_Friends_GetFriends(iFriendFlags = BS_EFriendFlags_All) If BSU_Initialized Then Delete Each BSU_Friend @@ -551,6 +529,100 @@ Function BSU_Friends_GetFriends(iFriendFlags=BS_EFriendFlags_All) EndIf End Function +;[Block] API: GameServer +;------------------------------------------------------------------------------ +;! API: GameServer +;------------------------------------------------------------------------------ +Function BSU_GameServer_Init(IPv4%=0, Port%=27015, SteamPort%=27016, QueryPort=27017, ServerMode=BS_EServerMode_AuthenticationAndSecure, Version$="1.0.0.0") + If BS_GameServer_Init(IPv4, SteamPort, Port, QueryPort, ServerMode, Version) Then + BSU_GameServer = BS_GameServer() + BSU_GameServerStats = BS_GameServerStats() + BSU_HTTP = BS_GameServerHTTP() + BSU_Inventory = BS_GameServerInventory() + BSU_Networking = BS_GameServerNetworking() + BSU_UGC = BS_GameServerUGC() + BSU_Utils = BS_GameServerUtils() + + BSU_Initialized = True + EndIf +End Function + +Function BSU_GameServer_Shutdown() + If BSU_Initialized = True + BS_GameServer_Shutdown() + + BSU_GameServer=0 + BSU_GameServerStats=0 + BSU_HTTP=0 + BSU_Inventory=0 + BSU_Networking=0 + BSU_UGC=0 + BSU_Utils=0 + + BSU_Initialized = False + EndIf +End Function +;[End Block] + +;------------------------------------------------------------------------------ +;! API: GameServerStats +;------------------------------------------------------------------------------ + + + +;[Block] Blitz Stuff +;---------------------------------------------------------------- +;! Blitz Stuff +;---------------------------------------------------------------- +; -- 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%, Len%=-1) + 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 And Len = -1) Or (Pos > Len) Then + Exit + Else + OutStr=OutStr+Chr(Value) + EndIf + Next + Return OutStr + EndIf +End Function +;[End Block] + ;~IDEal Editor Parameters: -;~F#52#67#BD#FA#116#133#163#195#1B1#1D0 +;~F#3A#5A#7F#86#C3#DF#100#107#10C#13C#16E#18A#1A9#1C4 ;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/HTMLSurface_Example.bb b/Blitz/HTMLSurface_Example.bb new file mode 100644 index 0000000..0ca704f --- /dev/null +++ b/Blitz/HTMLSurface_Example.bb @@ -0,0 +1,268 @@ +Include "BlitzSteam.bb" + +;---------------------------------------------------------------- +;! Steam Stuff +;---------------------------------------------------------------- + +; SteamClient: WarningMessageHook +Global Steam_WarningMessageHook_Callback = 0 +Function Steam_WarningMessageHook(bIsWarning%, pchMessageBuffer%) + If Steam_WarningMessageHook_Callback = 0 Then + Steam_WarningMessageHook_Callback = BP_GetFunctionPointer() + Return + EndIf + + ; Read Message from buffer + Local msg$ = "" + If bIsWarning = 1 Then + msg = "[Warning]" + Else + msg = "[Info]" + EndIf + msg = msg + PeekMemoryStringC(pchMessageBuffer) + + DebugLog "[Steam]" + msg$ +End Function:Steam_WarningMessageHook(0, 0) +Function PeekMemoryStringC(Memory%, Length%=-1) + Local Ptr = Memory + Local iChar = 0, tiChar = 0 + Local sOut$ = "" + + Repeat + tiChar = PeekMemoryByte(Ptr) + + ; Advance memory, decrease Length + Ptr = Ptr + 1 + Length = Length - 1 + + If (tiChar = 0) Then + Length = 0 + Else + sOut = sOut + Chr(tiChar) + EndIf + Until Length = 0 + + Return sOut +End Function + +;---------------------------------------------------------------- +;! Blitz Browser Wrapper (Image based) +;---------------------------------------------------------------- +Type Browser + Field Id% + + Field ImageHandle%, ImageSize[2] + + ; Internal Steam + Field z_llSteamAPICall% +End Type + +Global Browser_HTMLSurface_BrowserReady_p = 0, Browser_HTMLSurface_BrowserReady_c = 0 +Function Browser_HTMLSurface_BrowserReady(pvParam%, bIOFailure, llSteamAPICall) + If (Browser_HTMLSurface_BrowserReady_p = 0) Then + Browser_HTMLSurface_BrowserReady_p = BP_GetFunctionPointer() + Browser_HTMLSurface_BrowserReady_c = BS_Callback_Create(Browser_HTMLSurface_BrowserReady_p) + Return + EndIf + + DebugLog "HTMLSurface_BrowserReady" + + Local Browser.Browser = Browser_FindBySteamAPICall(llSteamAPICall) + Browser\Id = PeekMemoryInt(pvParam) + Browser_LoadURL(Browser, "http://google.com/") + Browser_SetSize(Browser, Browser\ImageSize[0], Browser\ImageSize[1]) + + ; Cleanup + BS_Helper_DeleteLong(Browser\z_llSteamAPICall):Browser\z_llSteamAPICall = 0 + BS_Callback_UnregisterResult Browser_HTMLSurface_BrowserReady_c ; Caller does this too. +End Function:Browser_HTMLSurface_BrowserReady(0, 0, 0) + +Global Browser_HTMLSurface_NeedsPaint_p = 0, Browser_HTMLSurface_NeedsPaint_c = 0 +Function Browser_HTMLSurface_NeedsPaint(pvParam%) + If (Browser_HTMLSurface_NeedsPaint_p = 0) Then + Browser_HTMLSurface_NeedsPaint_p = BP_GetFunctionPointer() + Browser_HTMLSurface_NeedsPaint_c = BS_Callback_Create(Browser_HTMLSurface_NeedsPaint_p) + Return + EndIf + + DebugLog "HTMLSurface_NeedsPaint" + + Local Browser.Browser = Browser_FindById(PeekMemoryInt(pvParam)) + + ; Paint logic + ;CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint + ;CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called + ;CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture + ;CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture + ;CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update + ;CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update + ;CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update + ;CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update + ;CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered + ;CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered + ;CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered + ;CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages + +End Function:Browser_HTMLSurface_NeedsPaint(0) + +Global Browser_HTMLSurface_StartRequest_p = 0, Browser_HTMLSurface_StartRequest_c = 0 +Function Browser_HTMLSurface_StartRequest(pvParam%) + If (Browser_HTMLSurface_StartRequest_p = 0) Then + Browser_HTMLSurface_StartRequest_p = BP_GetFunctionPointer() + Browser_HTMLSurface_StartRequest_c = BS_Callback_Create(Browser_HTMLSurface_StartRequest_p) + Return + EndIf + + DebugLog "HTMLSurface_StartRequest" + + ; Default to allow all requests. (Why not? For an Example, this is good enough.) + BS_HTMLSurface_AllowStartRequest BS_HTMLSurface(), PeekMemoryInt(pvParam), True +End Function:Browser_HTMLSurface_StartRequest(0) + + +Function Browser_Create.Browser(Width%, Height, UserAgent$="BlitzSteam", UserCSS$="") + DebugLog "[Browser::Create] Creating with UserAgent '"+UserAgent+"' and CSS '"+UserCSS+"'." + + ; Register Callbacks (Can do this in an Init function too) + BS_Callback_Register Browser_HTMLSurface_BrowserReady_c, BS_HTMLSurface_BrowserReady + BS_Callback_Register Browser_HTMLSurface_NeedsPaint_c, BS_HTMLSurface_NeedsPaint + BS_Callback_Register Browser_HTMLSurface_StartRequest_c, BS_HTMLSurface_StartRequest + + ; Create Browser Object + Local Browser.Browser = New Browser + Browser\z_llSteamAPICall = BS_HTMLSurface_CreateBrowser(BS_HTMLSurface(), UserAgent, UserCSS) + Browser\ImageSize[0] = Width + Browser\ImageSize[1] = Height + + ; Register CallResult + BS_Callback_RegisterResult Browser_HTMLSurface_BrowserReady_c, Browser\z_llSteamAPICall + + Return Browser +End Function + +Function Browser_IsReady(Browser.Browser) + If Browser = Null Then Return False + + DebugLog "[Browser::IsReady] Checking if '"+Browser\Id+"'/'"+Browser\z_llSteamAPICall+"' is ready." + + Return (Browser\Id <> 0) +End Function + +Function Browser_FindById.Browser(Id%) + If Id = 0 Then Return Null ; 0 is not a valid Browser Handle. + + DebugLog "[Browser::FindById] Finding by Id '"+Id+"." + + Local Browser.Browser + For Browser = Each Browser + If Browser\Id = Id Then Return Browser + Next + + Return Null +End Function + +Function Browser_FindBySteamAPICall.Browser(llSteamAPICall%) + If llSteamAPICall = 0 Then Return Null ; 0 is not a valid SteamAPICall. + + DebugLog "[Browser::FindBySteamAPICall] Finding by SteamAPICall '"+llSteamAPICall+"." + + Local Browser.Browser + For Browser = Each Browser + If Browser\z_llSteamAPICall = llSteamAPICall Then Return Browser + Next + + Return Null +End Function + +Function Browser_Destroy.Browser(Browser.Browser) + If Browser = Null Then Return Null + + DebugLog "[Browser::Destroy] Destroying '"+Browser\Id+"'." + + BS_HTMLSurface_RemoveBrowser BS_HTMLSurface(), Browser\Id + Delete Browser:Return Null +End Function + +Function Browser_SetSize(Browser.Browser, Width%, Height%) + If Browser = Null Then Return + + DebugLog "[Browser::SetSize] Resizing '"+Browser\Id+"' to "+Width+"x"+Height+"." + + ; Free old Image + If (Browser\ImageHandle <> 0) Then + FreeImage(Browser\ImageHandle) + EndIf + + ; Create new Image + Browser\ImageHandle = CreateImage(Width%, Height%) + Browser\ImageSize[0] = Width + Browser\ImageSize[1] = Height + + BS_HTMLSurface_SetSize BS_HTMLSurface(), Browser\Id, Width, Height +End Function + +Function Browser_GetHandle(Browser.Browser) + Return Browser\ImageHandle +End Function + +Function Browser_LoadURL(Browser.Browser, URL$, PostData$="") + If Browser = Null Then Return + + DebugLog "[Browser::SetSize] Browser '"+Browser\Id+"' is loading URL '"+URL+"'." + + BS_HTMLSurface_LoadURL BS_HTMLSurface(), Browser\Id, URL, PostData +End Function + +;---------------------------------------------------------------- +;! Example Code +;---------------------------------------------------------------- +If BS_Steam_Init() = 0 Then RuntimeError "Steam failed to initialize." + +; Steam: Hooks, Callbacks, CallResults +BS_Client_SetWarningMessageHook BS_Client(), Steam_WarningMessageHook_Callback + +; Steam: HTMLSurface API +If BS_HTMLSurface() = 0 Then RuntimeError "Steam: HTMLSurface API is not available." +If BS_HTMLSurface_Init(BS_HTMLSurface()) = 0 Then RuntimeError "Steam: HTMLSurface API did not want to be initialized?!" +BS_HTMLSurface_SetSize BS_HTMLSurface(), 0, GraphicsWidth(), GraphicsHeight() + +; Scene Setup +Graphics3D 1024, 768, 32, 2:SetBuffer BackBuffer() + +; Create a Browser +Local myBrowser.Browser = Browser_Create(512, 512) + +While Not Browser_IsReady(myBrowser) + BS_Steam_RunCallbacks() + Delay 100 +Wend + +While Not KeyHit(1) + Cls + + ; Steam: Run any Callbacks + ; Q: Why before RenderWorld/Flip? + ; A: If we did any changes, having them available before Rendering helps responsiveness. + ; A one-frame Delay is noticeable, even to people claiming the eye only sees 30 fps. + ; Please read a Biology book if you are one of those, it doesn't work like that. + BS_Steam_RunCallbacks() + + RenderWorld + + DrawImage Browser_GetHandle(myBrowser), 0, 0, 0 + + Flip +Wend + +; Destroy existing Browser +myBrowser = Browser_Destroy(myBrowser) + +; Steam: HTMLSurface API +BS_HTMLSurface_Shutdown(BS_HTMLSurface()) + +EndGraphics +End + +;~IDEal Editor Parameters: +;~F#8#19#3C#50 +;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/steam_appid.txt b/Blitz/steam_appid.txt new file mode 100644 index 0000000..37f10e0 --- /dev/null +++ b/Blitz/steam_appid.txt @@ -0,0 +1 @@ +368720 \ No newline at end of file diff --git a/BlitzSteam.h b/BlitzSteam.h index e6f913f..6e0c8f9 100644 --- a/BlitzSteam.h +++ b/BlitzSteam.h @@ -32,9 +32,3 @@ // Steam #include "SteamworksSDK/public/steam/steam_api.h" #include "SteamworksSDK/public/steam/steam_gameserver.h" - -// Steam Helper Classes and Functions -#include "Helpers/BlitzPointer.h" -#include "Helpers/Callbacks.h" -#include "Helpers/CSteamID.h" -#include "Helpers/Helper.h" diff --git a/BlitzSteam.vcxproj b/BlitzSteam.vcxproj index f603864..0a85d9c 100644 --- a/BlitzSteam.vcxproj +++ b/BlitzSteam.vcxproj @@ -135,7 +135,7 @@ None - false + No false @@ -155,8 +155,9 @@ - + + @@ -169,7 +170,7 @@ - + @@ -185,9 +186,10 @@ - + + diff --git a/BlitzSteam.vcxproj.filters b/BlitzSteam.vcxproj.filters index 61149f6..6f33e01 100644 --- a/BlitzSteam.vcxproj.filters +++ b/BlitzSteam.vcxproj.filters @@ -50,9 +50,6 @@ Source Files\Wrapper - - Source Files\Wrapper - Source Files\Wrapper @@ -95,20 +92,23 @@ Source Files\Helpers - - Source Files\Helpers - Source Files Source Files\Helpers + + Source Files\Wrapper + + + Source Files\Helpers + + + Source Files\Helpers + - - Source Files\Helpers - Source Files\Helpers @@ -121,6 +121,12 @@ Source Files\Helpers + + Source Files\Helpers + + + Source Files\Helpers + @@ -129,13 +135,13 @@ Blitz Files - - Blitz Files - Blitz Files + + Blitz Files + \ No newline at end of file diff --git a/Helpers/BlitzCallback.cpp b/Helpers/BlitzCallback.cpp new file mode 100644 index 0000000..e137f5b --- /dev/null +++ b/Helpers/BlitzCallback.cpp @@ -0,0 +1,131 @@ +// BlitzSteam - Steam wrapper for Blitz +// Copyright (C) 2015 Xaymar (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 . + +#include "BlitzCallback.h" + +BlitzCallback::BlitzCallback(BP_Function3_t pFunctionPointer) { + this->m_pFunctionPointer = pFunctionPointer; +} + +BlitzCallback::~BlitzCallback() { + this->Unregister(); + this->UnregisterResult(); +} + +int BlitzCallback::GetCallbackSizeBytes() { + return sizeof(BlitzCallback); +} + +void BlitzCallback::Run(void *pvParam) { + if (this->m_hSteamAPICall != 0) + this->m_hSteamAPICall = 0; // Caller unregisters for us. + + BP_CallFunction3(m_pFunctionPointer, reinterpret_cast(pvParam), 0, 0); +} + +void BlitzCallback::Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall) { + if (this->m_hSteamAPICall != 0) + this->m_hSteamAPICall = 0; // Caller unregisters for us. + + BP_CallFunction3(m_pFunctionPointer, reinterpret_cast(pvParam), (uint32_t)bIOFailure, (uint32_t)&hSteamAPICall); +} + +bool BlitzCallback::IsRegistered() { + return (this->m_nCallbackFlags & this->k_ECallbackFlagsRegistered) != 0; +} + +void BlitzCallback::Register(uint32_t iCallback) { + if (!this->IsRegistered()) + SteamAPI_RegisterCallback(this, iCallback); +} + +void BlitzCallback::Unregister() { + if (this->IsRegistered()) + SteamAPI_UnregisterCallback(this); +} + +void BlitzCallback::RegisterResult(SteamAPICall_t hSteamAPICall) { + if (this->m_hSteamAPICall == 0) { + SteamAPI_RegisterCallResult(this, hSteamAPICall); + this->m_hSteamAPICall = hSteamAPICall; + } +} + +void BlitzCallback::UnregisterResult() +{ + if (this->m_hSteamAPICall != 0) { + SteamAPI_UnregisterCallResult(this, this->m_hSteamAPICall); + this->m_hSteamAPICall = 0; + } +} + +bool BlitzCallback::IsGameServer() { + return (this->m_nCallbackFlags & this->k_ECallbackFlagsGameServer) != 0; +} + +void BlitzCallback::SetGameServer(bool bIsGameServer) { + this->m_nCallbackFlags &= ~k_ECallbackFlagsGameServer; + if (bIsGameServer) + this->m_nCallbackFlags |= k_ECallbackFlagsGameServer; +} + +// DLL-Callables +DLL_FUNCTION(BlitzCallback*) BS_Callback_Create(BP_Function3_t pFunctionPointer) { +#pragma comment(linker, "/EXPORT:BS_Callback_Create=_BS_Callback_Create@4") + return new BlitzCallback(pFunctionPointer); +} + +DLL_FUNCTION(void) BS_Callback_Destroy(BlitzCallback* pCallback) { +#pragma comment(linker, "/EXPORT:BS_Callback_Destroy=_BS_Callback_Destroy@4") + delete pCallback; +} + +DLL_FUNCTION(int32_t) BS_Callback_IsRegistered(BlitzCallback* pCallback) { +#pragma comment(linker, "/EXPORT:BS_Callback_IsRegistered=_BS_Callback_IsRegistered@4") + return pCallback->IsRegistered(); +} + +DLL_FUNCTION(int32_t) BS_Callback_IsGameServer(BlitzCallback* pCallback) { +#pragma comment(linker, "/EXPORT:BS_Callback_IsGameServer=_BS_Callback_IsGameServer@4") + return pCallback->IsGameServer(); +} + +DLL_FUNCTION(int32_t) BS_Callback_SetGameServerFlag(BlitzCallback* pCallback, int32_t bIsGameServer) { +#pragma comment(linker, "/EXPORT:BS_Callback_SetGameServerFlag=_BS_Callback_SetGameServerFlag@8") + bool isGameServer = pCallback->IsGameServer(); + pCallback->SetGameServer(!!bIsGameServer); + return isGameServer; +} + +DLL_FUNCTION(void) BS_Callback_Register(BlitzCallback* pCallback, uint32_t iCallback) { +#pragma comment(linker, "/EXPORT:BS_Callback_Register=_BS_Callback_Register@8") + pCallback->Register(iCallback); +} + +DLL_FUNCTION(void) BS_Callback_Unregister(BlitzCallback* pCallback) { +#pragma comment(linker, "/EXPORT:BS_Callback_Unregister=_BS_Callback_Unregister@4") + pCallback->Unregister(); +} + +DLL_FUNCTION(void) BS_Callback_RegisterResult(BlitzCallback* pCallback, SteamAPICall_t* pSteamAPICall) { +#pragma comment(linker, "/EXPORT:BS_Callback_RegisterResult=_BS_Callback_RegisterResult@8") + pCallback->RegisterResult(*pSteamAPICall); +} + +DLL_FUNCTION(void) BS_Callback_UnregisterResult(BlitzCallback* pCallback) { +#pragma comment(linker, "/EXPORT:BS_Callback_UnregisterResult=_BS_Callback_UnregisterResult@4") + pCallback->UnregisterResult(); +} \ No newline at end of file diff --git a/Helpers/BlitzCallback.h b/Helpers/BlitzCallback.h new file mode 100644 index 0000000..f3faef8 --- /dev/null +++ b/Helpers/BlitzCallback.h @@ -0,0 +1,55 @@ +// BlitzSteam - Steam wrapper for Blitz +// Copyright (C) 2015 Xaymar (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 . + +#pragma once +#include "BlitzSteam.h" +#include "BlitzPointer.h" + +class BlitzCallback : public CCallbackBase { + public: + BlitzCallback(BP_Function3_t pFunctionPointer); + ~BlitzCallback(); + + virtual void Run(void *pvParam); + virtual void Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall); + virtual int GetCallbackSizeBytes(); + + bool IsRegistered(); + bool IsGameServer(); + void SetGameServer(bool bIsGameServer); + + void Register(uint32_t iCallback); + void Unregister(); + + void RegisterResult(SteamAPICall_t hSteamAPICall); + void UnregisterResult(); + + private: + BP_Function3_t m_pFunctionPointer; + SteamAPICall_t m_hSteamAPICall; +}; + +DLL_FUNCTION(BlitzCallback*) BS_Callback_Create(BP_Function3_t pFunctionPointer); +DLL_FUNCTION(void) BS_Callback_Destroy(BlitzCallback* pCallback); + +DLL_FUNCTION(int32_t) BS_Callback_IsRegistered(BlitzCallback* pCallback); +DLL_FUNCTION(int32_t) BS_Callback_IsGameServer(BlitzCallback* pCallback); +DLL_FUNCTION(int32_t) BS_Callback_SetGameServerFlag(BlitzCallback* pCallback, int32_t isGameServer); + +DLL_FUNCTION(void) BS_Callback_Register(BlitzCallback* pCallback, uint32_t iCallback); +DLL_FUNCTION(void) BS_Callback_Unregister(BlitzCallback* pCallback); +DLL_FUNCTION(void) BS_Callback_RegisterResult(BlitzCallback* pCallback, SteamAPICall_t* pSteamAPICall); +DLL_FUNCTION(void) BS_Callback_UnregisterResult(BlitzCallback* pCallback); \ No newline at end of file diff --git a/Helpers/Callbacks.cpp b/Helpers/Callbacks.cpp deleted file mode 100644 index 5fe1ab5..0000000 --- a/Helpers/Callbacks.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// BlitzSteam - Steam wrapper for Blitz -// Copyright (C) 2015 Xaymar (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 . - -#include "Callbacks.h" - -// Callbacks -void BS_Callback::Run(void *pvParam) { - BP_CallFunction3(bbRunFunction, reinterpret_cast(pvParam), 0, 0); -} - -void BS_Callback::Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall) { - BP_CallFunction3(bbRunFunction, reinterpret_cast(pvParam), (uint32_t)bIOFailure, reinterpret_cast(&hSteamAPICall)); -} - -int BS_Callback::GetCallbackSizeBytes() { - return sizeof(BS_Callback); -} - -// DLL-Callables -DLL_FUNCTION(BS_Callback*) BS_Callback_Create(uint32_t fpFunctionPointer) { - BS_Callback* lpCallback = new BS_Callback(); - lpCallback->bbRunFunction = (void*)fpFunctionPointer; - return lpCallback; -} -#pragma comment(linker, "/EXPORT:BS_Callback_Create=_BS_Callback_Create@4") - -DLL_FUNCTION(void) BS_Callback_Destroy(BS_Callback* lpCallback) { - if (lpCallback != nullptr) { - delete lpCallback; - } -} -#pragma comment(linker, "/EXPORT:BS_Callback_Destroy=_BS_Callback_Destroy@4") \ No newline at end of file diff --git a/Helpers/Callbacks.h b/Helpers/Callbacks.h deleted file mode 100644 index da20291..0000000 --- a/Helpers/Callbacks.h +++ /dev/null @@ -1,29 +0,0 @@ -// BlitzSteam - Steam wrapper for Blitz -// Copyright (C) 2015 Xaymar (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 . - -#pragma once -#include "BlitzSteam.h" - -class BS_Callback : CCallbackBase { - public: - void* bbRunFunction; - virtual void Run(void *pvParam); - virtual void Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall); - virtual int GetCallbackSizeBytes(); -}; - -DLL_FUNCTION(BS_Callback*) BS_Callback_Create(uint32_t fpFunctionPointer); -DLL_FUNCTION(void) BS_Callback_Destroy(BS_Callback* lpCallback); \ No newline at end of file diff --git a/Helpers/Helper.cpp b/Helpers/Helper.cpp index af2679e..f5adecb 100644 --- a/Helpers/Helper.cpp +++ b/Helpers/Helper.cpp @@ -17,6 +17,7 @@ #include "Helper.h" DLL_FUNCTION(const char*) BS_Helper_FormatUnixTime(uint32_t unTime, const char* pchFormat) { +#pragma comment(linker, "/EXPORT:BS_Helper_FormatUnixTime=_BS_Helper_FormatUnixTime@8") char* output = new char[strlen(pchFormat) * 4]; time_t t = unTime; struct tm *tm = localtime(&t); @@ -24,4 +25,18 @@ DLL_FUNCTION(const char*) BS_Helper_FormatUnixTime(uint32_t unTime, const char* delete tm; return output; } -#pragma comment(linker, "/EXPORT:BS_Helper_FormatUnixTime=_BS_Helper_FormatUnixTime@8") + +DLL_FUNCTION(void) BS_Helper_DeleteLong(uint64_t* pLong) { +#pragma comment(linker, "/EXPORT:BS_Helper_DeleteLong=_BS_Helper_DeleteLong@4") + delete pLong; +} + +DLL_FUNCTION(double_t*) BS_Helper_CreateDouble(float_t value) { +#pragma comment(linker, "/EXPORT:BS_Helper_CreateDouble=_BS_Helper_CreateDouble@4") + return new double_t(value); +} + +DLL_FUNCTION(void) BS_Helper_DeleteDouble(double_t* pDouble) { +#pragma comment(linker, "/EXPORT:BS_Helper_DeleteDouble=_BS_Helper_DeleteDouble@4") + delete pDouble; +} \ No newline at end of file diff --git a/Helpers/Memory.cpp b/Helpers/Memory.cpp new file mode 100644 index 0000000..91b0cc6 --- /dev/null +++ b/Helpers/Memory.cpp @@ -0,0 +1,72 @@ +// BlitzSteam - Steam wrapper for Blitz +// Copyright (C) 2015 Xaymar (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 . + +#include "Memory.h" + +DLL_FUNCTION(void*) BS_Memory_Alloc(uint32_t iSize) { +#pragma comment(linker, "/EXPORT:BS_Memory_Alloc=_BS_Memory_Alloc@4") + return malloc(iSize); +} + +DLL_FUNCTION(void*) BS_Memory_ReAlloc(void* pMemory, uint32_t iNewSize) { +#pragma comment(linker, "/EXPORT:BS_Memory_ReAlloc=_BS_Memory_ReAlloc@8") + return realloc(pMemory, iNewSize); +} + +DLL_FUNCTION(void) BS_Memory_Free(void* pMemory) { +#pragma comment(linker, "/EXPORT:BS_Memory_Free=_BS_Memory_Free@4") + free(pMemory); +} + +DLL_FUNCTION(uint8_t) BS_Memory_PeekByte(void* pMemory, uint32_t offset) { +#pragma comment(linker, "/EXPORT:BS_Memory_PeekByte=_BS_Memory_PeekByte@8") + return *(reinterpret_cast(pMemory) + offset); +} + +DLL_FUNCTION(uint16_t) BS_Memory_PeekShort(void* pMemory, uint32_t offset) { +#pragma comment(linker, "/EXPORT:BS_Memory_PeekShort=_BS_Memory_PeekShort@8") + return *(uint16_t*)(reinterpret_cast(pMemory) + offset); +} + +DLL_FUNCTION(uint32_t) BS_Memory_PeekInt(void* pMemory, uint32_t offset) { +#pragma comment(linker, "/EXPORT:BS_Memory_PeekInt=_BS_Memory_PeekInt@8") + return *(uint32_t*)(reinterpret_cast(pMemory) + offset); +} + +DLL_FUNCTION(float_t) BS_Memory_PeekFloat(void* pMemory, uint32_t offset) { +#pragma comment(linker, "/EXPORT:BS_Memory_PeekFloat=_BS_Memory_PeekFloat@8") + return *(float_t*)(reinterpret_cast(pMemory) + offset); +} + +DLL_FUNCTION(void) BS_Memory_PokeByte(void* pMemory, uint32_t offset, uint8_t value) { +#pragma comment(linker, "/EXPORT:BS_Memory_PokeByte=_BS_Memory_PokeByte@12") + *((reinterpret_cast(pMemory) + offset)) = value; +} + +DLL_FUNCTION(void) BS_Memory_PokeShort(void* pMemory, uint32_t offset, uint16_t value) { +#pragma comment(linker, "/EXPORT:BS_Memory_PokeShort=_BS_Memory_PokeShort@12") + *(reinterpret_cast(reinterpret_cast(pMemory) + offset)) = value; +} + +DLL_FUNCTION(void) BS_Memory_PokeInt(void* pMemory, uint32_t offset, uint32_t value) { +#pragma comment(linker, "/EXPORT:BS_Memory_PokeInt=_BS_Memory_PokeInt@12") + *(reinterpret_cast(reinterpret_cast(pMemory) + offset)) = value; +} + +DLL_FUNCTION(void) BS_Memory_PokeFloat(void* pMemory, uint32_t offset, float_t value) { +#pragma comment(linker, "/EXPORT:BS_Memory_PokeFloat=_BS_Memory_PokeFloat@12") + *(reinterpret_cast(reinterpret_cast(pMemory) + offset)) = value; +} \ No newline at end of file diff --git a/Helpers/Memory.h b/Helpers/Memory.h new file mode 100644 index 0000000..c0884f1 --- /dev/null +++ b/Helpers/Memory.h @@ -0,0 +1,30 @@ +// BlitzSteam - Steam wrapper for Blitz +// Copyright (C) 2015 Xaymar (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 . + +#pragma once +#include "BlitzSteam.h" + +DLL_FUNCTION(void*) BS_Memory_Alloc(uint32_t iSize); +DLL_FUNCTION(void*) BS_Memory_ReAlloc(void* pMemory, uint32_t iNewSize); +DLL_FUNCTION(void) BS_Memory_Free(void* pMemory); +DLL_FUNCTION(uint8_t) BS_Memory_PeekByte(void* pMemory, uint32_t offset); +DLL_FUNCTION(uint16_t) BS_Memory_PeekShort(void* pMemory, uint32_t offset); +DLL_FUNCTION(uint32_t) BS_Memory_PeekInt(void* pMemory, uint32_t offset); +DLL_FUNCTION(float_t) BS_Memory_PeekFloat(void* pMemory, uint32_t offset); +DLL_FUNCTION(void) BS_Memory_PokeByte(void* pMemory, uint32_t offset, uint8_t value); +DLL_FUNCTION(void) BS_Memory_PokeShort(void* pMemory, uint32_t offset, uint16_t value); +DLL_FUNCTION(void) BS_Memory_PokeInt(void* pMemory, uint32_t offset, uint32_t value); +DLL_FUNCTION(void) BS_Memory_PokeFloat(void* pMemory, uint32_t offset, float_t value); diff --git a/Wrapper/Steam.cpp b/Wrapper/Steam.cpp index b6ca1d1..620c590 100644 --- a/Wrapper/Steam.cpp +++ b/Wrapper/Steam.cpp @@ -17,57 +17,57 @@ #include "BlitzSteam.h" DLL_FUNCTION(uint32_t) BS_Steam_Init() { +#pragma comment(linker, "/EXPORT:BS_Steam_Init=_BS_Steam_Init@0") return SteamAPI_Init(); } -#pragma comment(linker, "/EXPORT:BS_Steam_Init=_BS_Steam_Init@0") DLL_FUNCTION(void) BS_Steam_Shutdown() { +#pragma comment(linker, "/EXPORT:BS_Steam_Shutdown=_BS_Steam_Shutdown@0") SteamAPI_Shutdown(); } -#pragma comment(linker, "/EXPORT:BS_Steam_Shutdown=_BS_Steam_Shutdown@0") DLL_FUNCTION(uint32_t) BS_Steam_IsSteamRunning() { +#pragma comment(linker, "/EXPORT:BS_Steam_IsSteamRunning=_BS_Steam_IsSteamRunning@0") return SteamAPI_IsSteamRunning(); } -#pragma comment(linker, "/EXPORT:BS_Steam_IsSteamRunning=_BS_Steam_IsSteamRunning@0") DLL_FUNCTION(uint32_t) BS_Steam_RestartAppIfNecessary(uint32_t unOwnAppID) { +#pragma comment(linker, "/EXPORT:BS_Steam_RestartAppIfNecessary=_BS_Steam_RestartAppIfNecessary@4") return SteamAPI_RestartAppIfNecessary(unOwnAppID); } -#pragma comment(linker, "/EXPORT:BS_Steam_RestartAppIfNecessary=_BS_Steam_RestartAppIfNecessary@4") DLL_FUNCTION(void) BS_Steam_SetMiniDumpComment(const char* pchMsg) { +#pragma comment(linker, "/EXPORT:BS_Steam_SetMiniDumpComment=_BS_Steam_SetMiniDumpComment@4") SteamAPI_SetMiniDumpComment(pchMsg); } -#pragma comment(linker, "/EXPORT:BS_Steam_SetMiniDumpComment=_BS_Steam_SetMiniDumpComment@4") DLL_FUNCTION(void) BS_Steam_WriteMiniDump(uint32_t uStructuredExceptionCode, void* pvExceptionInfo, uint32_t uBuildID) { +#pragma comment(linker, "/EXPORT:BS_Steam_WriteMiniDump=_BS_Steam_WriteMiniDump@12") SteamAPI_WriteMiniDump(uStructuredExceptionCode, pvExceptionInfo, uBuildID); } -#pragma comment(linker, "/EXPORT:BS_Steam_WriteMiniDump=_BS_Steam_WriteMiniDump@12") // -- Callbacks DLL_FUNCTION(void) BS_Steam_RunCallbacks() { +#pragma comment(linker, "/EXPORT:BS_Steam_RunCallbacks=_BS_Steam_RunCallbacks@0") SteamAPI_RunCallbacks(); } -#pragma comment(linker, "/EXPORT:BS_Steam_RunCallbacks=_BS_Steam_RunCallbacks@0") DLL_FUNCTION(void) BS_Steam_RegisterCallback(class CCallbackBase *pCallback, uint32_t iCallback) { +#pragma comment(linker, "/EXPORT:BS_Steam_RegisterCallback=_BS_Steam_RegisterCallback@8") SteamAPI_RegisterCallback(pCallback, iCallback); } -#pragma comment(linker, "/EXPORT:BS_Steam_RegisterCallback=_BS_Steam_RegisterCallback@8") DLL_FUNCTION(void) BS_Steam_UnregisterCallback(class CCallbackBase *pCallback) { +#pragma comment(linker, "/EXPORT:BS_Steam_UnregisterCallback=_BS_Steam_UnregisterCallback@4") SteamAPI_UnregisterCallback(pCallback); } -#pragma comment(linker, "/EXPORT:BS_Steam_UnregisterCallback=_BS_Steam_UnregisterCallback@4") DLL_FUNCTION(void) BS_Steam_RegisterCallResult(class CCallbackBase *pCallback, uint64_t* phAPICall) { +#pragma comment(linker, "/EXPORT:BS_Steam_RegisterCallResult=_BS_Steam_RegisterCallResult@8") SteamAPI_RegisterCallResult(pCallback, *phAPICall); } -#pragma comment(linker, "/EXPORT:BS_Steam_RegisterCallResult=_BS_Steam_RegisterCallResult@8") DLL_FUNCTION(void) BS_Steam_UnregisterCallResult(class CCallbackBase *pCallback, uint64_t* phAPICall) { +#pragma comment(linker, "/EXPORT:BS_Steam_UnregisterCallResult=_BS_Steam_UnregisterCallResult@8") SteamAPI_UnregisterCallResult(pCallback, *phAPICall); } -#pragma comment(linker, "/EXPORT:BS_Steam_UnregisterCallResult=_BS_Steam_UnregisterCallResult@8") diff --git a/Wrapper/SteamAppList.cpp b/Wrapper/SteamAppList.cpp index 791f38f..8f2131e 100644 --- a/Wrapper/SteamAppList.cpp +++ b/Wrapper/SteamAppList.cpp @@ -17,31 +17,31 @@ #include "BlitzSteam.h" DLL_FUNCTION(ISteamAppList*) BS_AppList() { +#pragma comment(linker, "/EXPORT:BS_AppList=_BS_AppList@0") return SteamAppList(); } -#pragma comment(linker, "/EXPORT:BS_AppList=_BS_AppList@0") DLL_FUNCTION(uint32_t) BS_AppList_GetNumInstalledApps(ISteamAppList* lpSteamAppList) { +#pragma comment(linker, "/EXPORT:BS_AppList_GetNumInstalledApps=_BS_AppList_GetNumInstalledApps@4") return lpSteamAppList->GetNumInstalledApps(); } -#pragma comment(linker, "/EXPORT:BS_AppList_GetNumInstalledApps=_BS_AppList_GetNumInstalledApps@4") DLL_FUNCTION(uint32_t) BS_AppList_GetInstalledApps(ISteamAppList* lpSteamAppList, AppId_t *pvecAppID, uint32_t unMaxAppIDs) { +#pragma comment(linker, "/EXPORT:BS_AppList_GetInstalledApps=_BS_AppList_GetInstalledApps@12") return lpSteamAppList->GetInstalledApps(pvecAppID, unMaxAppIDs); } -#pragma comment(linker, "/EXPORT:BS_AppList_GetInstalledApps=_BS_AppList_GetInstalledApps@12") -DLL_FUNCTION(uint32_t) BS_AppList_GetAppName(ISteamAppList* lpSteamAppList, AppId_t nAppID, char* pchName, uint32_t cchNameMax) { - return lpSteamAppList->GetAppName(nAppID, pchName, cchNameMax); -} +DLL_FUNCTION(uint32_t) BS_AppList_GetAppName(ISteamAppList* lpSteamAppList, AppId_t nAppID, const char* pchName, uint32_t cchNameMax) { #pragma comment(linker, "/EXPORT:BS_AppList_GetAppName=_BS_AppList_GetAppName@16") - -DLL_FUNCTION(uint32_t) BS_AppList_GetAppInstallDir(ISteamAppList* lpSteamAppList, AppId_t nAppID, char* pchDirectory, uint32_t cchDirectoryMax) { - return lpSteamAppList->GetAppInstallDir(nAppID, pchDirectory, cchDirectoryMax); + return lpSteamAppList->GetAppName(nAppID, (char*)pchName, cchNameMax); } + +DLL_FUNCTION(uint32_t) BS_AppList_GetAppInstallDir(ISteamAppList* lpSteamAppList, AppId_t nAppID, char* pchDirectoryBuffer, uint32_t cchDirectoryMax) { #pragma comment(linker, "/EXPORT:BS_AppList_GetAppInstallDir=_BS_AppList_GetAppInstallDir@16") + return lpSteamAppList->GetAppInstallDir(nAppID, pchDirectoryBuffer, cchDirectoryMax); +} DLL_FUNCTION(uint32_t) BS_AppList_GetAppBuildId(ISteamAppList* lpSteamAppList, AppId_t nAppID) { +#pragma comment(linker, "/EXPORT:BS_AppList_GetAppBuildId=_BS_AppList_GetAppBuildId@8") return lpSteamAppList->GetAppBuildId(nAppID); } -#pragma comment(linker, "/EXPORT:BS_AppList_GetAppBuildId=_BS_AppList_GetAppBuildId@8") diff --git a/Wrapper/SteamApps.cpp b/Wrapper/SteamApps.cpp index 75e27f1..9793354 100644 --- a/Wrapper/SteamApps.cpp +++ b/Wrapper/SteamApps.cpp @@ -17,127 +17,126 @@ #include "BlitzSteam.h" DLL_FUNCTION(ISteamApps*) BS_Apps() { +#pragma comment(linker, "/EXPORT:BS_Apps=_BS_Apps@0") return SteamApps(); } -#pragma comment(linker, "/EXPORT:BS_Apps=_BS_Apps@0") DLL_FUNCTION(uint32_t) BS_Apps_IsSubscribed(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsSubscribed=_BS_Apps_IsSubscribed@4") return lpSteamApps->BIsSubscribed(); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsSubscribed=_BS_Apps_IsSubscribed@4") DLL_FUNCTION(uint32_t) BS_Apps_IsLowViolence(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsLowViolence=_BS_Apps_IsLowViolence@4") return lpSteamApps->BIsLowViolence(); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsLowViolence=_BS_Apps_IsLowViolence@4") DLL_FUNCTION(uint32_t) BS_Apps_IsCybercafe(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsCybercafe=_BS_Apps_IsCybercafe@4") return lpSteamApps->BIsCybercafe(); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsCybercafe=_BS_Apps_IsCybercafe@4") DLL_FUNCTION(uint32_t) BS_Apps_IsVACBanned(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsVACBanned=_BS_Apps_IsVACBanned@4") return lpSteamApps->BIsVACBanned(); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsVACBanned=_BS_Apps_IsVACBanned@4") DLL_FUNCTION(const char*) BS_Apps_GetCurrentGameLanguage(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_GetCurrentGameLanguage=_BS_Apps_GetCurrentGameLanguage@4") return lpSteamApps->GetCurrentGameLanguage(); } -#pragma comment(linker, "/EXPORT:BS_Apps_GetCurrentGameLanguage=_BS_Apps_GetCurrentGameLanguage@4") DLL_FUNCTION(const char*) BS_Apps_GetAvailableGameLanguages(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_GetAvailableGameLanguages=_BS_Apps_GetAvailableGameLanguages@4") return lpSteamApps->GetAvailableGameLanguages(); } -#pragma comment(linker, "/EXPORT:BS_Apps_GetAvailableGameLanguages=_BS_Apps_GetAvailableGameLanguages@4") DLL_FUNCTION(uint32_t) BS_Apps_IsSubscribedApp(ISteamApps* lpSteamApps, AppId_t appID) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsSubscribedApp=_BS_Apps_IsSubscribedApp@8") return lpSteamApps->BIsSubscribedApp(appID); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsSubscribedApp=_BS_Apps_IsSubscribedApp@8") DLL_FUNCTION(uint32_t) BS_Apps_IsDlcInstalled(ISteamApps* lpSteamApps, AppId_t appID) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsDlcInstalled=_BS_Apps_IsDlcInstalled@8") return lpSteamApps->BIsDlcInstalled(appID); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsDlcInstalled=_BS_Apps_IsDlcInstalled@8") DLL_FUNCTION(uint32_t) BS_Apps_GetEarliestPurchaseUnixTime(ISteamApps* lpSteamApps, AppId_t appID) { +#pragma comment(linker, "/EXPORT:BS_Apps_GetEarliestPurchaseUnixTime=_BS_Apps_GetEarliestPurchaseUnixTime@8") return lpSteamApps->GetEarliestPurchaseUnixTime(appID); } -#pragma comment(linker, "/EXPORT:BS_Apps_GetEarliestPurchaseUnixTime=_BS_Apps_GetEarliestPurchaseUnixTime@8") DLL_FUNCTION(uint32_t) BS_Apps_IsSubscribedFromFreeWeekend(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsSubscribedFromFreeWeekend=_BS_Apps_IsSubscribedFromFreeWeekend@4") return lpSteamApps->BIsSubscribedFromFreeWeekend(); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsSubscribedFromFreeWeekend=_BS_Apps_IsSubscribedFromFreeWeekend@4") DLL_FUNCTION(uint32_t) BS_Apps_GetDLCCount(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_GetDLCCount=_BS_Apps_GetDLCCount@4") return lpSteamApps->GetDLCCount(); } -#pragma comment(linker, "/EXPORT:BS_Apps_GetDLCCount=_BS_Apps_GetDLCCount@4") -DLL_FUNCTION(uint32_t) BS_Apps_GetDLCDataByIndex(ISteamApps* lpSteamApps, uint32_t iDLC, AppId_t *pAppId, bool* pbAvailable, char *pchName, uint32_t cchNameBufferSize) { - return lpSteamApps->BGetDLCDataByIndex(iDLC, pAppId, (bool*)pbAvailable, pchName, cchNameBufferSize); -} +DLL_FUNCTION(uint32_t) BS_Apps_GetDLCDataByIndex(ISteamApps* lpSteamApps, uint32_t iDLC, AppId_t *pAppIdBuffer, bool* pbAvailableBuffer, char *pchNameBuffer, uint32_t cchNameBufferSize) { #pragma comment(linker, "/EXPORT:BS_Apps_GetDLCDataByIndex=_BS_Apps_GetDLCDataByIndex@24") + return lpSteamApps->BGetDLCDataByIndex(iDLC, pAppIdBuffer, (bool*)pbAvailableBuffer, pchNameBuffer, cchNameBufferSize); +} DLL_FUNCTION(void) BS_Apps_InstallDLC(ISteamApps* lpSteamApps, AppId_t nAppID) { +#pragma comment(linker, "/EXPORT:BS_Apps_InstallDLC=_BS_Apps_InstallDLC@8") lpSteamApps->InstallDLC(nAppID); } -#pragma comment(linker, "/EXPORT:BS_Apps_InstallDLC=_BS_Apps_InstallDLC@8") DLL_FUNCTION(void) BS_Apps_UninstallDLC(ISteamApps* lpSteamApps, AppId_t nAppID) { +#pragma comment(linker, "/EXPORT:BS_Apps_UninstallDLC=_BS_Apps_UninstallDLC@8") lpSteamApps->UninstallDLC(nAppID); } -#pragma comment(linker, "/EXPORT:BS_Apps_UninstallDLC=_BS_Apps_UninstallDLC@8") DLL_FUNCTION(void) BS_Apps_RequestAppProofOfPurchaseKey(ISteamApps* lpSteamApps, AppId_t nAppID) { +#pragma comment(linker, "/EXPORT:BS_Apps_RequestAppProofOfPurchaseKey=_BS_Apps_RequestAppProofOfPurchaseKey@8") lpSteamApps->RequestAppProofOfPurchaseKey(nAppID); } -#pragma comment(linker, "/EXPORT:BS_Apps_RequestAppProofOfPurchaseKey=_BS_Apps_RequestAppProofOfPurchaseKey@8") -DLL_FUNCTION(uint32_t) BS_Apps_GetCurrentBetaName(ISteamApps* lpSteamApps, char *pchName, int cchNameBufferSize) { - return lpSteamApps->GetCurrentBetaName(pchName, cchNameBufferSize); -} +DLL_FUNCTION(uint32_t) BS_Apps_GetCurrentBetaName(ISteamApps* lpSteamApps, char* pchNameBuffer, int cchNameBufferSize) { #pragma comment(linker, "/EXPORT:BS_Apps_GetCurrentBetaName=_BS_Apps_GetCurrentBetaName@12") + return lpSteamApps->GetCurrentBetaName(pchNameBuffer, cchNameBufferSize); +} DLL_FUNCTION(uint32_t) BS_Apps_MarkContentCorrupt(ISteamApps* lpSteamApps, uint32_t bMissingFilesOnly) { +#pragma comment(linker, "/EXPORT:BS_Apps_MarkContentCorrupt=_BS_Apps_MarkContentCorrupt@8") return lpSteamApps->MarkContentCorrupt(bMissingFilesOnly != 0); } -#pragma comment(linker, "/EXPORT:BS_Apps_MarkContentCorrupt=_BS_Apps_MarkContentCorrupt@8") -DLL_FUNCTION(uint32_t) BS_Apps_GetInstalledDepots(ISteamApps* lpSteamApps, AppId_t nAppID, DepotId_t *pvecDepots, uint32_t cMaxDepots) { - return lpSteamApps->GetInstalledDepots(nAppID, pvecDepots, cMaxDepots); -} +DLL_FUNCTION(uint32_t) BS_Apps_GetInstalledDepots(ISteamApps* lpSteamApps, AppId_t nAppID, DepotId_t *pDepotsBuffer, uint32_t cMaxDepots) { #pragma comment(linker, "/EXPORT:BS_Apps_GetInstalledDepots=_BS_Apps_GetInstalledDepots@16") - -DLL_FUNCTION(uint32_t) BS_Apps_GetAppInstallDir(ISteamApps* lpSteamApps, AppId_t appID, char *pchFolder, uint32_t cchFolderBufferSize) { - return lpSteamApps->GetAppInstallDir(appID, pchFolder, cchFolderBufferSize); + return lpSteamApps->GetInstalledDepots(nAppID, pDepotsBuffer, cMaxDepots); } + +DLL_FUNCTION(uint32_t) BS_Apps_GetAppInstallDir(ISteamApps* lpSteamApps, AppId_t appID, char *pchFolderBuffer, uint32_t cchFolderBufferSize) { #pragma comment(linker, "/EXPORT:BS_Apps_GetAppInstallDir=_BS_Apps_GetAppInstallDir@16") + return lpSteamApps->GetAppInstallDir(appID, pchFolderBuffer, cchFolderBufferSize); +} DLL_FUNCTION(uint32_t) BS_Apps_IsAppInstalled(ISteamApps* lpSteamApps, AppId_t appID) { +#pragma comment(linker, "/EXPORT:BS_Apps_IsAppInstalled=_BS_Apps_IsAppInstalled@8") return lpSteamApps->BIsAppInstalled(appID); } -#pragma comment(linker, "/EXPORT:BS_Apps_IsAppInstalled=_BS_Apps_IsAppInstalled@8") DLL_FUNCTION(CSteamID*) BS_Apps_GetAppOwner(ISteamApps* lpSteamApps) { - CSteamID* steamID = new CSteamID(lpSteamApps->GetAppOwner()); - return BS_CSteamID_Copy(steamID); -} #pragma comment(linker, "/EXPORT:BS_Apps_GetAppOwner=_BS_Apps_GetAppOwner@4") + return new CSteamID(lpSteamApps->GetAppOwner()); +} DLL_FUNCTION(const char*) BS_Apps_GetLaunchQueryParam(ISteamApps* lpSteamApps, const char *pchKey) { +#pragma comment(linker, "/EXPORT:BS_Apps_GetLaunchQueryParam=_BS_Apps_GetLaunchQueryParam@8") return lpSteamApps->GetLaunchQueryParam(pchKey); } -#pragma comment(linker, "/EXPORT:BS_Apps_GetLaunchQueryParam=_BS_Apps_GetLaunchQueryParam@8") -DLL_FUNCTION(uint32_t) BS_Apps_GetDlcDownloadProgress(ISteamApps* lpSteamApps, AppId_t nAppID, uint64_t* punBytesDownloaded, uint64_t* punBytesTotal) { - return lpSteamApps->GetDlcDownloadProgress(nAppID, punBytesDownloaded, punBytesTotal); -} +DLL_FUNCTION(uint32_t) BS_Apps_GetDlcDownloadProgress(ISteamApps* lpSteamApps, AppId_t nAppID, uint64_t* pLLBytesDownloaded, uint64_t* pLLBytesTotal) { #pragma comment(linker, "/EXPORT:BS_Apps_GetDlcDownloadProgress=_BS_Apps_GetDlcDownloadProgress@16") + return lpSteamApps->GetDlcDownloadProgress(nAppID, pLLBytesDownloaded, pLLBytesTotal); +} DLL_FUNCTION(uint32_t) BS_Apps_GetAppBuildId(ISteamApps* lpSteamApps) { +#pragma comment(linker, "/EXPORT:BS_Apps_GetAppBuildId=_BS_Apps_GetAppBuildId@4") return lpSteamApps->GetAppBuildId(); } -#pragma comment(linker, "/EXPORT:BS_Apps_GetAppBuildId=_BS_Apps_GetAppBuildId@4") diff --git a/Wrapper/SteamClient.cpp b/Wrapper/SteamClient.cpp index 4b4a5f0..4e32518 100644 --- a/Wrapper/SteamClient.cpp +++ b/Wrapper/SteamClient.cpp @@ -17,182 +17,183 @@ #include "BlitzSteam.h" DLL_FUNCTION(ISteamClient*) BS_Client() { +#pragma comment(linker, "/EXPORT:BS_Client=_BS_Client@0") return SteamClient(); } -#pragma comment(linker, "/EXPORT:BS_Client=_BS_Client@0") DLL_FUNCTION(HSteamPipe) BS_Client_CreateSteamPipe(ISteamClient* lpSteamClient) { +#pragma comment(linker, "/EXPORT:BS_Client_CreateSteamPipe=_BS_Client_CreateSteamPipe@4") return lpSteamClient->CreateSteamPipe(); } -#pragma comment(linker, "/EXPORT:BS_Client_CreateSteamPipe=_BS_Client_CreateSteamPipe@4") DLL_FUNCTION(uint32_t) BS_Client_ReleaseSteamPipe(ISteamClient* lpSteamClient, HSteamPipe hSteamPipe) { +#pragma comment(linker, "/EXPORT:BS_Client_ReleaseSteamPipe=_BS_Client_ReleaseSteamPipe@8") return lpSteamClient->BReleaseSteamPipe(hSteamPipe); } -#pragma comment(linker, "/EXPORT:BS_Client_ReleaseSteamPipe=_BS_Client_ReleaseSteamPipe@8") DLL_FUNCTION(HSteamUser) BS_Client_ConnectToGlobalUser(ISteamClient* lpSteamClient, HSteamPipe hSteamPipe) { +#pragma comment(linker, "/EXPORT:BS_Client_ConnectToGlobalUser=_BS_Client_ConnectToGlobalUser@8") return lpSteamClient->ConnectToGlobalUser(hSteamPipe); } -#pragma comment(linker, "/EXPORT:BS_Client_ConnectToGlobalUser=_BS_Client_ConnectToGlobalUser@8") DLL_FUNCTION(void) BS_Client_SetLocalIPBinding(ISteamClient* lpSteamClient, uint32_t unIP, uint16 usPort) { +#pragma comment(linker, "/EXPORT:BS_Client_SetLocalIPBinding=_BS_Client_SetLocalIPBinding@12") return lpSteamClient->SetLocalIPBinding(unIP, usPort); } -#pragma comment(linker, "/EXPORT:BS_Client_SetLocalIPBinding=_BS_Client_SetLocalIPBinding@12") DLL_FUNCTION(HSteamUser) BS_Client_CreateLocalUser(ISteamClient* lpSteamClient, HSteamPipe* phSteamPipe, EAccountType eAccountType) { +#pragma comment(linker, "/EXPORT:BS_Client_CreateLocalUser=_BS_Client_CreateLocalUser@12") return lpSteamClient->CreateLocalUser(phSteamPipe, eAccountType); } -#pragma comment(linker, "/EXPORT:BS_Client_CreateLocalUser=_BS_Client_CreateLocalUser@12") DLL_FUNCTION(void) BS_Client_ReleaseUser(ISteamClient* lpSteamClient, HSteamPipe hSteamPipe, HSteamUser hSteamUser) { +#pragma comment(linker, "/EXPORT:BS_Client_ReleaseUser=_BS_Client_ReleaseUser@12") return lpSteamClient->ReleaseUser(hSteamPipe, hSteamUser); } -#pragma comment(linker, "/EXPORT:BS_Client_ReleaseUser=_BS_Client_ReleaseUser@12") DLL_FUNCTION(void) BS_Client_RunFrame(ISteamClient* lpSteamClient) { +#pragma comment(linker, "/EXPORT:BS_Client_RunFrame=_BS_Client_RunFrame@4") lpSteamClient->RunFrame(); } -#pragma comment(linker, "/EXPORT:BS_Client_RunFrame=_BS_Client_RunFrame@4") DLL_FUNCTION(uint32_t) BS_Client_GetIPCCallCount(ISteamClient* lpSteamClient) { +#pragma comment(linker, "/EXPORT:BS_Client_GetIPCCallCount=_BS_Client_GetIPCCallCount@4") return lpSteamClient->GetIPCCallCount(); } -#pragma comment(linker, "/EXPORT:BS_Client_GetIPCCallCount=_BS_Client_GetIPCCallCount@4") DLL_FUNCTION(uint32_t) BS_Client_ShutdownIfAllPipesClosed(ISteamClient* lpSteamClient) { +#pragma comment(linker, "/EXPORT:BS_Client_ShutdownIfAllPipesClosed=_BS_Client_ShutdownIfAllPipesClosed@4") return lpSteamClient->BShutdownIfAllPipesClosed(); } // Interfaces DLL_FUNCTION(ISteamAppList*) BS_Client_GetSteamAppList(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamAppList=_BS_Client_GetSteamAppList@16") return lpSteamClient->GetISteamAppList(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamAppList=_BS_Client_GetSteamAppList@16") DLL_FUNCTION(ISteamApps*) BS_Client_GetSteamApps(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamApps=_BS_Client_GetSteamApps@16") return lpSteamClient->GetISteamApps(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamApps=_BS_Client_GetSteamApps@16") DLL_FUNCTION(ISteamController*) BS_Client_GetSteamController(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamController=_BS_Client_GetSteamController@16") return lpSteamClient->GetISteamController(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamController=_BS_Client_GetSteamController@16") DLL_FUNCTION(ISteamFriends*) BS_Client_GetSteamFriends(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamFriends=_BS_Client_GetSteamFriends@16") return lpSteamClient->GetISteamFriends(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamFriends=_BS_Client_GetSteamFriends@16") DLL_FUNCTION(ISteamGameServer*) BS_Client_GetSteamGameServer(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamGameServer=_BS_Client_GetSteamGameServer@16") return lpSteamClient->GetISteamGameServer(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamGameServer=_BS_Client_GetSteamGameServer@16") DLL_FUNCTION(ISteamGameServerStats*) BS_Client_GetSteamGameServerStats(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamGameServerStats=_BS_Client_GetSteamGameServerStats@16") return lpSteamClient->GetISteamGameServerStats(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamGameServerStats=_BS_Client_GetSteamGameServerStats@16") DLL_FUNCTION(ISteamHTMLSurface*) BS_Client_GetSteamHTMLSurface(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamHTMLSurface=_BS_Client_GetSteamHTMLSurface@16") return lpSteamClient->GetISteamHTMLSurface(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamHTMLSurface=_BS_Client_GetSteamHTMLSurface@16") DLL_FUNCTION(ISteamHTTP*) BS_Client_GetSteamHTTP(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamHTTP=_BS_Client_GetSteamHTTP@16") return lpSteamClient->GetISteamHTTP(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamHTTP=_BS_Client_GetSteamHTTP@16") DLL_FUNCTION(ISteamInventory*) BS_Client_GetSteamInventory(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamInventory=_BS_Client_GetSteamInventory@16") return lpSteamClient->GetISteamInventory(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamInventory=_BS_Client_GetSteamInventory@16") DLL_FUNCTION(ISteamMatchmaking*) BS_Client_GetSteamMatchmaking(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMatchmaking=_BS_Client_GetSteamMatchmaking@16") return lpSteamClient->GetISteamMatchmaking(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMatchmaking=_BS_Client_GetSteamMatchmaking@16") DLL_FUNCTION(ISteamMatchmakingServers*) BS_Client_GetSteamMatchmakingServers(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMatchmakingServers=_BS_Client_GetSteamMatchmakingServers@16") return lpSteamClient->GetISteamMatchmakingServers(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMatchmakingServers=_BS_Client_GetSteamMatchmakingServers@16") DLL_FUNCTION(ISteamMusic*) BS_Client_GetSteamMusic(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMusic=_BS_Client_GetSteamMusic@16") return lpSteamClient->GetISteamMusic(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMusic=_BS_Client_GetSteamMusic@16") DLL_FUNCTION(ISteamMusicRemote*) BS_Client_GetSteamMusicRemote(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMusicRemote=_BS_Client_GetSteamMusicRemote@16") return lpSteamClient->GetISteamMusicRemote(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamMusicRemote=_BS_Client_GetSteamMusicRemote@16") DLL_FUNCTION(ISteamNetworking*) BS_Client_GetSteamNetworking(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamNetworking=_BS_Client_GetSteamNetworking@16") return lpSteamClient->GetISteamNetworking(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamNetworking=_BS_Client_GetSteamNetworking@16") DLL_FUNCTION(ISteamRemoteStorage*) BS_Client_GetSteamRemoteStorage(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamRemoteStorage=_BS_Client_GetSteamRemoteStorage@16") return lpSteamClient->GetISteamRemoteStorage(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamRemoteStorage=_BS_Client_GetSteamRemoteStorage@16") DLL_FUNCTION(ISteamScreenshots*) BS_Client_GetSteamScreenshots(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamScreenshots=_BS_Client_GetSteamScreenshots@16") return lpSteamClient->GetISteamScreenshots(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamScreenshots=_BS_Client_GetSteamScreenshots@16") DLL_FUNCTION(ISteamUGC*) BS_Client_GetSteamUGC(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUGC=_BS_Client_GetSteamUGC@16") return lpSteamClient->GetISteamUGC(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUGC=_BS_Client_GetSteamUGC@16") DLL_FUNCTION(ISteamUnifiedMessages*) BS_Client_GetSteamUnifiedMessages(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUnifiedMessages=_BS_Client_GetSteamUnifiedMessages@16") return lpSteamClient->GetISteamUnifiedMessages(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUnifiedMessages=_BS_Client_GetSteamUnifiedMessages@16") DLL_FUNCTION(ISteamUser*) BS_Client_GetSteamUser(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUser=_BS_Client_GetSteamUser@16") return lpSteamClient->GetISteamUser(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUser=_BS_Client_GetSteamUser@16") DLL_FUNCTION(ISteamUserStats*) BS_Client_GetSteamUserStats(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUserStats=_BS_Client_GetSteamUserStats@16") return lpSteamClient->GetISteamUserStats(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUserStats=_BS_Client_GetSteamUserStats@16") DLL_FUNCTION(ISteamUtils*) BS_Client_GetSteamUtils(ISteamClient* lpSteamClient, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUtils=_BS_Client_GetSteamUtils@12") return lpSteamClient->GetISteamUtils(hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamUtils=_BS_Client_GetSteamUtils@12") DLL_FUNCTION(ISteamVideo*) BS_Client_GetSteamVideo(ISteamClient* lpSteamClient, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion) { +#pragma comment(linker, "/EXPORT:BS_Client_GetSteamVideo=_BS_Client_GetSteamVideo@16") return lpSteamClient->GetISteamVideo(hSteamUser, hSteamPipe, pchVersion); } -#pragma comment(linker, "/EXPORT:BS_Client_GetSteamVideo=_BS_Client_GetSteamVideo@16") // Callbacks & Hooks DLL_FUNCTION(void) BS_Client_SetWarningMessageHook(ISteamClient* lpSteamClient, SteamAPIWarningMessageHook_t fpfunction) { +#pragma comment(linker, "/EXPORT:BS_Client_SetWarningMessageHook=_BS_Client_SetWarningMessageHook@8") lpSteamClient->SetWarningMessageHook(fpfunction); } -#pragma comment(linker, "/EXPORT:BS_Client_SetWarningMessageHook=_BS_Client_SetWarningMessageHook@8") DLL_FUNCTION(void) BS_Client_Set_SteamAPI_CPostAPIResultInProcess(ISteamClient* lpSteamClient, SteamAPI_PostAPIResultInProcess_t fpFunction) { +#pragma comment(linker, "/EXPORT:BS_Client_Set_SteamAPI_CPostAPIResultInProcess=_BS_Client_Set_SteamAPI_CPostAPIResultInProcess@8") lpSteamClient->Set_SteamAPI_CPostAPIResultInProcess(fpFunction); } -#pragma comment(linker, "/EXPORT:BS_Client_Set_SteamAPI_CPostAPIResultInProcess=_BS_Client_Set_SteamAPI_CPostAPIResultInProcess@8") DLL_FUNCTION(void) BS_Client_Remove_SteamAPI_CPostAPIResultInProcess(ISteamClient* lpSteamClient, SteamAPI_PostAPIResultInProcess_t fpFunction) { +#pragma comment(linker, "/EXPORT:BS_Client_Remove_SteamAPI_CPostAPIResultInProcess=_BS_Client_Remove_SteamAPI_CPostAPIResultInProcess@8") lpSteamClient->Remove_SteamAPI_CPostAPIResultInProcess(fpFunction); } -#pragma comment(linker, "/EXPORT:BS_Client_Remove_SteamAPI_CPostAPIResultInProcess=_BS_Client_Remove_SteamAPI_CPostAPIResultInProcess@8") DLL_FUNCTION(void) BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess(ISteamClient* lpSteamClient, SteamAPI_CheckCallbackRegistered_t fpFunction) { +#pragma comment(linker, "/EXPORT:BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess=_BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess@8") lpSteamClient->Set_SteamAPI_CCheckCallbackRegisteredInProcess(fpFunction); } -#pragma comment(linker, "/EXPORT:BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess=_BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess@8") diff --git a/Wrapper/SteamController.cpp b/Wrapper/SteamController.cpp index 421d84b..6d45c68 100644 --- a/Wrapper/SteamController.cpp +++ b/Wrapper/SteamController.cpp @@ -17,38 +17,123 @@ #include "BlitzSteam.h" DLL_FUNCTION(ISteamController*) BS_Controller() { +#pragma comment(linker, "/EXPORT:BS_Controller=_BS_Controller@0") return SteamController(); } -#pragma comment(linker, "/EXPORT:BS_Controller=_BS_Controller@0") +// Init and Shutdown must be called when starting/ending use of this interface DLL_FUNCTION(uint32_t) BS_Controller_Init(ISteamController* lpSteamController) { +#pragma comment(linker, "/EXPORT:BS_Controller_Init=_BS_Controller_Init@4") return lpSteamController->Init(); } -#pragma comment(linker, "/EXPORT:BS_Controller_Init=_BS_Controller_Init@4") +// Init and Shutdown must be called when starting/ending use of this interface DLL_FUNCTION(uint32_t) BS_Controller_Shutdown(ISteamController* lpSteamController) { +#pragma comment(linker, "/EXPORT:BS_Controller_Shutdown=_BS_Controller_Shutdown@4") return lpSteamController->Shutdown(); } -#pragma comment(linker, "/EXPORT:BS_Controller_Shutdown=_BS_Controller_Shutdown@4") +// Pump callback/callresult events +// Note: SteamAPI_RunCallbacks will do this for you, so you should never need to call this directly. DLL_FUNCTION(void) BS_Controller_RunFrame(ISteamController* lpSteamController) { +#pragma comment(linker, "/EXPORT:BS_Controller_RunFrame=_BS_Controller_RunFrame@4") lpSteamController->RunFrame(); } -#pragma comment(linker, "/EXPORT:BS_Controller_RunFrame=_BS_Controller_RunFrame@4") -#if 0 -DLL_FUNCTION(uint32_t) BS_Controller_GetControllerState( ISteamController* lpSteamController, uint32_t unControllerIndex, SteamControllerState_t *pState ) { - return lpSteamController->GetControllerState( unControllerIndex, pState ); +// Enumerate currently connected controllers +// handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles +// Returns the number of handles written to handlesOut +DLL_FUNCTION(uint32_t) BS_Controller_GetConnectedControllersEx(ISteamController* lpSteamController, ControllerHandle_t* pHandlesOut) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllersEx=_BS_Controller_GetConnectedControllersEx@8") + return lpSteamController->GetConnectedControllers(pHandlesOut); } -#pragma comment(linker, "/EXPORT:BS_Controller_GetControllerState=_BS_Controller_GetControllerState@12") -DLL_FUNCTION(void) BS_Controller_TriggerHapticPulse( ISteamController* lpSteamController, uint32_t unControllerIndex, ESteamControllerPad eTargetPad, uint32_t usDurationMicroSec ) { - lpSteamController->TriggerHapticPulse( unControllerIndex, eTargetPad, usDurationMicroSec ); +ControllerHandle_t* pControllerHandles = new ControllerHandle_t[STEAM_CONTROLLER_MAX_COUNT]; +DLL_FUNCTION(uint32_t) BS_Controller_GetConnectedControllers(ISteamController* lpSteamController) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllers=_BS_Controller_GetConnectedControllers@4") + return lpSteamController->GetConnectedControllers(pControllerHandles); } + +DLL_FUNCTION(ControllerHandle_t*) BS_Controller_GetConnectedControllers_Index(uint32_t index) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllers_Index=_BS_Controller_GetConnectedControllers_Index@4") + if (index >= STEAM_CONTROLLER_MAX_COUNT) + index = STEAM_CONTROLLER_MAX_COUNT - 1; + return &(pControllerHandles[index]); +} + +// Invokes the Steam overlay and brings up the binding screen +// Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode +DLL_FUNCTION(uint32_t) BS_Controller_ShowBindingPanel(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle) { +#pragma comment(linker, "/EXPORT:BS_Controller_ShowBindingPanel=_BS_Controller_ShowBindingPanel@8") + return lpSteamController->ShowBindingPanel(*pControllerHandle); +} + +// ACTION SETS +// Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. +DLL_FUNCTION(ControllerActionSetHandle_t*) BS_Controller_GetActionSetHandle(ISteamController* lpSteamController, const char* pszActionSetName) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetActionSetHandle=_BS_Controller_GetActionSetHandle@8") + return new ControllerActionSetHandle_t(lpSteamController->GetActionSetHandle(pszActionSetName)); +} + +// Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') +// This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in +// your state loops, instead of trying to place it in all of your state transitions. +DLL_FUNCTION(void) BS_Controller_ActivateActionSet(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ControllerActionSetHandle_t* pActionSetHandle) { +#pragma comment(linker, "/EXPORT:BS_Controller_ActivateActionSet=_BS_Controller_ActivateActionSet@12") + lpSteamController->ActivateActionSet(*pControllerHandle, *pActionSetHandle); +} + +DLL_FUNCTION(ControllerActionSetHandle_t*) BS_Controller_GetCurrentActionSet(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetCurrentActionSet=_BS_Controller_GetCurrentActionSet@8") + return new ControllerActionSetHandle_t(lpSteamController->GetCurrentActionSet(*pControllerHandle)); +} + +// Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. +DLL_FUNCTION(ControllerDigitalActionHandle_t*) BS_Controller_GetDigitalActionHandle(ISteamController* lpSteamController, const char* pszActionName) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetDigitalActionHandle=_BS_Controller_GetDigitalActionHandle@8") + return new ControllerDigitalActionHandle_t(lpSteamController->GetDigitalActionHandle(pszActionName)); +} + +// Returns the current state of the supplied digital game action +DLL_FUNCTION(ControllerDigitalActionData_t*) BS_Controller_GetDigitalActionData(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ControllerDigitalActionHandle_t* pDigitalActionHandle) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetDigitalActionData=_BS_Controller_GetDigitalActionData@12") + return &lpSteamController->GetDigitalActionData(*pControllerHandle, *pDigitalActionHandle); +} + +// Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. +// originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles +DLL_FUNCTION(int32_t) BS_Controller_GetDigitalActionOrigins(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ControllerActionSetHandle_t* pActionSetHandle, ControllerDigitalActionHandle_t* pDigitalActionHandle, EControllerActionOrigin *pEControllerActionOrigin) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetDigitalActionOrigins=_BS_Controller_GetDigitalActionOrigins@20") + return lpSteamController->GetDigitalActionOrigins(*pControllerHandle, *pActionSetHandle, *pDigitalActionHandle, pEControllerActionOrigin); +} + +// Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. +DLL_FUNCTION(ControllerAnalogActionHandle_t*) BS_Controller_GetAnalogActionHandle(ISteamController* lpSteamController, const char *pszActionName) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetDigitalActionOrigins=_BS_Controller_GetDigitalActionOrigins@20") + return new ControllerAnalogActionHandle_t(lpSteamController->GetAnalogActionHandle(pszActionName)); + //BlitzSteam: Cleanup using BS_Helper_DeleteLongLong +} + +// Returns the current state of these supplied analog game action +DLL_FUNCTION(ControllerAnalogActionData_t*) BS_Controller_GetAnalogActionData(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ControllerAnalogActionHandle_t* pAnalogActionHandle) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetDigitalActionOrigins=_BS_Controller_GetDigitalActionOrigins@20") + return &lpSteamController->GetAnalogActionData(*pControllerHandle, *pAnalogActionHandle); +} + +// Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. +// originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles +DLL_FUNCTION(uint32_t) BS_Controller_GetAnalogActionOrigins(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ControllerActionSetHandle_t* pActionSetHandle, ControllerAnalogActionHandle_t* pAnalogActionHandle, EControllerActionOrigin *pEControllerActionOrigin) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetDigitalActionOrigins=_BS_Controller_GetDigitalActionOrigins@20") + return lpSteamController->GetAnalogActionOrigins(*pControllerHandle, *pActionSetHandle, *pAnalogActionHandle, pEControllerActionOrigin); +} + +DLL_FUNCTION(void) BS_Controller_StopAnalogActionMomentum(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ControllerAnalogActionHandle_t* pAnalogActionHandle) { +#pragma comment(linker, "/EXPORT:BS_Controller_StopAnalogActionMomentum=_BS_Controller_StopAnalogActionMomentum@12") + lpSteamController->StopAnalogActionMomentum(*pControllerHandle, *pAnalogActionHandle); +} + +// Trigger a haptic pulse on a controller +DLL_FUNCTION(void) BS_Controller_TriggerHapticPulse(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ESteamControllerPad eTargetPad, uint32_t usDurationMicroSec) { #pragma comment(linker, "/EXPORT:BS_Controller_TriggerHapticPulse=_BS_Controller_TriggerHapticPulse@16") - -DLL_FUNCTION(void) BS_Controller_SetOverrideMode( ISteamController* lpSteamController, const char *pchMode ) { - lpSteamController->SetOverrideMode( pchMode ); -} -#pragma comment(linker, "/EXPORT:BS_Controller_SetOverrideMode=_BS_Controller_SetOverrideMode@8") -#endif // 0 + lpSteamController->TriggerHapticPulse(*pControllerHandle, eTargetPad, (uint16_t)usDurationMicroSec); +} \ No newline at end of file diff --git a/Wrapper/SteamFriends.cpp b/Wrapper/SteamFriends.cpp index 7118b37..69fcc83 100644 --- a/Wrapper/SteamFriends.cpp +++ b/Wrapper/SteamFriends.cpp @@ -17,365 +17,361 @@ #include "BlitzSteam.h" DLL_FUNCTION(ISteamFriends*) BS_Friends() { +#pragma comment(linker, "/EXPORT:BS_Friends=_BS_Friends@0") return SteamFriends(); } -#pragma comment(linker, "/EXPORT:BS_Friends=_BS_Friends@0") DLL_FUNCTION(const char*) BS_Friends_GetPersonaName(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetPersonaName=_BS_Friends_GetPersonaName@4") return lpSteamFriends->GetPersonaName(); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetPersonaName=_BS_Friends_GetPersonaName@4") DLL_FUNCTION(SteamAPICall_t*) BS_Friends_SetPersonaName(ISteamFriends* lpSteamFriends, const char* pchPersonaName) { +#pragma comment(linker, "/EXPORT:BS_Friends_SetPersonaName=_BS_Friends_SetPersonaName@8") return new uint64_t(lpSteamFriends->SetPersonaName(pchPersonaName)); } -#pragma comment(linker, "/EXPORT:BS_Friends_SetPersonaName=_BS_Friends_SetPersonaName@8") DLL_FUNCTION(int32_t) BS_Friends_GetPersonaState(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetPersonaState=_BS_Friends_GetPersonaState@4") return lpSteamFriends->GetPersonaState(); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetPersonaState=_BS_Friends_GetPersonaState@4") DLL_FUNCTION(int32_t) BS_Friends_GetFriendCount(ISteamFriends* lpSteamFriends, int32_t iFriendFlags) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCount=_BS_Friends_GetFriendCount@8") return lpSteamFriends->GetFriendCount(iFriendFlags); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCount=_BS_Friends_GetFriendCount@8") DLL_FUNCTION(CSteamID*) BS_Friends_GetFriendByIndex(ISteamFriends* lpSteamFriends, int32_t iFriend, int32_t iFriendFlags) { - CSteamID* pSteamID = new CSteamID(lpSteamFriends->GetFriendByIndex(iFriend, iFriendFlags)); - return pSteamID; -} #pragma comment(linker, "/EXPORT:BS_Friends_GetFriendByIndex=_BS_Friends_GetFriendByIndex@12") + return new CSteamID(lpSteamFriends->GetFriendByIndex(iFriend, iFriendFlags)); +} DLL_FUNCTION(EFriendRelationship) BS_Friends_GetFriendRelationship(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRelationship=_BS_Friends_GetFriendRelationship@8") return lpSteamFriends->GetFriendRelationship(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRelationship=_BS_Friends_GetFriendRelationship@8") DLL_FUNCTION(EPersonaState) BS_Friends_GetFriendPersonaState(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendPersonaState=_BS_Friends_GetFriendPersonaState@8") return lpSteamFriends->GetFriendPersonaState(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendPersonaState=_BS_Friends_GetFriendPersonaState@8") DLL_FUNCTION(const char*) BS_Friends_GetFriendPersonaName(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendPersonaName=_BS_Friends_GetFriendPersonaName@8") return lpSteamFriends->GetFriendPersonaName(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendPersonaName=_BS_Friends_GetFriendPersonaName@8") DLL_FUNCTION(uint32_t) BS_Friends_GetFriendGamePlayed(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, FriendGameInfo_t *pFriendGameInfo) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendGamePlayed=_BS_Friends_GetFriendGamePlayed@12") return lpSteamFriends->GetFriendGamePlayed(*steamIDFriend, pFriendGameInfo); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendGamePlayed=_BS_Friends_GetFriendGamePlayed@12") DLL_FUNCTION(const char*) BS_Friends_GetFriendPersonaNameHistory(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, int32_t iPersonaName) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendPersonaNameHistory=_BS_Friends_GetFriendPersonaNameHistory@12") return lpSteamFriends->GetFriendPersonaNameHistory(*steamIDFriend, iPersonaName); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendPersonaNameHistory=_BS_Friends_GetFriendPersonaNameHistory@12") DLL_FUNCTION(int32_t) BS_Friends_GetFriendSteamLevel(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendSteamLevel=_BS_Friends_GetFriendSteamLevel@8") return lpSteamFriends->GetFriendSteamLevel(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendSteamLevel=_BS_Friends_GetFriendSteamLevel@8") DLL_FUNCTION(const char*) BS_Friends_GetPlayerNickname(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetPlayerNickname=_BS_Friends_GetPlayerNickname@8") const char* nickname = lpSteamFriends->GetPlayerNickname(*steamIDFriends); if (nickname == NULL) { nickname = ""; } return nickname; } -#pragma comment(linker, "/EXPORT:BS_Friends_GetPlayerNickname=_BS_Friends_GetPlayerNickname@8") DLL_FUNCTION(int32_t) BS_Friends_GetFriendsGroupCount(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupCount=_BS_Friends_GetFriendsGroupCount@4") return lpSteamFriends->GetFriendsGroupCount(); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupCount=_BS_Friends_GetFriendsGroupCount@4") DLL_FUNCTION(FriendsGroupID_t) BS_Friends_GetFriendsGroupIDByIndex(ISteamFriends* lpSteamFriends, FriendsGroupID_t friendsGroupID) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupIDByIndex=_BS_Friends_GetFriendsGroupIDByIndex@8") return lpSteamFriends->GetFriendsGroupIDByIndex(friendsGroupID); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupIDByIndex=_BS_Friends_GetFriendsGroupIDByIndex@8") DLL_FUNCTION(const char*) BS_Friends_GetFriendsGroupName(ISteamFriends* lpSteamFriends, FriendsGroupID_t friendsGroupID) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupName=_BS_Friends_GetFriendsGroupName@8") return lpSteamFriends->GetFriendsGroupName(friendsGroupID); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupName=_BS_Friends_GetFriendsGroupName@8") DLL_FUNCTION(int32_t) BS_Friends_GetFriendsGroupMembersCount(ISteamFriends* lpSteamFriends, FriendsGroupID_t friendsGroupID) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupMembersCount=_BS_Friends_GetFriendsGroupMembersCount@8") return lpSteamFriends->GetFriendsGroupMembersCount(friendsGroupID); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupMembersCount=_BS_Friends_GetFriendsGroupMembersCount@8") DLL_FUNCTION(void) BS_Friends_GetFriendsGroupMembersList(ISteamFriends* lpSteamFriends, FriendsGroupID_t friendsGroupID, CSteamID* pOutSteamIDMembers, int32_t nMembersCount) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupMembersList=_BS_Friends_GetFriendsGroupMembersList@16") lpSteamFriends->GetFriendsGroupMembersList(friendsGroupID, pOutSteamIDMembers, nMembersCount); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendsGroupMembersList=_BS_Friends_GetFriendsGroupMembersList@16") DLL_FUNCTION(uint32_t) BS_Friends_HasFriend(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, int32_t iFriendsFlags) { +#pragma comment(linker, "/EXPORT:BS_Friends_HasFriends=_BS_Friends_HasFriend@12") return lpSteamFriends->HasFriend(*steamIDFriend, iFriendsFlags); } -#pragma comment(linker, "/EXPORT:BS_Friends_HasFriends=_BS_Friends_HasFriend@12") DLL_FUNCTION(int32_t) BS_Friends_GetClanCount(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanCount=_BS_Friends_GetClanCount@4") return lpSteamFriends->GetClanCount(); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanCount=_BS_Friends_GetClanCount@4") DLL_FUNCTION(CSteamID*) BS_Friends_GetClanByIndex(ISteamFriends* lpSteamFriends, int32_t iClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanByIndex=_BS_Friends_GetClanByIndex@8") CSteamID* steamID = new CSteamID(lpSteamFriends->GetClanByIndex(iClan)); return steamID; } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanByIndex=_BS_Friends_GetClanByIndex@8") DLL_FUNCTION(const char*) BS_Friends_GetClanName(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanName=_BS_Friends_GetClanName@8") return lpSteamFriends->GetClanName(*steamIDClan); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanName=_BS_Friends_GetClanName@8") DLL_FUNCTION(const char*) BS_Friends_GetClanTag(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanTag=_BS_Friends_GetClanTag@8") return lpSteamFriends->GetClanTag(*steamIDClan); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanTag=_BS_Friends_GetClanTag@8") DLL_FUNCTION(uint32_t) BS_Friends_GetClanActivityCounts(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan, int32_t* pnOnline, int32_t* pnInGame, int32_t* pnChatting) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanActivityCounts=_BS_Friends_GetClanActivityCounts@20") return lpSteamFriends->GetClanActivityCounts(*steamIDClan, pnOnline, pnInGame, pnChatting); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanActivityCounts=_BS_Friends_GetClanActivityCounts@20") DLL_FUNCTION(SteamAPICall_t*) BS_Friends_DownloadClanActivityCounts(ISteamFriends* lpSteamFriends, CSteamID* psteamIDClans, int32_t cClansToRequest) { +#pragma comment(linker, "/EXPORT:BS_Friends_DownloadClanActivityCounts=_BS_Friends_DownloadClanActivityCounts@12") return new uint64_t(lpSteamFriends->DownloadClanActivityCounts(psteamIDClans, cClansToRequest)); } -#pragma comment(linker, "/EXPORT:BS_Friends_DownloadClanActivityCounts=_BS_Friends_DownloadClanActivityCounts@12") DLL_FUNCTION(int32_t) BS_Friends_GetFriendCountFromSource(ISteamFriends* lpSteamFriends, CSteamID* steamIDSource) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCountFromSource=_BS_Friends_GetFriendCountFromSource@8") return lpSteamFriends->GetFriendCountFromSource(*steamIDSource); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCountFromSource=_BS_Friends_GetFriendCountFromSource@8") DLL_FUNCTION(CSteamID*) BS_Friends_GetFriendFromSourceByIndex(ISteamFriends* lpSteamFriends, CSteamID* steamIDSource, int32_t iFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendFromSourceByIndex=_BS_Friends_GetFriendFromSourceByIndex@12") return new CSteamID(lpSteamFriends->GetFriendFromSourceByIndex(*steamIDSource, iFriend)); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendFromSourceByIndex=_BS_Friends_GetFriendFromSourceByIndex@12") DLL_FUNCTION(uint32_t) BS_Friends_IsUserInSource(ISteamFriends* lpSteamFriends, CSteamID* steamIDUser, CSteamID* steamIDSource) { +#pragma comment(linker, "/EXPORT:BS_Friends_IsUserInSource=_BS_Friends_IsUserInSource@12") return lpSteamFriends->IsUserInSource(*steamIDUser, *steamIDSource); } -#pragma comment(linker, "/EXPORT:BS_Friends_IsUserInSource=_BS_Friends_IsUserInSource@12") DLL_FUNCTION(void) BS_Friends_SetInGameVoiceSpeaking(ISteamFriends* lpSteamFriends, CSteamID* steamIDUser, uint32_t bSpeaking) { +#pragma comment(linker, "/EXPORT:BS_Friends_SetInGameVoiceSpeaking=_BS_Friends_SetInGameVoiceSpeaking@12") lpSteamFriends->SetInGameVoiceSpeaking(*steamIDUser, bSpeaking != 0); } -#pragma comment(linker, "/EXPORT:BS_Friends_SetInGameVoiceSpeaking=_BS_Friends_SetInGameVoiceSpeaking@12") DLL_FUNCTION(void) BS_Friends_ActivateGameOverlay(ISteamFriends* lpSteamFriends, const char* pchDialog) { +#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlay=_BS_Friends_ActivateGameOverlay@8") lpSteamFriends->ActivateGameOverlay(pchDialog); } -#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlay=_BS_Friends_ActivateGameOverlay@8") DLL_FUNCTION(void) BS_Friends_ActivateGameOverlayToUser(ISteamFriends* lpSteamFriends, const char* pchDialog, CSteamID* steamID) { +#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayToUser=_BS_Friends_ActivateGameOverlayToUser@12") lpSteamFriends->ActivateGameOverlayToUser(pchDialog, *steamID); } -#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayToUser=_BS_Friends_ActivateGameOverlayToUser@12") DLL_FUNCTION(void) BS_Friends_ActivateGameOverlayToWebPage(ISteamFriends* lpSteamFriends, const char* pchURL) { +#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayToWebPage=_BS_Friends_ActivateGameOverlayToWebPage@8") lpSteamFriends->ActivateGameOverlayToWebPage(pchURL); } -#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayToWebPage=_BS_Friends_ActivateGameOverlayToWebPage@8") DLL_FUNCTION(void) BS_Friends_ActivateGameOverlayToStore(ISteamFriends* lpSteamFriends, AppId_t nAppID, EOverlayToStoreFlag eFlag) { +#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayToStore=_BS_Friends_ActivateGameOverlayToStore@12") lpSteamFriends->ActivateGameOverlayToStore(nAppID, eFlag); } -#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayToStore=_BS_Friends_ActivateGameOverlayToStore@12") DLL_FUNCTION(void) BS_Friends_SetPlayedWith(ISteamFriends* lpSteamFriends, CSteamID* steamIDUserPlayedWith) { +#pragma comment(linker, "/EXPORT:BS_Friends_SetPlayedWith=_BS_Friends_SetPlayedWith@8") lpSteamFriends->SetPlayedWith(*steamIDUserPlayedWith); } -#pragma comment(linker, "/EXPORT:BS_Friends_SetPlayedWith=_BS_Friends_SetPlayedWith@8") DLL_FUNCTION(void) BS_Friends_ActivateGameOverlayInviteDialog(ISteamFriends* lpSteamFriends, CSteamID* steamIDLobby) { +#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayInviteDialog=_BS_Friends_ActivateGameOverlayInviteDialog@8") lpSteamFriends->ActivateGameOverlayInviteDialog(*steamIDLobby); } -#pragma comment(linker, "/EXPORT:BS_Friends_ActivateGameOverlayInviteDialog=_BS_Friends_ActivateGameOverlayInviteDialog@8") DLL_FUNCTION(int32_t) BS_Friends_GetSmallFriendAvatar(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetSmallFriendAvatar=_BS_Friends_GetSmallFriendAvatar@8") return lpSteamFriends->GetSmallFriendAvatar(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetSmallFriendAvatar=_BS_Friends_GetSmallFriendAvatar@8") DLL_FUNCTION(int32_t) BS_Friends_GetMediumFriendAvatar(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetMediumFriendAvatar=_BS_Friends_GetMediumFriendAvatar@8") return lpSteamFriends->GetMediumFriendAvatar(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetMediumFriendAvatar=_BS_Friends_GetMediumFriendAvatar@8") DLL_FUNCTION(int32_t) BS_Friends_GetLargeFriendAvatar(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetLargeFriendAvatar=_BS_Friends_GetLargeFriendAvatar@8") return lpSteamFriends->GetLargeFriendAvatar(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetLargeFriendAvatar=_BS_Friends_GetLargeFriendAvatar@8") DLL_FUNCTION(uint32_t) BS_Friends_RequestUserInformation(ISteamFriends* lpSteamFriends, CSteamID* steamIDUser, uint32_t bRequireNameOnly) { +#pragma comment(linker, "/EXPORT:BS_Friends_RequestUserInformation=_BS_Friends_RequestUserInformation@12") return lpSteamFriends->RequestUserInformation(*steamIDUser, bRequireNameOnly != 0); } -#pragma comment(linker, "/EXPORT:BS_Friends_RequestUserInformation=_BS_Friends_RequestUserInformation@12") DLL_FUNCTION(SteamAPICall_t*) BS_Friends_RequestClanOfficerList(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_RequestClanOfficerList=_BS_Friends_RequestClanOfficerList@8") return new uint64_t(lpSteamFriends->RequestClanOfficerList(*steamIDClan)); } -#pragma comment(linker, "/EXPORT:BS_Friends_RequestClanOfficerList=_BS_Friends_RequestClanOfficerList@8") DLL_FUNCTION(CSteamID*) BS_Friends_GetClanOwner(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanOwner=_BS_Friends_GetClanOwner@8") return new CSteamID(lpSteamFriends->GetClanOwner(*steamIDClan)); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanOwner=_BS_Friends_GetClanOwner@8") DLL_FUNCTION(int32_t) BS_Friends_GetClanOfficerCount(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanOfficerCount=_BS_Friends_GetClanOfficerCount@8") return lpSteamFriends->GetClanOfficerCount(*steamIDClan); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanOfficerCount=_BS_Friends_GetClanOfficerCount@8") DLL_FUNCTION(CSteamID*) BS_Friends_GetClanOfficerByIndex(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan, int32_t iOfficer) { - CSteamID* steamID = new CSteamID(lpSteamFriends->GetClanOfficerByIndex(*steamIDClan, iOfficer)); - return steamID; -} #pragma comment(linker, "/EXPORT:BS_Friends_GetClanOfficerByIndex=_BS_Friends_GetClanOfficerByIndex@12") + return new CSteamID(lpSteamFriends->GetClanOfficerByIndex(*steamIDClan, iOfficer)); +} DLL_FUNCTION(EUserRestriction) BS_Friends_GetUserRestrictions(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetUserRestrictions=_BS_Friends_GetUserRestrictions@4") return (EUserRestriction)lpSteamFriends->GetUserRestrictions(); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetUserRestrictions=_BS_Friends_GetUserRestrictions@4") DLL_FUNCTION(uint32_t) BS_Friends_SetRichPresence(ISteamFriends* lpSteamFriends, const char* pchKey, const char* pchValue) { +#pragma comment(linker, "/EXPORT:BS_Friends_SetRichPresence=_BS_Friends_SetRichPresence@12") return lpSteamFriends->SetRichPresence(pchKey, pchValue); } -#pragma comment(linker, "/EXPORT:BS_Friends_SetRichPresence=_BS_Friends_SetRichPresence@12") DLL_FUNCTION(void) BS_Friends_ClearRichPresence(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_ClearRichPresence=_BS_Friends_ClearRichPresence@4") lpSteamFriends->ClearRichPresence(); } -#pragma comment(linker, "/EXPORT:BS_Friends_ClearRichPresence=_BS_Friends_ClearRichPresence@4") DLL_FUNCTION(const char*) BS_Friends_GetFriendRichPresence(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, const char* pchKey) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRichPresence=_BS_Friends_GetFriendRichPresence@12") return lpSteamFriends->GetFriendRichPresence(*steamIDFriend, pchKey); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRichPresence=_BS_Friends_GetFriendRichPresence@12") DLL_FUNCTION(int32_t) BS_Friends_GetFriendRichPresenceKeyCount(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRichPresenceKeyCount=_BS_Friends_GetFriendRichPresenceKeyCount@8") return lpSteamFriends->GetFriendRichPresenceKeyCount(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRichPresenceKeyCount=_BS_Friends_GetFriendRichPresenceKeyCount@8") DLL_FUNCTION(const char*) BS_Friends_GetFriendRichPresenceKeyByIndex(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, int32_t iKey) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRichPresenceKeyByIndex=_BS_Friends_GetFriendRichPresenceKeyByIndex@12") return lpSteamFriends->GetFriendRichPresenceKeyByIndex(*steamIDFriend, iKey); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendRichPresenceKeyByIndex=_BS_Friends_GetFriendRichPresenceKeyByIndex@12") DLL_FUNCTION(void) BS_Friends_RequestFriendRichPresence(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_RequestFriendRichPresence=_BS_Friends_RequestFriendRichPresence@8") lpSteamFriends->RequestFriendRichPresence(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_RequestFriendRichPresence=_BS_Friends_RequestFriendRichPresence@8") DLL_FUNCTION(uint32_t) BS_Friends_InviteUserToGame(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, const char *pchConnectString) { +#pragma comment(linker, "/EXPORT:BS_Friends_InviteUserToGame=_BS_Friends_InviteUserToGame@12") return lpSteamFriends->InviteUserToGame(*steamIDFriend, pchConnectString); } -#pragma comment(linker, "/EXPORT:BS_Friends_InviteUserToGame=_BS_Friends_InviteUserToGame@12") DLL_FUNCTION(int32_t) BS_Friends_GetCoplayFriendCount(ISteamFriends* lpSteamFriends) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetCoplayFriendCount=_BS_Friends_GetCoplayFriendCount@4") return lpSteamFriends->GetCoplayFriendCount(); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetCoplayFriendCount=_BS_Friends_GetCoplayFriendCount@4") DLL_FUNCTION(CSteamID*) BS_Friends_GetCoplayFriend(ISteamFriends* lpSteamFriends, int32_t iCoplayFriend) { - CSteamID* steamID = new CSteamID(lpSteamFriends->GetCoplayFriend(iCoplayFriend)); - return steamID; -} #pragma comment(linker, "/EXPORT:BS_Friends_GetCoplayFriend=_BS_Friends_GetCoplayFriend@8") + return new CSteamID(lpSteamFriends->GetCoplayFriend(iCoplayFriend)); +} DLL_FUNCTION(int32_t) BS_Friends_GetFriendCoplayTime(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCoplayTime=_BS_Friends_GetFriendCoplayTime@8") return lpSteamFriends->GetFriendCoplayTime(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCoplayTime=_BS_Friends_GetFriendCoplayTime@8") DLL_FUNCTION(AppId_t) BS_Friends_GetFriendCoplayGame(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCoplayGame=_BS_Friends_GetFriendCoplayGame@8") return lpSteamFriends->GetFriendCoplayGame(*steamIDFriend); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendCoplayGame=_BS_Friends_GetFriendCoplayGame@8") DLL_FUNCTION(SteamAPICall_t*) BS_Friends_JoinClanChatRoom(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { - return new uint64_t(lpSteamFriends->JoinClanChatRoom(*steamIDClan)); -} #pragma comment(linker, "/EXPORT:BS_Friends_JoinClanChatRoom=_BS_Friends_JoinClanChatRoom@8") + return new SteamAPICall_t(lpSteamFriends->JoinClanChatRoom(*steamIDClan)); +} DLL_FUNCTION(uint32_t) BS_Friends_LeaveClanChatRoom(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_LeaveClanChatRoom=_BS_Friends_LeaveClanChatRoom@8") return lpSteamFriends->LeaveClanChatRoom(*steamIDClan); } -#pragma comment(linker, "/EXPORT:BS_Friends_LeaveClanChatRoom=_BS_Friends_LeaveClanChatRoom@8") DLL_FUNCTION(int32_t) BS_Friends_GetClanChatMemberCount(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanChatMemberCount=_BS_Friends_GetClanChatMemberCount@8") return lpSteamFriends->GetClanChatMemberCount(*steamIDClan); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanChatMemberCount=_BS_Friends_GetClanChatMemberCount@8") DLL_FUNCTION(CSteamID*) BS_Friends_GetChatMemberByIndex(ISteamFriends* lpSteamFriends, CSteamID* steamIDClan, int32_t iUser) { - CSteamID* steamID = new CSteamID(lpSteamFriends->GetChatMemberByIndex(*steamIDClan, iUser)); - return steamID; -} #pragma comment(linker, "/EXPORT:BS_Friends_GetChatMemberByIndex=_BS_Friends_GetChatMemberByIndex@12") + return new CSteamID(lpSteamFriends->GetChatMemberByIndex(*steamIDClan, iUser)); +} DLL_FUNCTION(uint32_t) BS_Friends_SendClanChatMessage(ISteamFriends* lpSteamFriends, CSteamID* steamIDClanChat, const char *pchText) { +#pragma comment(linker, "/EXPORT:BS_Friends_SendClanChatMessage=_BS_Friends_SendClanChatMessage@12") return lpSteamFriends->SendClanChatMessage(*steamIDClanChat, pchText); } -#pragma comment(linker, "/EXPORT:BS_Friends_SendClanChatMessage=_BS_Friends_SendClanChatMessage@12") DLL_FUNCTION(int32_t) BS_Friends_GetClanChatMessage(ISteamFriends* lpSteamFriends, CSteamID* steamIDClanChat, int32_t iMessage, void* prgchText, int32_t cchTextMax, EChatEntryType* peChatEntryType, CSteamID* psteamidChatter) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetClanChatMessage=_BS_Friends_GetClanChatMessage@28") return lpSteamFriends->GetClanChatMessage(*steamIDClanChat, iMessage, prgchText, cchTextMax, peChatEntryType, psteamidChatter); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetClanChatMessage=_BS_Friends_GetClanChatMessage@28") DLL_FUNCTION(uint32_t) BS_Friends_IsClanChatAdmin(ISteamFriends* lpSteamFriends, CSteamID* steamIDClanChat, CSteamID* steamIDUser) { +#pragma comment(linker, "/EXPORT:BS_Friends_IsClanChatAdmin=_BS_Friends_IsClanChatAdmin@12") return lpSteamFriends->IsClanChatAdmin(*steamIDClanChat, *steamIDUser); } -#pragma comment(linker, "/EXPORT:BS_Friends_IsClanChatAdmin=_BS_Friends_IsClanChatAdmin@12") DLL_FUNCTION(uint32_t) BS_Friends_IsClanChatWindowOpenInSteam(ISteamFriends* lpSteamFriends, CSteamID* steamIDClanChat) { +#pragma comment(linker, "/EXPORT:BS_Friends_IsClanChatWindowOpenInSteam=_BS_Friends_IsClanChatWindowOpenInSteam@8") return lpSteamFriends->IsClanChatWindowOpenInSteam(*steamIDClanChat); } -#pragma comment(linker, "/EXPORT:BS_Friends_IsClanChatWindowOpenInSteam=_BS_Friends_IsClanChatWindowOpenInSteam@8") DLL_FUNCTION(uint32_t) BS_Friends_OpenClanChatWindowInSteam(ISteamFriends* lpSteamFriends, CSteamID* steamIDClanChat) { +#pragma comment(linker, "/EXPORT:BS_Friends_OpenClanChatWindowInSteam=_BS_Friends_OpenClanChatWindowInSteam@8") return lpSteamFriends->OpenClanChatWindowInSteam(*steamIDClanChat); } -#pragma comment(linker, "/EXPORT:BS_Friends_OpenClanChatWindowInSteam=_BS_Friends_OpenClanChatWindowInSteam@8") DLL_FUNCTION(uint32_t) BS_Friends_CloseClanChatWindowInSteam(ISteamFriends* lpSteamFriends, CSteamID* steamIDClanChat) { +#pragma comment(linker, "/EXPORT:BS_Friends_CloseClanChatWindowInSteam=_BS_Friends_CloseClanChatWindowInSteam@8") return lpSteamFriends->CloseClanChatWindowInSteam(*steamIDClanChat); } -#pragma comment(linker, "/EXPORT:BS_Friends_CloseClanChatWindowInSteam=_BS_Friends_CloseClanChatWindowInSteam@8") DLL_FUNCTION(uint32_t) BS_Friends_SetListenForFriendsMessages(ISteamFriends* lpSteamFriends, uint32_t bInterceptEnabled) { +#pragma comment(linker, "/EXPORT:BS_Friends_SetListenForFriendsMessages=_BS_Friends_SetListenForFriendsMessages@8") return lpSteamFriends->SetListenForFriendsMessages(bInterceptEnabled != 0); } -#pragma comment(linker, "/EXPORT:BS_Friends_SetListenForFriendsMessages=_BS_Friends_SetListenForFriendsMessages@8") DLL_FUNCTION(uint32_t) BS_Friends_ReplyToFriendMessage(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, const char* pchMsgToSend) { +#pragma comment(linker, "/EXPORT:BS_Friends_ReplyToFriendMessage=_BS_Friends_ReplyToFriendMessage@12") return lpSteamFriends->ReplyToFriendMessage(*steamIDFriend, pchMsgToSend); } -#pragma comment(linker, "/EXPORT:BS_Friends_ReplyToFriendMessage=_BS_Friends_ReplyToFriendMessage@12") DLL_FUNCTION(int32_t) BS_Friends_GetFriendMessage(ISteamFriends* lpSteamFriends, CSteamID* steamIDFriend, int32_t iMessageID, void* pvData, int32_t cubData, EChatEntryType* peChatEntryType) { +#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendMessage=_BS_Friends_GetFriendMessage@24") return lpSteamFriends->GetFriendMessage(*steamIDFriend, iMessageID, pvData, cubData, peChatEntryType); } -#pragma comment(linker, "/EXPORT:BS_Friends_GetFriendMessage=_BS_Friends_GetFriendMessage@24") DLL_FUNCTION(SteamAPICall_t*) BS_Friends_GetFollowerCount(ISteamFriends* lpSteamFriends, CSteamID* steamID) { - return new uint64_t(lpSteamFriends->GetFollowerCount(*steamID)); -} #pragma comment(linker, "/EXPORT:BS_Friends_GetFollowerCount=_BS_Friends_GetFollowerCount@8") + return new SteamAPICall_t(lpSteamFriends->GetFollowerCount(*steamID)); +} DLL_FUNCTION(SteamAPICall_t*) BS_Friends_IsFollowing(ISteamFriends* lpSteamFriends, CSteamID* steamID) { - return new uint64_t(lpSteamFriends->IsFollowing(*steamID)); -} #pragma comment(linker, "/EXPORT:BS_Friends_IsFollowing=_BS_Friends_IsFollowing@8") + return new SteamAPICall_t(lpSteamFriends->IsFollowing(*steamID)); +} DLL_FUNCTION(SteamAPICall_t*) BS_Friends_EnumerateFollowingList(ISteamFriends* lpSteamFriends, uint32_t unStartIndex) { - return new uint64_t(lpSteamFriends->EnumerateFollowingList(unStartIndex)); -} #pragma comment(linker, "/EXPORT:BS_Friends_EnumerateFollowingList=_BS_Friends_EnumerateFollowingList@8") + return new SteamAPICall_t(lpSteamFriends->EnumerateFollowingList(unStartIndex)); +} diff --git a/Wrapper/SteamGameServer.cpp b/Wrapper/SteamGameServer.cpp index a03f49e..f9da0c3 100644 --- a/Wrapper/SteamGameServer.cpp +++ b/Wrapper/SteamGameServer.cpp @@ -16,42 +16,42 @@ #include "BlitzSteam.h" +DLL_FUNCTION(uint32_t) BS_SteamGameServer_Init(uint32_t unIP, uint16_t usSteamPort, uint16_t usGamePort, uint16_t usQueryPort, EServerMode eServerMode, const char *pchVersionString) { +#pragma comment(linker, "/EXPORT:BS_SteamGameServer_Init=_BS_SteamGameServer_Init@24") + return SteamGameServer_Init(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString); +} + +DLL_FUNCTION(void) BS_SteamGameServer_Shutdown() { +#pragma comment(linker, "/EXPORT:BS_SteamGameServer_Shutdown=_BS_SteamGameServer_Shutdown@0") + SteamGameServer_Shutdown(); +} + +DLL_FUNCTION(void) BS_SteamGameServer_RunCallbacks() { +#pragma comment(linker, "/EXPORT:BS_SteamGameServer_RunCallbacks=_BS_SteamGameServer_RunCallbacks@0") + SteamGameServer_RunCallbacks(); +} + +DLL_FUNCTION(HSteamPipe) BS_SteamGameServer_GetHSteamPipe() { +#pragma comment(linker, "/EXPORT:BS_SteamGameServer_GetHSteamPipe=_BS_SteamGameServer_GetHSteamPipe@0") + return SteamGameServer_GetHSteamPipe(); +} + +DLL_FUNCTION(uint32_t) BS_SteamGameServer_IsSecure() { +#pragma comment(linker, "/EXPORT:BS_SteamGameServer_IsSecure=_BS_SteamGameServer_IsSecure@0") + return SteamGameServer_BSecure(); +} + +DLL_FUNCTION(CSteamID*) BS_SteamGameServer_GetSteamID() { +#pragma comment(linker, "/EXPORT:BS_SteamGameServer_GetSteamID=_BS_SteamGameServer_GetSteamID@0") + return new CSteamID(SteamGameServer_GetSteamID()); +} + +// ISteamGameServer Stuff DLL_FUNCTION(ISteamGameServer*) BS_GameServer() { #pragma comment(linker, "/EXPORT:BS_GameServer=_BS_GameServer@0") return SteamGameServer(); } -DLL_FUNCTION(uint32_t) BS_GameServer_Init(uint32_t unIP, uint16_t usSteamPort, uint16_t usGamePort, uint16_t usQueryPort, EServerMode eServerMode, const char *pchVersionString) { -#pragma comment(linker, "/EXPORT:BS_GameServer_Init=_BS_GameServer_Init@24") - return SteamGameServer_Init(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString); -} - -DLL_FUNCTION(void) BS_GameServer_Shutdown() { -#pragma comment(linker, "/EXPORT:BS_GameServer_Shutdown=_BS_GameServer_Shutdown@0") - SteamGameServer_Shutdown(); -} - -DLL_FUNCTION(void) BS_GameServer_RunCallbacks() { -#pragma comment(linker, "/EXPORT:BS_GameServer_RunCallbacks=_BS_GameServer_RunCallbacks@0") - SteamGameServer_RunCallbacks(); -} - -DLL_FUNCTION(HSteamPipe) BS_GameServer_GetHSteamPipe() { -#pragma comment(linker, "/EXPORT:BS_GameServer_GetHSteamPipe=_BS_GameServer_GetHSteamPipe@0") - return SteamGameServer_GetHSteamPipe(); -} - -DLL_FUNCTION(uint32_t) BS_GameServer_IsSecureC() { -#pragma comment(linker, "/EXPORT:BS_GameServer_IsSecureC=_BS_GameServer_IsSecureC@0") - return SteamGameServer_BSecure(); -} - -DLL_FUNCTION(CSteamID*) BS_GameServer_GetSteamIDC() { -#pragma comment(linker, "/EXPORT:BS_GameServer_GetSteamIDC=_BS_GameServer_GetSteamIDC@0") - return new CSteamID(SteamGameServer_GetSteamID()); -} - -// ISteamGameServer Stuff DLL_FUNCTION(uint32_t) BS_GameServer_InitGameServer(ISteamGameServer* pSteamGameServer, uint32_t unIP, uint16_t usGamePort, uint16_t usQueryPort, uint32_t unFlags, AppId_t nGameAppId, const char *pchVersionString) { #pragma comment(linker, "/EXPORT:BS_GameServer_InitGameServer=_BS_GameServer_InitGameServer@28") return pSteamGameServer->InitGameServer(unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString); @@ -264,10 +264,10 @@ DLL_FUNCTION(void) BS_GameServer_ForceHeartbeat(ISteamGameServer* pSteamGameServ DLL_FUNCTION(SteamAPICall_t*) BS_GameServer_AssociateWithClan(ISteamGameServer* pSteamGameServer, CSteamID* pSteamIDClan) { #pragma comment(linker, "/EXPORT:BS_GameServer_AssociateWithClan=_BS_GameServer_AssociateWithClan@8") - return new uint64_t(pSteamGameServer->AssociateWithClan(*pSteamIDClan)); + return new SteamAPICall_t(pSteamGameServer->AssociateWithClan(*pSteamIDClan)); } DLL_FUNCTION(SteamAPICall_t*) BS_GameServer_ComputeNewPlayerCompatibility(ISteamGameServer* pSteamGameServer, CSteamID* pSteamIDNewPlayer) { #pragma comment(linker, "/EXPORT:BS_GameServer_ComputeNewPlayerCompatibility=_BS_GameServer_ComputeNewPlayerCompatibility@8") - return new uint64_t(pSteamGameServer->ComputeNewPlayerCompatibility(*pSteamIDNewPlayer)); + return new SteamAPICall_t(pSteamGameServer->ComputeNewPlayerCompatibility(*pSteamIDNewPlayer)); } \ No newline at end of file diff --git a/Wrapper/SteamGameServerStats.cpp b/Wrapper/SteamGameServerStats.cpp index bfa0799..715af19 100644 --- a/Wrapper/SteamGameServerStats.cpp +++ b/Wrapper/SteamGameServerStats.cpp @@ -22,42 +22,52 @@ DLL_FUNCTION(ISteamGameServerStats*) BS_GameServerStats() { } DLL_FUNCTION(SteamAPICall_t*) BS_GameServerStats_RequestUserStats(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser) { - return new uint64_t(pSteamGameServerStats->RequestUserStats(*steamIDUser)); +#pragma comment(linker, "/EXPORT:BS_GameServerStats_RequestUserStats=_BS_GameServerStats_RequestUserStats@8") + return new SteamAPICall_t(pSteamGameServerStats->RequestUserStats(*steamIDUser)); } DLL_FUNCTION(SteamAPICall_t*) BS_GameServerStats_StoreUserStats(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser) { - return new uint64_t(pSteamGameServerStats->StoreUserStats(*steamIDUser)); +#pragma comment(linker, "/EXPORT:BS_GameServerStats_StoreUserStats=_BS_GameServerStats_StoreUserStats@8") + return new SteamAPICall_t(pSteamGameServerStats->StoreUserStats(*steamIDUser)); } DLL_FUNCTION(uint32_t) BS_GameServerStats_GetUserStat(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName, uint32_t* pData) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_GetUserStat=_BS_GameServerStats_GetUserStat@16") return pSteamGameServerStats->GetUserStat(*steamIDUser, pchName, (int32_t*)pData); } DLL_FUNCTION(uint32_t) BS_GameServerStats_GetUserStatF(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName, float_t* pData) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_GetUserStatF=_BS_GameServerStats_GetUserStatF@16") return pSteamGameServerStats->GetUserStat(*steamIDUser, pchName, pData); } DLL_FUNCTION(uint32_t) BS_GameServerStats_GetUserAchievement(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName, uint32_t* pbAchieved) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_GetUserAchievement=_BS_GameServerStats_GetUserAchievement@16") return pSteamGameServerStats->GetUserAchievement(*steamIDUser, pchName, (bool*)pbAchieved); } DLL_FUNCTION(uint32_t) BS_GameServerStats_SetUserStat(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName, uint32_t nData) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_SetUserStat=_BS_GameServerStats_SetUserStat@16") return pSteamGameServerStats->SetUserStat(*steamIDUser, pchName, (int32_t)nData); } DLL_FUNCTION(uint32_t) BS_GameServerStats_SetUserStatF(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName, float_t fData) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_SetUserStatF=_BS_GameServerStats_SetUserStatF@16") return pSteamGameServerStats->SetUserStat(*steamIDUser, pchName, fData); } DLL_FUNCTION(uint32_t) BS_GameServerStats_UpdateUserAvgRateStat(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char *pchName, float flCountThisSession, double* pdSessionLength) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_UpdateUserAvgRateStat=_BS_GameServerStats_UpdateUserAvgRateStat@20") return pSteamGameServerStats->UpdateUserAvgRateStat(*steamIDUser, pchName, flCountThisSession, *pdSessionLength); } DLL_FUNCTION(uint32_t) BS_GameServerStats_SetUserAchievement(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_SetUserAchievement=_BS_GameServerStats_SetUserAchievement@12") return pSteamGameServerStats->SetUserAchievement(*steamIDUser, pchName); } DLL_FUNCTION(uint32_t) BS_GameServerStats_ClearUserAchievement(ISteamGameServerStats* pSteamGameServerStats, CSteamID* steamIDUser, const char* pchName) { +#pragma comment(linker, "/EXPORT:BS_GameServerStats_ClearUserAchievement=_BS_GameServerStats_ClearUserAchievement@12") return pSteamGameServerStats->ClearUserAchievement(*steamIDUser, pchName); } diff --git a/Wrapper/SteamHTMLSurface.cpp b/Wrapper/SteamHTMLSurface.cpp index 756e8ef..3fbb3ae 100644 --- a/Wrapper/SteamHTMLSurface.cpp +++ b/Wrapper/SteamHTMLSurface.cpp @@ -15,9 +15,231 @@ // along with this program. If not, see . #include "BlitzSteam.h" +#include "SteamworksSDK/public/steam/isteamhtmlsurface.h" DLL_FUNCTION(ISteamHTMLSurface*) BS_HTMLSurface() { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface=_BS_HTMLSurface@0") return SteamHTMLSurface(); } -#pragma comment(linker, "/EXPORT:BS_HTMLSurface=_BS_HTMLSurface@0") +// Must call init and shutdown when starting/ending use of the interface +DLL_FUNCTION(uint32_t) BS_HTMLSurface_Init(ISteamHTMLSurface* pSteamHTMLSurface) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_Init=_BS_HTMLSurface_Init@4") + return pSteamHTMLSurface->Init(); +} + +DLL_FUNCTION(uint32_t) BS_HTMLSurface_Shutdown(ISteamHTMLSurface* pSteamHTMLSurface) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_Shutdown=_BS_HTMLSurface_Shutdown@4") + return pSteamHTMLSurface->Shutdown(); +} + +// Create a browser object for display of a html page, when creation is complete the call handle +// will return a HTML_BrowserReady_t callback for the HHTMLBrowser of your new browser. +// The user agent string is a substring to be added to the general user agent string so you can +// identify your client on web servers. +// The userCSS string lets you apply a CSS style sheet to every displayed page, leave null if +// you do not require this functionality. +DLL_FUNCTION(SteamAPICall_t*) BS_HTMLSurface_CreateBrowser(ISteamHTMLSurface* pSteamHTMLSurface, const char* pchUserAgent, const char* pchUserCSS) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_CreateBrowser=_BS_HTMLSurface_CreateBrowser@12") + return new SteamAPICall_t(pSteamHTMLSurface->CreateBrowser(pchUserAgent, pchUserCSS)); +} + +// Call this when you are done with a html surface, this lets us free the resources being used by it +DLL_FUNCTION(void) BS_HTMLSurface_RemoveBrowser(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_RemoveBrowser=_BS_HTMLSurface_RemoveBrowser@8") + pSteamHTMLSurface->RemoveBrowser(unBrowserHandle); +} + +// Navigate to this URL, results in a HTML_StartRequest_t as the request commences +DLL_FUNCTION(void) BS_HTMLSurface_LoadURL(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchURL, const char* pchPostData) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_LoadURL=_BS_HTMLSurface_LoadURL@16") + pSteamHTMLSurface->LoadURL(unBrowserHandle, pchURL, pchPostData); +} + +// Tells the surface the size in pixels to display the surface +DLL_FUNCTION(void) BS_HTMLSurface_SetSize(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32_t unWidth, uint32_t unHeight) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetSize=_BS_HTMLSurface_SetSize@16") + pSteamHTMLSurface->SetSize(unBrowserHandle, unWidth, unHeight); +} + +// Stop the load of the current html page +DLL_FUNCTION(void) BS_HTMLSurface_StopLoad(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_StopLoad=_BS_HTMLSurface_StopLoad@8") + pSteamHTMLSurface->StopLoad(unBrowserHandle); +} + +// Reload (most likely from local cache) the current page +DLL_FUNCTION(void) BS_HTMLSurface_Reload(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_Reload=_BS_HTMLSurface_Reload@8") + pSteamHTMLSurface->Reload(unBrowserHandle); +} + +// navigate back in the page history +DLL_FUNCTION(void) BS_HTMLSurface_GoBack(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_GoBack=_BS_HTMLSurface_GoBack@8") + pSteamHTMLSurface->GoBack(unBrowserHandle); +} + +// navigate forward in the page history +DLL_FUNCTION(void) BS_HTMLSurface_GoForward(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_GoForward=_BS_HTMLSurface_GoForward@8") + pSteamHTMLSurface->GoForward(unBrowserHandle); +} + +// add this header to any url requests from this browser +DLL_FUNCTION(void) BS_HTMLSurface_AddHeader(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchKey, const char* pchValue) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_AddHeader=_BS_HTMLSurface_AddHeader@16") + pSteamHTMLSurface->AddHeader(unBrowserHandle, pchKey, pchValue); +} + +// run this javascript script in the currently loaded page +DLL_FUNCTION(void) BS_HTMLSurface_ExecuteJavascript(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchScript) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_ExecuteJavascript=_BS_HTMLSurface_ExecuteJavascript@12") + pSteamHTMLSurface->ExecuteJavascript(unBrowserHandle, pchScript); +} + +// Mouse click and mouse movement commands +DLL_FUNCTION(void) BS_HTMLSurface_MouseUp(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_MouseUp=_BS_HTMLSurface_MouseUp@12") + pSteamHTMLSurface->MouseUp(unBrowserHandle, eMouseButton); +} + +DLL_FUNCTION(void) BS_HTMLSurface_MouseDown(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_MouseDown=_BS_HTMLSurface_MouseDown@12") + pSteamHTMLSurface->MouseDown(unBrowserHandle, eMouseButton); +} + +DLL_FUNCTION(void) BS_HTMLSurface_MouseDoubleClick(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_MouseDoubleClick=_BS_HTMLSurface_MouseDoubleClick@12") + pSteamHTMLSurface->MouseDoubleClick(unBrowserHandle, eMouseButton); +} + +// x and y are relative to the HTML bounds +DLL_FUNCTION(void) BS_HTMLSurface_MouseMove(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int32_t x, int32_t y) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_MouseMove=_BS_HTMLSurface_MouseMove@16") + pSteamHTMLSurface->MouseMove(unBrowserHandle, x, y); +} + +// nDelta is pixels of scroll +DLL_FUNCTION(void) BS_HTMLSurface_MouseWheel(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int32_t nDelta) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_MouseWheel=_BS_HTMLSurface_MouseWheel@12") + pSteamHTMLSurface->MouseWheel(unBrowserHandle, nDelta); +} + +// keyboard interactions, native keycode is the virtual key code value from your OS +DLL_FUNCTION(void) BS_HTMLSurface_KeyDown(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_KeyDown=_BS_HTMLSurface_KeyDown@16") + pSteamHTMLSurface->KeyDown(unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); +} + +DLL_FUNCTION(void) BS_HTMLSurface_KeyUp(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_KeyUp=_BS_HTMLSurface_KeyUp@16") + pSteamHTMLSurface->KeyUp(unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); +} + +// cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press) +DLL_FUNCTION(void) BS_HTMLSurface_KeyChar(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_KeyChar=_BS_HTMLSurface_KeyChar@16") + pSteamHTMLSurface->KeyChar(unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); +} + +// programmatically scroll this many pixels on the page +DLL_FUNCTION(void) BS_HTMLSurface_SetHorizontalScroll(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetHorizontalScroll=_BS_HTMLSurface_SetHorizontalScroll@12") + pSteamHTMLSurface->SetHorizontalScroll(unBrowserHandle, nAbsolutePixelScroll); +} + +DLL_FUNCTION(void) BS_HTMLSurface_SetVerticalScroll(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetVerticalScroll=_BS_HTMLSurface_SetVerticalScroll@12") + pSteamHTMLSurface->SetVerticalScroll(unBrowserHandle, nAbsolutePixelScroll); +} + +// tell the html control if it has key focus currently, controls showing the I-beam cursor in text controls amongst other things +DLL_FUNCTION(void) BS_HTMLSurface_SetKeyFocus(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bHasKeyFocus) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetKeyFocus=_BS_HTMLSurface_SetKeyFocus@12") + pSteamHTMLSurface->SetKeyFocus(unBrowserHandle, bHasKeyFocus); +} + +// open the current pages html code in the local editor of choice, used for debugging +DLL_FUNCTION(void) BS_HTMLSurface_ViewSource(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_ViewSource=_BS_HTMLSurface_ViewSource@8") + pSteamHTMLSurface->ViewSource(unBrowserHandle); +} + +// copy the currently selected text on the html page to the local clipboard +DLL_FUNCTION(void) BS_HTMLSurface_CopyToClipboard(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_CopyToClipboard=_BS_HTMLSurface_CopyToClipboard@8") + pSteamHTMLSurface->CopyToClipboard(unBrowserHandle); +} + +// paste from the local clipboard to the current html page +DLL_FUNCTION(void) BS_HTMLSurface_PasteFromClipboard(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_PasteFromClipboard=_BS_HTMLSurface_PasteFromClipboard@8") + pSteamHTMLSurface->PasteFromClipboard(unBrowserHandle); +} + +// find this string in the browser, if bCurrentlyInFind is true then instead cycle to the next matching element +DLL_FUNCTION(void) BS_HTMLSurface_Find(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_Find=_BS_HTMLSurface_Find@20") + pSteamHTMLSurface->Find(unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse); +} + +// cancel a currently running find +DLL_FUNCTION(void) BS_HTMLSurface_StopFind(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_StopFind=_BS_HTMLSurface_StopFind@8") + pSteamHTMLSurface->StopFind(unBrowserHandle); +} + +// return details about the link at position x,y on the current page +DLL_FUNCTION(void) BS_HTMLSurface_GetLinkAtPosition(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int x, int y) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_GetLinkAtPosition=_BS_HTMLSurface_GetLinkAtPosition@16") + pSteamHTMLSurface->GetLinkAtPosition(unBrowserHandle, x, y); +} + +// set a webcookie for the hostname in question +DLL_FUNCTION(void) BS_HTMLSurface_SetCookie(ISteamHTMLSurface* pSteamHTMLSurface, const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath, RTime32 nExpires, bool bSecure, bool bHTTPOnly) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetCookie=_BS_HTMLSurface_SetCookie@32") + pSteamHTMLSurface->SetCookie(pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly); +} + +// Zoom the current page by flZoom ( from 0.0 to 2.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care) +DLL_FUNCTION(void) BS_HTMLSurface_SetPageScaleFactor(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetPageScaleFactor=_BS_HTMLSurface_SetPageScaleFactor@20") + pSteamHTMLSurface->SetPageScaleFactor(unBrowserHandle, flZoom, nPointX, nPointY); +} + +// Enable/disable low-resource background mode, where javascript and repaint timers are throttled, resources are +// more aggressively purged from memory, and audio/video elements are paused. When background mode is enabled, +// all HTML5 video and audio objects will execute ".pause()" and gain the property "._steam_background_paused = 1". +// When background mode is disabled, any video or audio objects with that property will resume with ".play()". +DLL_FUNCTION(void) BS_HTMLSurface_SetBackgroundMode(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bBackgroundMode) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_SetBackgroundMode=_BS_HTMLSurface_SetBackgroundMode@12") + pSteamHTMLSurface->SetBackgroundMode(unBrowserHandle, bBackgroundMode); +} + +// CALLBACKS +// +// These set of functions are used as responses to callback requests +// + +// You MUST call this in response to a HTML_StartRequest_t callback +// Set bAllowed to true to allow this navigation, false to cancel it and stay +// on the current page. You can use this feature to limit the valid pages +// allowed in your HTML surface. +DLL_FUNCTION(void) BS_HTMLSurface_AllowStartRequest(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bAllowed) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_AllowStartRequest=_BS_HTMLSurface_AllowStartRequest@12") + pSteamHTMLSurface->AllowStartRequest(unBrowserHandle, bAllowed); +} + +// You MUST call this in response to a HTML_JSAlert_t or HTML_JSConfirm_t callback +// Set bResult to true for the OK option of a confirm, use false otherwise +DLL_FUNCTION(void) BS_HTMLSurface_JSDialogResponse(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bResult) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_JSDialogResponse=_BS_HTMLSurface_JSDialogResponse@12") + pSteamHTMLSurface->JSDialogResponse(unBrowserHandle, bResult); +} + +// You MUST call this in response to a HTML_FileOpenDialog_t callback +DLL_FUNCTION(void) BS_HTMLSurface_FileLoadDialogResponse(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles) { +#pragma comment(linker, "/EXPORT:BS_HTMLSurface_FileLoadDialogResponse=_BS_HTMLSurface_FileLoadDialogResponse@12") + pSteamHTMLSurface->FileLoadDialogResponse(unBrowserHandle, pchSelectedFiles); +} \ No newline at end of file diff --git a/Wrapper/SteamMatchmakingServer.cpp b/Wrapper/SteamMatchmakingServer.cpp deleted file mode 100644 index a926027..0000000 --- a/Wrapper/SteamMatchmakingServer.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// BlitzSteam - Steam wrapper for Blitz -// Copyright (C) 2015 Xaymar (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 . - -#include "BlitzSteam.h" - -DLL_FUNCTION(ISteamMatchmakingServers*) BS_MatchmakingServers() { - return SteamMatchmakingServers(); -} -#pragma comment(linker, "/EXPORT:BS_MatchmakingServers=_BS_MatchmakingServers@0") - diff --git a/Wrapper/SteamMatchmakingServers.cpp b/Wrapper/SteamMatchmakingServers.cpp new file mode 100644 index 0000000..adc8c9e --- /dev/null +++ b/Wrapper/SteamMatchmakingServers.cpp @@ -0,0 +1,95 @@ +// BlitzSteam - Steam wrapper for Blitz +// Copyright (C) 2015 Xaymar (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 . + +#include "BlitzSteam.h" + +DLL_FUNCTION(ISteamMatchmakingServers*) BS_MatchmakingServers() { +#pragma comment(linker, "/EXPORT:BS_MatchmakingServers=_BS_MatchmakingServers@0") + return SteamMatchmakingServers(); +} + +DLL_FUNCTION(HServerListRequest) BS_MathmakingServers_RequestInternetServerList(AppId_t iApp, MatchMakingKeyValuePair_t** ppkvFilter, uint32_t nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) { + return SteamMatchmakingServers()->RequestInternetServerList(iApp, ppkvFilter, nFilters, pRequestServersResponse); +} +/*DLL_FUNCTION(HServerListRequest) BS_MathmakingServers_RequestLANServerList(AppId_t iApp, const char** ppchFilters, uint32_t nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) { + //return SteamMatchmakingServers()->RequestLANServerList(iApp); +} +DLL_FUNCTION(HServerListRequest) BS_MathmakingServers_RequestFriendsServerList(AppId_t iApp, const char** ppchFilters, uint32_t nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) { + +} +DLL_FUNCTION(HServerListRequest) BS_MathmakingServers_RequestFavoritesServerList(AppId_t iApp, const char** ppchFilters, uint32_t nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) { + +} +DLL_FUNCTION(HServerListRequest) BS_MathmakingServers_RequestHistoryServerList(AppId_t iApp, const char** ppchFilters, uint32_t nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) { + +} +DLL_FUNCTION(HServerListRequest) BS_MathmakingServers_RequestSpectatorServerList(AppId_t iApp, const char** ppchFilters, uint32_t nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) { + +}*/ + +// +// +//// Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. +//// RefreshComplete callback is not posted when request is released. +//virtual void ReleaseRequest( HServerListRequest hServerListRequest ) = 0; +// +//// Get details on a given server in the list, you can get the valid range of index +//// values by calling GetServerCount(). You will also receive index values in +//// ISteamMatchmakingServerListResponse::ServerResponded() callbacks +//virtual gameserveritem_t *GetServerDetails( HServerListRequest hRequest, int iServer ) = 0; +// +//// Cancel an request which is operation on the given list type. You should call this to cancel +//// any in-progress requests before destructing a callback object that may have been passed +//// to one of the above list request calls. Not doing so may result in a crash when a callback +//// occurs on the destructed object. +//// Canceling a query does not release the allocated request handle. +//// The request handle must be released using ReleaseRequest( hRequest ) +//virtual void CancelQuery( HServerListRequest hRequest ) = 0; +// +//// Ping every server in your list again but don't update the list of servers +//// Query callback installed when the server list was requested will be used +//// again to post notifications and RefreshComplete, so the callback must remain +//// valid until another RefreshComplete is called on it or the request +//// is released with ReleaseRequest( hRequest ) +//virtual void RefreshQuery( HServerListRequest hRequest ) = 0; +// +//// Returns true if the list is currently refreshing its server list +//virtual bool IsRefreshing( HServerListRequest hRequest ) = 0; +// +//// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1 +//virtual int GetServerCount( HServerListRequest hRequest ) = 0; +// +//// Refresh a single server inside of a query (rather than all the servers ) +//virtual void RefreshServer( HServerListRequest hRequest, int iServer ) = 0; +// +// +////----------------------------------------------------------------------------- +//// Queries to individual servers directly via IP/Port +////----------------------------------------------------------------------------- +// +//// Request updated ping time and other details from a single server +//virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0; +// +//// Request the list of players currently playing on a server +//virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0; +// +//// Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side) +//virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0; +// +//// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel +//// any in-progress requests before destructing a callback object that may have been passed +//// to one of the above calls to avoid crashing when callbacks occur. +//virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0; \ No newline at end of file