This commit is contained in:
Michael Fabian Dirks
2016-03-11 14:13:25 +01:00
parent 2bf8361797
commit a52326d80a
60 changed files with 2776 additions and 1059 deletions
-1
View File
@@ -15,7 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "BlitzSteam.h"
#include "Helpers\BlitzCallback.h"
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
// Steam API setup & shutdown
+35 -35
View File
@@ -22,11 +22,11 @@ DLL_FUNCTION(ISteamHTMLSurface*) BS_SteamHTMLSurface() {
}
// Must call init and shutdown when starting/ending use of the interface
DLL_FUNCTION(uint32_t) BS_SteamHTMLSurface_Init(ISteamHTMLSurface* pSteamHTMLSurface) {
DLL_FUNCTION(uint32_t) BS_ISteamHTMLSurface_Init(ISteamHTMLSurface* pSteamHTMLSurface) {
return pSteamHTMLSurface->Init();
}
DLL_FUNCTION(uint32_t) BS_SteamHTMLSurface_Shutdown(ISteamHTMLSurface* pSteamHTMLSurface) {
DLL_FUNCTION(uint32_t) BS_ISteamHTMLSurface_Shutdown(ISteamHTMLSurface* pSteamHTMLSurface) {
return pSteamHTMLSurface->Shutdown();
}
@@ -36,143 +36,143 @@ DLL_FUNCTION(uint32_t) BS_SteamHTMLSurface_Shutdown(ISteamHTMLSurface* pSteamHTM
// 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_SteamHTMLSurface_CreateBrowser(ISteamHTMLSurface* pSteamHTMLSurface, const char* pchUserAgent, const char* pchUserCSS) {
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamHTMLSurface_CreateBrowser(ISteamHTMLSurface* pSteamHTMLSurface, const char* pchUserAgent, const char* pchUserCSS) {
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_SteamHTMLSurface_RemoveBrowser(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_RemoveBrowser(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->RemoveBrowser(unBrowserHandle);
}
// Navigate to this URL, results in a HTML_StartRequest_t as the request commences
DLL_FUNCTION(void) BS_SteamHTMLSurface_LoadURL(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchURL, const char* pchPostData) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_LoadURL(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchURL, const char* pchPostData) {
pSteamHTMLSurface->LoadURL(unBrowserHandle, pchURL, pchPostData);
}
// Tells the surface the size in pixels to display the surface
DLL_FUNCTION(void) BS_SteamHTMLSurface_SetSize(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32_t unWidth, uint32_t unHeight) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetSize(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32_t unWidth, uint32_t unHeight) {
pSteamHTMLSurface->SetSize(unBrowserHandle, unWidth, unHeight);
}
// Stop the load of the current html page
DLL_FUNCTION(void) BS_SteamHTMLSurface_StopLoad(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_StopLoad(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->StopLoad(unBrowserHandle);
}
// Reload (most likely from local cache) the current page
DLL_FUNCTION(void) BS_SteamHTMLSurface_Reload(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_Reload(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->Reload(unBrowserHandle);
}
// navigate back in the page history
DLL_FUNCTION(void) BS_SteamHTMLSurface_GoBack(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_GoBack(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->GoBack(unBrowserHandle);
}
// navigate forward in the page history
DLL_FUNCTION(void) BS_SteamHTMLSurface_GoForward(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_GoForward(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->GoForward(unBrowserHandle);
}
// add this header to any url requests from this browser
DLL_FUNCTION(void) BS_SteamHTMLSurface_AddHeader(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchKey, const char* pchValue) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_AddHeader(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchKey, const char* pchValue) {
pSteamHTMLSurface->AddHeader(unBrowserHandle, pchKey, pchValue);
}
// run this javascript script in the currently loaded page
DLL_FUNCTION(void) BS_SteamHTMLSurface_ExecuteJavascript(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchScript) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_ExecuteJavascript(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char* pchScript) {
pSteamHTMLSurface->ExecuteJavascript(unBrowserHandle, pchScript);
}
// Mouse click and mouse movement commands
DLL_FUNCTION(void) BS_SteamHTMLSurface_MouseUp(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_MouseUp(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) {
pSteamHTMLSurface->MouseUp(unBrowserHandle, eMouseButton);
}
DLL_FUNCTION(void) BS_SteamHTMLSurface_MouseDown(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_MouseDown(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) {
pSteamHTMLSurface->MouseDown(unBrowserHandle, eMouseButton);
}
DLL_FUNCTION(void) BS_SteamHTMLSurface_MouseDoubleClick(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_MouseDoubleClick(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton) {
pSteamHTMLSurface->MouseDoubleClick(unBrowserHandle, eMouseButton);
}
// x and y are relative to the HTML bounds
DLL_FUNCTION(void) BS_SteamHTMLSurface_MouseMove(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int32_t x, int32_t y) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_MouseMove(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int32_t x, int32_t y) {
pSteamHTMLSurface->MouseMove(unBrowserHandle, x, y);
}
// nDelta is pixels of scroll
DLL_FUNCTION(void) BS_SteamHTMLSurface_MouseWheel(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int32_t nDelta) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_MouseWheel(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int32_t nDelta) {
pSteamHTMLSurface->MouseWheel(unBrowserHandle, nDelta);
}
// keyboard interactions, native keycode is the virtual key code value from your OS
DLL_FUNCTION(void) BS_SteamHTMLSurface_KeyDown(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_KeyDown(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) {
pSteamHTMLSurface->KeyDown(unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers);
}
DLL_FUNCTION(void) BS_SteamHTMLSurface_KeyUp(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_KeyUp(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) {
pSteamHTMLSurface->KeyUp(unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers);
}
// cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press)
DLL_FUNCTION(void) BS_SteamHTMLSurface_KeyChar(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_KeyChar(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers) {
pSteamHTMLSurface->KeyChar(unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers);
}
// programmatically scroll this many pixels on the page
DLL_FUNCTION(void) BS_SteamHTMLSurface_SetHorizontalScroll(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetHorizontalScroll(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll) {
pSteamHTMLSurface->SetHorizontalScroll(unBrowserHandle, nAbsolutePixelScroll);
}
DLL_FUNCTION(void) BS_SteamHTMLSurface_SetVerticalScroll(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetVerticalScroll(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll) {
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_SteamHTMLSurface_SetKeyFocus(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bHasKeyFocus) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetKeyFocus(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bHasKeyFocus) {
pSteamHTMLSurface->SetKeyFocus(unBrowserHandle, bHasKeyFocus);
}
// open the current pages html code in the local editor of choice, used for debugging
DLL_FUNCTION(void) BS_SteamHTMLSurface_ViewSource(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_ViewSource(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->ViewSource(unBrowserHandle);
}
// copy the currently selected text on the html page to the local clipboard
DLL_FUNCTION(void) BS_SteamHTMLSurface_CopyToClipboard(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_CopyToClipboard(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->CopyToClipboard(unBrowserHandle);
}
// paste from the local clipboard to the current html page
DLL_FUNCTION(void) BS_SteamHTMLSurface_PasteFromClipboard(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_PasteFromClipboard(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
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_SteamHTMLSurface_Find(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_Find(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse) {
pSteamHTMLSurface->Find(unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse);
}
// cancel a currently running find
DLL_FUNCTION(void) BS_SteamHTMLSurface_StopFind(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_StopFind(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle) {
pSteamHTMLSurface->StopFind(unBrowserHandle);
}
// return details about the link at position x,y on the current page
DLL_FUNCTION(void) BS_SteamHTMLSurface_GetLinkAtPosition(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int x, int y) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_GetLinkAtPosition(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, int x, int y) {
pSteamHTMLSurface->GetLinkAtPosition(unBrowserHandle, x, y);
}
// set a webcookie for the hostname in question
DLL_FUNCTION(void) BS_SteamHTMLSurface_SetCookie(ISteamHTMLSurface* pSteamHTMLSurface, const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath, RTime32 nExpires, bool bSecure, bool bHTTPOnly) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetCookie(ISteamHTMLSurface* pSteamHTMLSurface, const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath, RTime32 nExpires, bool bSecure, bool bHTTPOnly) {
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_SteamHTMLSurface_SetPageScaleFactor(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetPageScaleFactor(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY) {
pSteamHTMLSurface->SetPageScaleFactor(unBrowserHandle, flZoom, nPointX, nPointY);
}
@@ -180,7 +180,7 @@ DLL_FUNCTION(void) BS_SteamHTMLSurface_SetPageScaleFactor(ISteamHTMLSurface* pSt
// 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_SteamHTMLSurface_SetBackgroundMode(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bBackgroundMode) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_SetBackgroundMode(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bBackgroundMode) {
pSteamHTMLSurface->SetBackgroundMode(unBrowserHandle, bBackgroundMode);
}
@@ -193,17 +193,17 @@ DLL_FUNCTION(void) BS_SteamHTMLSurface_SetBackgroundMode(ISteamHTMLSurface* pSte
// 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_SteamHTMLSurface_AllowStartRequest(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bAllowed) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_AllowStartRequest(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bAllowed) {
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_SteamHTMLSurface_JSDialogResponse(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bResult) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_JSDialogResponse(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, bool bResult) {
pSteamHTMLSurface->JSDialogResponse(unBrowserHandle, bResult);
}
// You MUST call this in response to a HTML_FileOpenDialog_t callback
DLL_FUNCTION(void) BS_SteamHTMLSurface_FileLoadDialogResponse(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles) {
DLL_FUNCTION(void) BS_ISteamHTMLSurface_FileLoadDialogResponse(ISteamHTMLSurface* pSteamHTMLSurface, HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles) {
pSteamHTMLSurface->FileLoadDialogResponse(unBrowserHandle, pchSelectedFiles);
}
+160
View File
@@ -16,6 +16,9 @@
#include "BlitzSteam.h"
//-----------------------------------------------------------------------------
// Purpose: interface to http client
//-----------------------------------------------------------------------------
DLL_FUNCTION(ISteamHTTP*) BS_HTTP() {
return SteamHTTP();
}
@@ -24,6 +27,163 @@ DLL_FUNCTION(ISteamHTTP*) BS_GameServerHTTP() {
return SteamGameServerHTTP();
}
// Initializes a new HTTP request, returning a handle to use in further operations on it. Requires
// the method (GET or POST) and the absolute URL for the request. Both http and https are supported,
// so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/
// or such.
DLL_FUNCTION(HTTPRequestHandle) BS_ISteamHTTP_CreateHTTPRequest(ISteamHTTP* pThis, EHTTPMethod eHTTPRequestMethod, const char* cAbsoluteUrl) {
return pThis->CreateHTTPRequest(eHTTPRequestMethod, cAbsoluteUrl);
}
// Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after
// sending the request. This is just so the caller can easily keep track of which callbacks go with which request data.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestContextValue(ISteamHTTP* pThis, HTTPRequestHandle hRequest, uint64_t* plContextValue) {
return pThis->SetHTTPRequestContextValue(hRequest, *plContextValue);
}
// Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default
// timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request
// has already been sent.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPNetworkActivityTimeout(ISteamHTTP* pThis, HTTPRequestHandle hRequest, uint32 unTimeoutSeconds) {
return pThis->SetHTTPRequestNetworkActivityTimeout(hRequest, unTimeoutSeconds);
}
// Set a request header value for the request, must be called prior to sending the request. Will
// return false if the handle is invalid or the request is already sent.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestHeaderValue(ISteamHTTP* pThis, HTTPRequestHandle hRequest, const char *pchHeaderName, const char *pchHeaderValue) {
return pThis->SetHTTPRequestHeaderValue(hRequest, pchHeaderName, pchHeaderValue);
}
// Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified
// when creating the request. Must be called prior to sending the request. Will return false if the
// handle is invalid or the request is already sent.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestGetOrPostParameter(ISteamHTTP* pThis, HTTPRequestHandle hRequest, const char *pchParamName, const char *pchParamValue) {
return pThis->SetHTTPRequestGetOrPostParameter(hRequest, pchParamName, pchParamValue);
}
// Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on
// asynchronous response via callback.
//
// Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control
// header and only do a local cache lookup rather than sending any actual remote request.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SendHTTPRequest(ISteamHTTP* pThis, HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle) {
return pThis->SendHTTPRequest(hRequest, pCallHandle);
}
// Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on
// asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and
// HTTPRequestDataReceived_t callbacks while streaming.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SendHTTPRequestAndStreamResponse(ISteamHTTP* pThis, HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle) {
return pThis->SendHTTPRequestAndStreamResponse(hRequest, pCallHandle);
}
// Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move
// the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_DeferHTTPRequest(ISteamHTTP* pThis, HTTPRequestHandle hRequest) {
return pThis->DeferHTTPRequest(hRequest);
}
// Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move
// the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_PrioritizeHTTPRequest(ISteamHTTP* pThis, HTTPRequestHandle hRequest) {
return pThis->PrioritizeHTTPRequest(hRequest);
}
// Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also
// returns the size of the header value if present so the caller and allocate a correctly sized buffer for
// GetHTTPResponseHeaderValue.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPResponseHeaderSize(ISteamHTTP* pThis, HTTPRequestHandle hRequest, const char *pchHeaderName, uint32 *unResponseHeaderSize) {
return pThis->GetHTTPResponseHeaderSize(hRequest, pchHeaderName, unResponseHeaderSize);
}
// Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
// header is not present or if your buffer is too small to contain it's value. You should first call
// BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPResponseHeaderValue(ISteamHTTP* pThis, HTTPRequestHandle hRequest, const char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 unBufferSize) {
return pThis->GetHTTPResponseHeaderValue(hRequest, pchHeaderName, pHeaderValueBuffer, unBufferSize);
}
// Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
// handle is invalid.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPResponseBodySize(ISteamHTTP* pThis, HTTPRequestHandle hRequest, uint32 *unBodySize) {
return pThis->GetHTTPResponseBodySize(hRequest, unBodySize);
}
// Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
// handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out
// the correct buffer size to use.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPResponseBodyData(ISteamHTTP* pThis, HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize) {
return pThis->GetHTTPResponseBodyData(hRequest, pBodyDataBuffer, unBufferSize);
}
// Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the
// handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset
// do not match the size and offset sent in HTTPRequestDataReceived_t.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPStreamingResponseBodyData(ISteamHTTP* pThis, HTTPRequestHandle hRequest, uint32 cOffset, uint8 *pBodyDataBuffer, uint32 unBufferSize) {
return pThis->GetHTTPStreamingResponseBodyData(hRequest, cOffset, pBodyDataBuffer, unBufferSize);
}
// Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t
// callback and finishing using the response.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_ReleaseHTTPRequest(ISteamHTTP* pThis, HTTPRequestHandle hRequest) {
return pThis->ReleaseHTTPRequest(hRequest);
}
// Gets progress on downloading the body for the request. This will be zero unless a response header has already been
// received which included a content-length field. For responses that contain no content-length it will report
// zero for the duration of the request as the size is unknown until the connection closes.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPDownloadProgressPct(ISteamHTTP* pThis, HTTPRequestHandle hRequest, float *pflPercentOut) {
return pThis->GetHTTPDownloadProgressPct(hRequest, pflPercentOut);
}
// Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params
// have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType
// parameter will set the content-type header for the request so the server may know how to interpret the body.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestRawPostBody(ISteamHTTP* pThis, HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen) {
return pThis->SetHTTPRequestRawPostBody(hRequest, pchContentType, pubBody, unBodyLen);
}
// Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true
// than any response to your requests using this cookie container may add new cookies which may be transmitted with
// future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for
// during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across
// repeat executions of your process.
DLL_FUNCTION(HTTPCookieContainerHandle) BS_ISteamHTTP_CreateCookieContainer(ISteamHTTP* pThis, bool bAllowResponsesToModify) {
return pThis->CreateCookieContainer(bAllowResponsesToModify);
}
// Release a cookie container you are finished using, freeing it's memory
DLL_FUNCTION(int32_t) BS_ISteamHTTP_ReleaseCookieContainer(ISteamHTTP* pThis, HTTPCookieContainerHandle hCookieContainer) {
return pThis->ReleaseCookieContainer(hCookieContainer);
}
// Adds a cookie to the specified cookie container that will be used with future requests.
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetCookie(ISteamHTTP* pThis, HTTPCookieContainerHandle hCookieContainer, const char *pchHost, const char *pchUrl, const char *pchCookie) {
return pThis->SetCookie(hCookieContainer, pchHost, pchUrl, pchCookie);
}
// Set the cookie container to use for a HTTP request
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestCookieContainer(ISteamHTTP* pThis, HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) {
return pThis->SetHTTPRequestCookieContainer(hRequest, hCookieContainer);
}
// Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestUserAgentInfo(ISteamHTTP* pThis, HTTPRequestHandle hRequest, const char *pchUserAgentInfo) {
return pThis->SetHTTPRequestUserAgentInfo(hRequest, pchUserAgentInfo);
}
// Set that https request should require verified SSL certificate via machines certificate trust store
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(ISteamHTTP* pThis, HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) {
return pThis->SetHTTPRequestRequiresVerifiedCertificate(hRequest, bRequireVerifiedCertificate);
}
// Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout
// which can bump everytime we get more data
DLL_FUNCTION(int32_t) BS_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(ISteamHTTP* pThis, HTTPRequestHandle hRequest, uint32 unMilliseconds) {
return pThis->SetHTTPRequestAbsoluteTimeoutMS(hRequest, unMilliseconds);
}
// Check if the reason the request failed was because we timed it out (rather than some harder failure)
DLL_FUNCTION(int32_t) BS_ISteamHTTP_GetHTTPRequestWasTimedOut(ISteamHTTP* pThis, HTTPRequestHandle hRequest, bool *pbWasTimedOut) {
return pThis->GetHTTPRequestWasTimedOut(hRequest, pbWasTimedOut);
}
+276 -2
View File
@@ -16,11 +16,285 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamInventory*) BS_Inventory() {
//-----------------------------------------------------------------------------
// Purpose: Steam Inventory query and manipulation API
//-----------------------------------------------------------------------------
DLL_FUNCTION(ISteamInventory*) BS_SteamInventory() {
return SteamInventory();
}
DLL_FUNCTION(ISteamInventory*) BS_GameServerInventory() {
DLL_FUNCTION(ISteamInventory*) BS_SteamGameServerInventory() {
return SteamGameServerInventory();
}
// INVENTORY ASYNC RESULT MANAGEMENT
//
// Asynchronous inventory queries always output a result handle which can be used with
// GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will
// be triggered when the asynchronous result becomes ready (or fails).
//
// Find out the status of an asynchronous inventory result handle. Possible values:
// k_EResultPending - still in progress
// k_EResultOK - done, result ready
// k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult)
// k_EResultInvalidParam - ERROR: invalid API call parameters
// k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later
// k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits
// k_EResultFail - ERROR: unknown / generic error
DLL_FUNCTION(EResult) BS_ISteamInventory_GetResultStatus(ISteamInventory* pThis, SteamInventoryResult_t resultHandle) {
return pThis->GetResultStatus(resultHandle);
}
// Copies the contents of a result set into a flat array. The specific
// contents of the result set depend on which query which was used.
DLL_FUNCTION(bool) BS_ISteamInventory_GetResultItems(ISteamInventory* pThis, SteamInventoryResult_t resultHandle,
OUT_ARRAY_COUNT(punOutItemsArraySize, Output array) SteamItemDetails_t *pOutItemsArray,
uint32 *punOutItemsArraySize) {
return pThis->GetResultItems(resultHandle, pOutItemsArray, punOutItemsArraySize);
}
// Returns the server time at which the result was generated. Compare against
// the value of IClientUtils::GetServerRealTime() to determine age.
DLL_FUNCTION(uint32) BS_ISteamInventory_GetResultTimestamp(ISteamInventory* pThis, SteamInventoryResult_t resultHandle) {
return pThis->GetResultTimestamp(resultHandle);
}
// Returns true if the result belongs to the target steam ID, false if the
// result does not. This is important when using DeserializeResult, to verify
// that a remote player is not pretending to have a different user's inventory.
DLL_FUNCTION(bool) BS_ISteamInventory_CheckResultSteamID(ISteamInventory* pThis, SteamInventoryResult_t resultHandle, CSteamID* steamIDExpected) {
return pThis->CheckResultSteamID(resultHandle, *steamIDExpected);
}
// Destroys a result handle and frees all associated memory.
DLL_FUNCTION(void) BS_ISteamInventory_DestroyResult(ISteamInventory* pThis, SteamInventoryResult_t resultHandle) {
return pThis->DestroyResult(resultHandle);
}
// INVENTORY ASYNC QUERY
//
// Captures the entire state of the current user's Steam inventory.
// You must call DestroyResult on this handle when you are done with it.
// Returns false and sets *pResultHandle to zero if inventory is unavailable.
// Note: calls to this function are subject to rate limits and may return
// cached results if called too frequently. It is suggested that you call
// this function only when you are about to display the user's full inventory,
// or if you expect that the inventory may have changed.
DLL_FUNCTION(bool) BS_ISteamInventory_GetAllItems(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle) {
return pThis->GetAllItems(pResultHandle);
}
// Captures the state of a subset of the current user's Steam inventory,
// identified by an array of item instance IDs. The results from this call
// can be serialized and passed to other players to "prove" that the current
// user owns specific items, without exposing the user's entire inventory.
// For example, you could call GetItemsByID with the IDs of the user's
// currently equipped cosmetic items and serialize this to a buffer, and
// then transmit this buffer to other players upon joining a game.
DLL_FUNCTION(bool) BS_ISteamInventory_GetItemsByID(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unCountInstanceIDs) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs) {
return pThis->GetItemsByID(pResultHandle, pInstanceIDs, unCountInstanceIDs);
}
// RESULT SERIALIZATION AND AUTHENTICATION
//
// Serialized result sets contain a short signature which can't be forged
// or replayed across different game sessions. A result set can be serialized
// on the local client, transmitted to other players via your game networking,
// and deserialized by the remote players. This is a secure way of preventing
// hackers from lying about posessing rare/high-value items.
// Serializes a result set with signature bytes to an output buffer. Pass
// NULL as an output buffer to get the required size via punOutBufferSize.
// The size of a serialized result depends on the number items which are being
// serialized. When securely transmitting items to other players, it is
// recommended to use "GetItemsByID" first to create a minimal result set.
// Results have a built-in timestamp which will be considered "expired" after
// an hour has elapsed. See DeserializeResult for expiration handling.
DLL_FUNCTION(bool) BS_ISteamInventory_SerializeResult(ISteamInventory* pThis, SteamInventoryResult_t resultHandle, OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize) {
return pThis->SerializeResult(resultHandle, pOutBuffer, punOutBufferSize);
}
// Deserializes a result set and verifies the signature bytes. Returns false
// if bRequireFullOnlineVerify is set but Steam is running in Offline mode.
// Otherwise returns true and then delivers error codes via GetResultStatus.
//
// The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not
// be set to true by your game at this time.
//
// DeserializeResult has a potential soft-failure mode where the handle status
// is set to k_EResultExpired. GetResultItems() still succeeds in this mode.
// The "expired" result could indicate that the data may be out of date - not
// just due to timed expiration (one hour), but also because one of the items
// in the result set may have been traded or consumed since the result set was
// generated. You could compare the timestamp from GetResultTimestamp() to
// ISteamUtils::GetServerRealTime() to determine how old the data is. You could
// simply ignore the "expired" result code and continue as normal, or you
// could challenge the player with expired data to send an updated result set.
DLL_FUNCTION(bool) BS_ISteamInventory_DeserializeResult(ISteamInventory* pThis, SteamInventoryResult_t *pOutResultHandle, BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) {
return pThis->DeserializeResult(pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE);
}
// INVENTORY ASYNC MODIFICATION
//
// GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t
// notification with a matching nCallbackContext parameter. This API is insecure, and could
// be abused by hacked clients. It is, however, very useful as a development cheat or as
// a means of prototyping item-related features for your game. The use of GenerateItems can
// be restricted to certain item definitions or fully blocked via the Steamworks website.
// If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should
// describe the quantity of each item to generate.
DLL_FUNCTION(bool) BS_ISteamInventory_GenerateItems(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength) {
return pThis->GenerateItems(pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength);
}
// GrantPromoItems() checks the list of promotional items for which the user may be eligible
// and grants the items (one time only). On success, the result set will include items which
// were granted, if any. If no items were granted because the user isn't eligible for any
// promotions, this is still considered a success.
DLL_FUNCTION(bool) BS_ISteamInventory_GrantPromoItems(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle) {
return pThis->GrantPromoItems(pResultHandle);
}
// AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of
// scanning for all eligible promotional items, the check is restricted to a single item
// definition or set of item definitions. This can be useful if your game has custom UI for
// showing a specific promo item to the user.
DLL_FUNCTION(bool) BS_ISteamInventory_AddPromoItem(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, SteamItemDef_t itemDef) {
return pThis->AddPromoItem(pResultHandle, itemDef);
}
DLL_FUNCTION(bool) BS_ISteamInventory_AddPromoItems(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength) {
return pThis->AddPromoItems(pResultHandle, pArrayItemDefs, unArrayLength);
}
// ConsumeItem() removes items from the inventory, permanently. They cannot be recovered.
// Not for the faint of heart - if your game implements item removal at all, a high-friction
// UI confirmation process is highly recommended. Similar to GenerateItems, punArrayQuantity
// can be NULL or else an array of the same length as pArrayItems which describe the quantity
// of each item to destroy. ConsumeItem can be restricted to certain item definitions or
// fully blocked via the Steamworks website to minimize support/abuse issues such as the
// clasic "my brother borrowed my laptop and deleted all of my rare items".
DLL_FUNCTION(bool) BS_ISteamInventory_ConsumeItem(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity) {
return pThis->ConsumeItem(pResultHandle, itemConsume, unQuantity);
}
// ExchangeItems() is an atomic combination of GenerateItems and DestroyItems. It can be
// used to implement crafting recipes or transmutations, or items which unpack themselves
// into other items. Like GenerateItems, this is a flexible and dangerous API which is
// meant for rapid prototyping. You can configure restrictions on ExchangeItems via the
// Steamworks website, such as limiting it to a whitelist of input/output combinations
// corresponding to recipes.
// (Note: although GenerateItems may be hard or impossible to use securely in your game,
// ExchangeItems is perfectly reasonable to use once the whitelists are set accordingly.)
DLL_FUNCTION(bool) BS_ISteamInventory_ExchangeItems(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle,
ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength,
ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength) {
return pThis->ExchangeItems(pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength);
}
// TransferItemQuantity() is intended for use with items which are "stackable" (can have
// quantity greater than one). It can be used to split a stack into two, or to transfer
// quantity from one stack into another stack of identical items. To split one stack into
// two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated.
DLL_FUNCTION(bool) BS_ISteamInventory_TransferItemQuantity(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest) {
return pThis->TransferItemQuantity(pResultHandle, itemIdSource, unQuantity, itemIdDest);
}
// TIMED DROPS AND PLAYTIME CREDIT
//
// Applications which use timed-drop mechanics should call SendItemDropHeartbeat() when
// active gameplay begins, and at least once every two minutes afterwards. The backend
// performs its own time calculations, so the precise timing of the heartbeat is not
// critical as long as you send at least one heartbeat every two minutes. Calling the
// function more often than that is not harmful, it will simply have no effect. Note:
// players may be able to spoof this message by hacking their client, so you should not
// attempt to use this as a mechanism to restrict playtime credits. It is simply meant
// to distinguish between being in any kind of gameplay situation vs the main menu or
// a pre-game launcher window. (If you are stingy with handing out playtime credit, it
// will only encourage players to run bots or use mouse/kb event simulators.)
//
// Playtime credit accumulation can be capped on a daily or weekly basis through your
// Steamworks configuration.
//
DLL_FUNCTION(void) BS_ISteamInventory_SendItemDropHeartbeat(ISteamInventory* pThis) {
return pThis->SendItemDropHeartbeat();
}
// Playtime credit must be consumed and turned into item drops by your game. Only item
// definitions which are marked as "playtime item generators" can be spawned. The call
// will return an empty result set if there is not enough playtime credit for a drop.
// Your game should call TriggerItemDrop at an appropriate time for the user to receive
// new items, such as between rounds or while the player is dead. Note that players who
// hack their clients could modify the value of "dropListDefinition", so do not use it
// to directly control rarity. It is primarily useful during testing and development,
// where you may wish to perform experiments with different types of drops.
DLL_FUNCTION(bool) BS_ISteamInventory_TriggerItemDrop(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition) {
return pThis->TriggerItemDrop(pResultHandle, dropListDefinition);
}
// IN-GAME TRADING
//
// TradeItems() implements limited in-game trading of items, if you prefer not to use
// the overlay or an in-game web browser to perform Steam Trading through the website.
// You should implement a UI where both players can see and agree to a trade, and then
// each client should call TradeItems simultaneously (+/- 5 seconds) with matching
// (but reversed) parameters. The result is the same as if both players performed a
// Steam Trading transaction through the web. Each player will get an inventory result
// confirming the removal or quantity changes of the items given away, and the new
// item instance id numbers and quantities of the received items.
// (Note: new item instance IDs are generated whenever an item changes ownership.)
DLL_FUNCTION(bool) BS_ISteamInventory_TradeItems(ISteamInventory* pThis, SteamInventoryResult_t *pResultHandle, CSteamID* steamIDTradePartner,
ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength,
ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength) {
return pThis->TradeItems(pResultHandle, *steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength);
}
// ITEM DEFINITIONS
//
// Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000)
// to a set of string properties. Some of these properties are required to display items
// on the Steam community web site. Other properties can be defined by applications.
// Use of these functions is optional; there is no reason to call LoadItemDefinitions
// if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue
// weapon mod = 55) and does not allow for adding new item types without a client patch.
//
// LoadItemDefinitions triggers the automatic load and refresh of item definitions.
// Every time new item definitions are available (eg, from the dynamic addition of new
// item types while players are still in-game), a SteamInventoryDefinitionUpdate_t
// callback will be fired.
DLL_FUNCTION(bool) BS_ISteamInventory_LoadItemDefinitions(ISteamInventory* pThis) {
return pThis->LoadItemDefinitions();
}
// GetItemDefinitionIDs returns the set of all defined item definition IDs (which are
// defined via Steamworks configuration, and not necessarily contiguous integers).
// If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will
// contain the total size necessary for a subsequent call. Otherwise, the call will
// return false if and only if there is not enough space in the output array.
DLL_FUNCTION(bool) BS_ISteamInventory_GetItemDefinitionIDs(ISteamInventory* pThis,
OUT_ARRAY_COUNT(punItemDefIDsArraySize, List of item definition IDs) SteamItemDef_t *pItemDefIDs,
DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize) {
return pThis->GetItemDefinitionIDs(pItemDefIDs, punItemDefIDsArraySize);
}
// GetItemDefinitionProperty returns a string property from a given item definition.
// Note that some properties (for example, "name") may be localized and will depend
// on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage).
// Property names are always composed of ASCII letters, numbers, and/or underscores.
// Pass a NULL pointer for pchPropertyName to get a comma - separated list of available
// property names.
DLL_FUNCTION(bool) BS_ISteamInventory_GetItemDefinitionProperty(ISteamInventory* pThis, SteamItemDef_t iDefinition, const char *pchPropertyName,
OUT_STRING_COUNT(punValueBufferSize) char *pchValueBuffer, uint32 *punValueBufferSize) {
return pThis->GetItemDefinitionProperty(iDefinition, pchPropertyName, pchValueBuffer, punValueBufferSize);
}
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamMatchmaking*) BS_Matchmaking() {
DLL_FUNCTION(ISteamMatchmaking*) BS_SteamMatchmaking() {
return SteamMatchmaking();
}
BS_I
#pragma message("SteamMatchmaking is not ported yet. TODO!")
+2 -73
View File
@@ -16,79 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamMatchmakingServers*) BS_MatchmakingServers() {
DLL_FUNCTION(ISteamMatchmakingServers*) BS_SteamMatchmakingServers() {
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;
#pragma message("SteamMatchmakingServers is not ported yet. TODO!")
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamMusic*) BS_Music() {
DLL_FUNCTION(ISteamMusic*) BS_SteamMusic() {
return SteamMusic();
}
BS_I
#pragma message("SteamMusic is not ported yet. TODO!")
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamMusicRemote*) BS_MusicRemote() {
DLL_FUNCTION(ISteamMusicRemote*) BS_SteamMusicRemote() {
return SteamMusicRemote();
}
BS_I
#pragma message("SteamMusicRemote is not ported yet. TODO!")
+59 -18
View File
@@ -16,42 +16,83 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamNetworking*) BS_Networking() {
//-----------------------------------------------------------------------------
// Purpose: Functions for making connections and sending data between clients,
// traversing NAT's where possible
//-----------------------------------------------------------------------------
DLL_FUNCTION(ISteamNetworking*) BS_SteamNetworking() {
return SteamNetworking();
}
DLL_FUNCTION(ISteamNetworking*) BS_GameServerNetworking() {
DLL_FUNCTION(ISteamNetworking*) BS_SteamGameServerNetworking() {
return SteamGameServerNetworking();
}
DLL_FUNCTION(uint32_t) BS_Networking_SendP2PPacket(ISteamNetworking* pSteamNetworking, CSteamID* pSteamIDRemote, const void* pubData, uint32_t cubData, EP2PSend eP2PSendType, uint32_t nChannel) {
return pSteamNetworking->SendP2PPacket(*pSteamIDRemote, pubData, cubData, eP2PSendType, nChannel);
////////////////////////////////////////////////////////////////////////////////////////////
// Session-less connection functions
// automatically establishes NAT-traversing or Relay server connections
// Sends a P2P packet to the specified user
// UDP-like, unreliable and a max packet size of 1200 bytes
// the first packet send may be delayed as the NAT-traversal code runs
// if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t
// see EP2PSend enum above for the descriptions of the different ways of sending packets
//
// nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket()
// with the same channel number in order to retrieve the data on the other end
// using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_SendP2PPacket(ISteamNetworking* pThis, CSteamID* pSteamIDRemote, const void* pubData, uint32_t cubData, EP2PSend eP2PSendType, uint32_t nChannel) {
return pThis->SendP2PPacket(*pSteamIDRemote, pubData, cubData, eP2PSendType, nChannel);
}
DLL_FUNCTION(uint32_t) BS_Networking_IsP2PPacketAvailable(ISteamNetworking* pSteamNetworking, uint32_t* pcubMsgSize, uint32_t nChannel) {
return pSteamNetworking->IsP2PPacketAvailable(pcubMsgSize, nChannel);
// returns true if any data is available for read, and the amount of data that will need to be read
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_IsP2PPacketAvailable(ISteamNetworking* pThis, uint32_t* pcubMsgSize, uint32_t nChannel) {
return pThis->IsP2PPacketAvailable(pcubMsgSize, nChannel);
}
DLL_FUNCTION(uint32_t) BS_Networking_ReadP2PPacket(ISteamNetworking* pSteamNetworking, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize, CSteamID* pSteamIDRemote, uint32_t nChannel) {
return pSteamNetworking->ReadP2PPacket(pubDest, cubDest, pcubMsgSize, pSteamIDRemote, nChannel);
// reads in a packet that has been sent from another user via SendP2PPacket()
// returns the size of the message and the steamID of the user who sent it in the last two parameters
// if the buffer passed in is too small, the message will be truncated
// this call is not blocking, and will return false if no data is available
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_ReadP2PPacket(ISteamNetworking* pThis, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize, CSteamID* pSteamIDRemote, uint32_t nChannel) {
return pThis->ReadP2PPacket(pubDest, cubDest, pcubMsgSize, pSteamIDRemote, nChannel);
}
DLL_FUNCTION(uint32_t) BS_Networking_AcceptP2PSessionWithUser(ISteamNetworking* pSteamNetworking, CSteamID* pSteamIDRemote) {
return pSteamNetworking->AcceptP2PSessionWithUser(*pSteamIDRemote);
// AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback
// P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet
// if you don't want to talk to the user, just ignore the request
// if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically
// this may be called multiple times for a single user
// (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request)
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_AcceptP2PSessionWithUser(ISteamNetworking* pThis, CSteamID* pSteamIDRemote) {
return pThis->AcceptP2PSessionWithUser(*pSteamIDRemote);
}
DLL_FUNCTION(uint32_t) BS_Networking_CloseP2PSessionWithUser(ISteamNetworking* pSteamNetworking, CSteamID* pSteamIDRemote) {
return pSteamNetworking->CloseP2PSessionWithUser(*pSteamIDRemote);
// call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood
// if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_CloseP2PSessionWithUser(ISteamNetworking* pThis, CSteamID* pSteamIDRemote) {
return pThis->CloseP2PSessionWithUser(*pSteamIDRemote);
}
DLL_FUNCTION(uint32_t) BS_Networking_CloseP2PChannelWithUser(ISteamNetworking* pSteamNetworking, CSteamID* pSteamIDRemote, uint32_t nChannel) {
return pSteamNetworking->CloseP2PChannelWithUser(*pSteamIDRemote, nChannel);
// call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels
// open channels to a user have been closed, the open session to the user will be closed and new data from this
// user will trigger a P2PSessionRequest_t callback
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_CloseP2PChannelWithUser(ISteamNetworking* pThis, CSteamID* pSteamIDRemote, uint32_t nChannel) {
return pThis->CloseP2PChannelWithUser(*pSteamIDRemote, nChannel);
}
DLL_FUNCTION(uint32_t) BS_Networking_GetP2PSessionState(ISteamNetworking* pSteamNetworking, CSteamID* pSteamIDRemote, P2PSessionState_t* pConnectionState) {
return pSteamNetworking->GetP2PSessionState(*pSteamIDRemote, pConnectionState);
// fills out P2PSessionState_t structure with details about the underlying connection to the user
// should only needed for debugging purposes
// returns false if no connection exists to the specified user
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_GetP2PSessionState(ISteamNetworking* pThis, CSteamID* pSteamIDRemote, P2PSessionState_t* pConnectionState) {
return pThis->GetP2PSessionState(*pSteamIDRemote, pConnectionState);
}
DLL_FUNCTION(uint32_t) BS_Networking_AllowP2PPacketRelay(ISteamNetworking* pSteamNetworking, uint32_t bAllow) {
return pSteamNetworking->AllowP2PPacketRelay(!!bAllow);
// Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection
// or NAT-traversal cannot be established. Only applies to connections created after setting this value,
// or to existing connections that need to automatically reconnect after this value is set.
//
// P2P packet relay is allowed by default
DLL_FUNCTION(uint32_t) BS_ISteamNetworking_AllowP2PPacketRelay(ISteamNetworking* pThis, uint32_t bAllow) {
return pThis->AllowP2PPacketRelay(!!bAllow);
}
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamRemoteStorage*) BS_RemoteStorage() {
DLL_FUNCTION(ISteamRemoteStorage*) BS_SteamRemoteStorage() {
return SteamRemoteStorage();
}
BS_I
#pragma message("SteamRemoteStorage is not ported yet. TODO!")
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamScreenshots*) BS_Screenshots() {
DLL_FUNCTION(ISteamScreenshots*) BS_SteamScreenshots() {
return SteamScreenshots();
}
BS_I
#pragma message("SteamScreenshots is not ported yet. TODO!")
+4 -2
View File
@@ -16,11 +16,13 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamUGC*) BS_UGC() {
DLL_FUNCTION(ISteamUGC*) BS_SteamUGC() {
return SteamUGC();
}
DLL_FUNCTION(ISteamUGC*) BS_GameServerUGC() {
DLL_FUNCTION(ISteamUGC*) BS_SteamGameServerUGC() {
return SteamGameServerUGC();
}
#pragma message("SteamUGC is not ported yet. TODO!")
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamUnifiedMessages*) BS_UnifiedMessages() {
DLL_FUNCTION(ISteamUnifiedMessages*) BS_SteamUnifiedMessages() {
return SteamUnifiedMessages();
}
BS_I
#pragma message("SteamUnifiedMessages is not ported yet. TODO!")
+144 -52
View File
@@ -16,107 +16,199 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamUser*) BS_User() {
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
//-----------------------------------------------------------------------------
DLL_FUNCTION(ISteamUser*) BS_SteamUser() {
return SteamUser();
}
BS_I
DLL_FUNCTION(HSteamUser) BS_User_GetHSteamUser( ISteamUser* lpSteamUser ) {
// returns the HSteamUser this interface represents
// this is only used internally by the API, and by a few select interfaces that support multi-user
DLL_FUNCTION(HSteamUser) BS_ISteamUser_GetHSteamUser( ISteamUser* lpSteamUser ) {
return lpSteamUser->GetHSteamUser( );
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_IsLoggedOn( ISteamUser* lpSteamUser ) {
// returns true if the Steam client current has a live connection to the Steam servers.
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
// The Steam client will automatically be trying to recreate the connection as often as possible.
DLL_FUNCTION(uint32_t) BS_ISteamUser_IsLoggedOn( ISteamUser* lpSteamUser ) {
return lpSteamUser->BLoggedOn( );
}
BS_I
DLL_FUNCTION(CSteamID*) BS_User_GetSteamID( ISteamUser* lpSteamUser ) {
// returns the CSteamID of the account currently logged into the Steam client
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
DLL_FUNCTION(CSteamID*) BS_ISteamUser_GetSteamID( ISteamUser* lpSteamUser ) {
return &(lpSteamUser->GetSteamID( ));
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_InitiateGameConnection( ISteamUser* lpSteamUser, void* pAuthBlob, uint32_t cbMaxAuthBlob, CSteamID* SteamIDGameServer, uint32_t unIPServer, uint16_t usPortServer, uint32_t bSecure ) {
// Multiplayer Authentication functions
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
//
// Parameters:
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
//
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
DLL_FUNCTION(uint32_t) BS_ISteamUser_InitiateGameConnection( ISteamUser* lpSteamUser, void* pAuthBlob, uint32_t cbMaxAuthBlob, CSteamID* SteamIDGameServer, uint32_t unIPServer, uint16_t usPortServer, uint32_t bSecure ) {
return lpSteamUser->InitiateGameConnection( pAuthBlob, cbMaxAuthBlob, *SteamIDGameServer, unIPServer, usPortServer, bSecure != 0 );
}
BS_I
DLL_FUNCTION(void) BS_User_TerminateGameConnection( ISteamUser* lpSteamUser, uint32_t unIPServer, uint16_t usPortServer ) {
// notify of disconnect
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
DLL_FUNCTION(void) BS_ISteamUser_TerminateGameConnection( ISteamUser* lpSteamUser, uint32_t unIPServer, uint16_t usPortServer ) {
lpSteamUser->TerminateGameConnection( unIPServer, usPortServer );
}
BS_I
DLL_FUNCTION(void) BS_User_TrackAppUsageEvent( ISteamUser* lpSteamUser, CGameID* gameId, uint32_t eAppUsageEvent, const char* pchExtraInfo ) {
// Legacy functions
// used by only a few games to track usage events
DLL_FUNCTION(void) BS_ISteamUser_TrackAppUsageEvent( ISteamUser* lpSteamUser, CGameID* gameId, uint32_t eAppUsageEvent, const char* pchExtraInfo ) {
lpSteamUser->TrackAppUsageEvent( *gameId, eAppUsageEvent, pchExtraInfo );
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_GetUserDataFolder( ISteamUser* lpSteamUser, char* pchBuffer, uint32_t cubBuffer ) {
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
DLL_FUNCTION(uint32_t) BS_ISteamUser_GetUserDataFolder( ISteamUser* lpSteamUser, char* pchBuffer, uint32_t cubBuffer ) {
return lpSteamUser->GetUserDataFolder( pchBuffer, cubBuffer );
}
BS_I
DLL_FUNCTION(void) BS_User_StartVoiceRecording( ISteamUser* lpSteamUser ) {
// Starts voice recording. Once started, use GetVoice() to get the data
DLL_FUNCTION(void) BS_ISteamUser_StartVoiceRecording( ISteamUser* lpSteamUser ) {
lpSteamUser->StartVoiceRecording( );
}
BS_I
DLL_FUNCTION(void) BS_User_StopVoiceRecording( ISteamUser* lpSteamUser ) {
// Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for
// a little bit after this function is called. GetVoice() should continue to be called until it returns
// k_eVoiceResultNotRecording
DLL_FUNCTION(void) BS_ISteamUser_StopVoiceRecording( ISteamUser* lpSteamUser ) {
lpSteamUser->StopVoiceRecording( );
}
BS_I
DLL_FUNCTION(EVoiceResult) BS_User_GetAvailableVoice( ISteamUser* lpSteamUser, uint32_t* pcbCompressed, uint32_t* pcbUncompressed, uint32_t nUncompressedVoiceDesiredSampleRate ) {
// Determine the amount of captured audio data that is available in bytes.
// This provides both the compressed and uncompressed data. Please note that the uncompressed
// data is not the raw feed from the microphone: data may only be available if audible
// levels of speech are detected.
// nUncompressedVoiceDesiredSampleRate is necessary to know the number of bytes to return in pcbUncompressed - can be set to 0 if you don't need uncompressed (the usual case)
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
DLL_FUNCTION(EVoiceResult) BS_ISteamUser_GetAvailableVoice( ISteamUser* lpSteamUser, uint32_t* pcbCompressed, uint32_t* pcbUncompressed, uint32_t nUncompressedVoiceDesiredSampleRate ) {
return lpSteamUser->GetAvailableVoice( pcbCompressed, pcbUncompressed, nUncompressedVoiceDesiredSampleRate );
}
BS_I
DLL_FUNCTION(EVoiceResult) BS_User_GetVoice( ISteamUser* lpSteamUser, uint32_t bWantCompressed, void *pDestBuffer, uint32_t cbDestBufferSize, uint32_t *nBytesWritten, uint32_t bWantUncompressed, void *pUncompressedDestBuffer, uint32_t cbUncompressedDestBufferSize, uint32_t *nUncompressBytesWritten, uint32_t nUncompressedVoiceDesiredSampleRate ) {
// Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to
// DecompressVoice() for playback later as a binary blob. Uncompressed data is 16-bit, signed integer, 11025Hz PCM format.
// Please note that the uncompressed data is not the raw feed from the microphone: data may only be available if audible
// levels of speech are detected, and may have passed through denoising filters, etc.
// This function should be called as often as possible once recording has started; once per frame at least.
// nBytesWritten is set to the number of bytes written to pDestBuffer.
// nUncompressedBytesWritten is set to the number of bytes written to pUncompressedDestBuffer.
// You must grab both compressed and uncompressed here at the same time, if you want both.
// Matching data that is not read during this call will be thrown away.
// GetAvailableVoice() can be used to determine how much data is actually available.
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
DLL_FUNCTION(EVoiceResult) BS_ISteamUser_GetVoice( ISteamUser* lpSteamUser, uint32_t bWantCompressed, void *pDestBuffer, uint32_t cbDestBufferSize, uint32_t *nBytesWritten, uint32_t bWantUncompressed, void *pUncompressedDestBuffer, uint32_t cbUncompressedDestBufferSize, uint32_t *nUncompressBytesWritten, uint32_t nUncompressedVoiceDesiredSampleRate ) {
return lpSteamUser->GetVoice( bWantCompressed != 0, pDestBuffer, cbDestBufferSize, nBytesWritten, bWantUncompressed != 0, pUncompressedDestBuffer, cbUncompressedDestBufferSize, nUncompressBytesWritten, nUncompressedVoiceDesiredSampleRate );
}
BS_I
DLL_FUNCTION(EVoiceResult) BS_User_DecompressVoice( ISteamUser* lpSteamUser, const void *pCompressed, uint32_t cbCompressed, void *pDestBuffer, uint32_t cbDestBufferSize, uint32_t *nBytesWritten, uint32_t nDesiredSampleRate ) {
// Decompresses a chunk of compressed data produced by GetVoice().
// nBytesWritten is set to the number of bytes written to pDestBuffer unless the return value is k_EVoiceResultBufferTooSmall.
// In that case, nBytesWritten is set to the size of the buffer required to decompress the given
// data. The suggested buffer size for the destination buffer is 22 kilobytes.
// The output format of the data is 16-bit signed at the requested samples per second.
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nDesiredSampleRate
DLL_FUNCTION(EVoiceResult) BS_ISteamUser_DecompressVoice( ISteamUser* lpSteamUser, const void *pCompressed, uint32_t cbCompressed, void *pDestBuffer, uint32_t cbDestBufferSize, uint32_t *nBytesWritten, uint32_t nDesiredSampleRate ) {
return lpSteamUser->DecompressVoice( pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, nBytesWritten, nDesiredSampleRate );
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_GetVoiceOptimalSampleRate( ISteamUser* lpSteamUser ) {
// This returns the frequency of the voice data as it's stored internally; calling DecompressVoice() with this size will yield the best results
DLL_FUNCTION(uint32_t) BS_ISteamUser_GetVoiceOptimalSampleRate( ISteamUser* lpSteamUser ) {
return lpSteamUser->GetVoiceOptimalSampleRate( );
}
BS_I
DLL_FUNCTION(HAuthTicket) BS_User_GetAuthSessionTicket( ISteamUser* lpSteamUser, void* pTicket, uint32_t cbMaxTicket, uint32_t* pcbTicket ) {
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
// pcbTicket retrieves the length of the actual ticket.
DLL_FUNCTION(HAuthTicket) BS_ISteamUser_GetAuthSessionTicket( ISteamUser* lpSteamUser, void* pTicket, uint32_t cbMaxTicket, uint32_t* pcbTicket ) {
return lpSteamUser->GetAuthSessionTicket( pTicket, cbMaxTicket, pcbTicket );
}
BS_I
DLL_FUNCTION(EBeginAuthSessionResult) BS_User_BeginAuthSession( ISteamUser* lpSteamUser, const void *pAuthTicket, uint32_t cbAuthTicket, CSteamID* steamID ) {
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
DLL_FUNCTION(EBeginAuthSessionResult) BS_ISteamUser_BeginAuthSession( ISteamUser* lpSteamUser, const void *pAuthTicket, uint32_t cbAuthTicket, CSteamID* steamID ) {
return lpSteamUser->BeginAuthSession( pAuthTicket, cbAuthTicket, *steamID );
}
BS_I
DLL_FUNCTION(void) BS_User_EndAuthSession( ISteamUser* lpSteamUser, CSteamID* steamID ) {
// Stop tracking started by BeginAuthSession - called when no longer playing game with this entity
DLL_FUNCTION(void) BS_ISteamUser_EndAuthSession( ISteamUser* lpSteamUser, CSteamID* steamID ) {
lpSteamUser->EndAuthSession( *steamID );
}
BS_I
DLL_FUNCTION(void) BS_User_CancelAuthTicket( ISteamUser* lpSteamUser, HAuthTicket hAuthTicket ) {
// Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to
DLL_FUNCTION(void) BS_ISteamUser_CancelAuthTicket( ISteamUser* lpSteamUser, HAuthTicket hAuthTicket ) {
lpSteamUser->CancelAuthTicket( hAuthTicket );
}
BS_I
DLL_FUNCTION(EUserHasLicenseForAppResult) BS_User_UserHasLicenseForApp( ISteamUser* lpSteamUser, CSteamID* steamID, AppId_t appID ) {
// After receiving a user's authentication data, and passing it to BeginAuthSession, use this function
// to determine if the user owns downloadable content specified by the provided AppID.
DLL_FUNCTION(EUserHasLicenseForAppResult) BS_ISteamUser_UserHasLicenseForApp( ISteamUser* lpSteamUser, CSteamID* steamID, AppId_t appID ) {
return lpSteamUser->UserHasLicenseForApp( *steamID, appID );
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_IsBehindNAT( ISteamUser* lpSteamUser ) {
// returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam
// (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT.
DLL_FUNCTION(uint32_t) BS_ISteamUser_IsBehindNAT( ISteamUser* lpSteamUser ) {
return lpSteamUser->BIsBehindNAT( );
}
BS_I
DLL_FUNCTION(void) BS_User_AdvertiseGame( ISteamUser* lpSteamUser, CSteamID* steamIDGameServer, uint32_t unIPServer, uint16_t usPortServer ) {
// set data to be replicated to friends so that they can join your game
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
DLL_FUNCTION(void) BS_ISteamUser_AdvertiseGame( ISteamUser* lpSteamUser, CSteamID* steamIDGameServer, uint32_t unIPServer, uint16_t usPortServer ) {
lpSteamUser->AdvertiseGame( *steamIDGameServer, unIPServer, usPortServer );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_User_RequestEncryptedAppTicket( ISteamUser* lpSteamUser, void* pDataToInclude, uint32_t cbDataToInclude ) {
// Requests a ticket encrypted with an app specific shared key
// pDataToInclude, cbDataToInclude will be encrypted into the ticket
// ( This is asynchronous, you must wait for the ticket to be completed by the server )
//CALL_RESULT( EncryptedAppTicketResponse_t )
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUser_RequestEncryptedAppTicket( ISteamUser* lpSteamUser, void* pDataToInclude, uint32_t cbDataToInclude ) {
return new uint64_t(lpSteamUser->RequestEncryptedAppTicket( pDataToInclude, cbDataToInclude ));
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_GetEncryptedAppTicket( ISteamUser* lpSteamUser, void *pTicket, uint32_t cbMaxTicket, uint32_t* pcbTicket ) {
// retrieve a finished ticket
DLL_FUNCTION(uint32_t) BS_ISteamUser_GetEncryptedAppTicket( ISteamUser* lpSteamUser, void *pTicket, uint32_t cbMaxTicket, uint32_t* pcbTicket ) {
return lpSteamUser->GetEncryptedAppTicket( pTicket, cbMaxTicket, pcbTicket );
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_GetGameBadgeLevel( ISteamUser* lpSteamUser, uint32_t nSeries, uint32_t bFoil ) {
// Trading Card badges data access
// if you only have one set of cards, the series will be 1
// the user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1)
DLL_FUNCTION(uint32_t) BS_ISteamUser_GetGameBadgeLevel( ISteamUser* lpSteamUser, uint32_t nSeries, uint32_t bFoil ) {
return lpSteamUser->GetGameBadgeLevel( nSeries, bFoil != 0 );
}
BS_I
DLL_FUNCTION(uint32_t) BS_User_GetPlayerSteamLevel( ISteamUser* lpSteamUser ) {
// gets the Steam Level of the user, as shown on their profile
DLL_FUNCTION(uint32_t) BS_ISteamUser_GetPlayerSteamLevel( ISteamUser* lpSteamUser ) {
return lpSteamUser->GetPlayerSteamLevel( );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_User_RequestStoreAuthURL( ISteamUser* lpSteamUser, const char* pchRedirectURL ) {
// Requests a URL which authenticates an in-game browser for store check-out,
// and then redirects to the specified URL. As long as the in-game browser
// accepts and handles session cookies, Steam microtransaction checkout pages
// will automatically recognize the user instead of presenting a login page.
// The result of this API call will be a StoreAuthURLResponse_t callback.
// NOTE: The URL has a very short lifetime to prevent history-snooping attacks,
// so you should only call this API when you are about to launch the browser,
// or else immediately navigate to the result URL using a hidden browser window.
// NOTE 2: The resulting authorization cookie has an expiration time of one day,
// so it would be a good idea to request and visit a new auth URL every 12 hours.
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUser_RequestStoreAuthURL( ISteamUser* lpSteamUser, const char* pchRedirectURL ) {
return new uint64_t(lpSteamUser->RequestStoreAuthURL( pchRedirectURL ));
}
#pragma comment(linker, "/EXPORT:BS_User_RequestStoreAuthURL=_BS_User_RequestStoreAuthURL@8")
+203 -89
View File
@@ -16,179 +16,293 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamUserStats*) BS_UserStats() {
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing stats, achievements, and leaderboard information
//-----------------------------------------------------------------------------
DLL_FUNCTION(ISteamUserStats*) BS_SteamUserStats() {
return SteamUserStats();
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_RequestCurrentStats( ISteamUserStats* lpSteamUserStats ) {
// Ask the server to send down this user's data and achievements for this game
//CALL_BACK(UserStatsReceived_t)
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_RequestCurrentStats( ISteamUserStats* lpSteamUserStats ) {
return lpSteamUserStats->RequestCurrentStats( );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetStat( ISteamUserStats* lpSteamUserStats, const char* pchName, int32_t* pData ) {
// Data accessors
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetStat( ISteamUserStats* lpSteamUserStats, const char* pchName, int32_t* pData ) {
return lpSteamUserStats->GetStat( pchName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetStatF( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t* pData ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetStatF( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t* pData ) {
return lpSteamUserStats->GetStat( pchName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_SetStat( ISteamUserStats* lpSteamUserStats, const char* pchName, int32_t pData ) {
// Set / update data
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_SetStat( ISteamUserStats* lpSteamUserStats, const char* pchName, int32_t pData ) {
return lpSteamUserStats->SetStat( pchName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_SetStatF( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t pData ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_SetStatF( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t pData ) {
return lpSteamUserStats->SetStat( pchName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_UpdateAvgRateStat( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t flCountThisSession, double_t* dSessionLength ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_UpdateAvgRateStat( ISteamUserStats* lpSteamUserStats, const char* pchName, float_t flCountThisSession, double_t* dSessionLength ) {
return lpSteamUserStats->UpdateAvgRateStat( pchName, flCountThisSession, *dSessionLength );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName, bool* pbAchieved ) {
// Achievement flag accessors
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName, bool* pbAchieved ) {
return lpSteamUserStats->GetAchievement( pchName, (bool*)pbAchieved );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_SetAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_SetAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
return lpSteamUserStats->SetAchievement( pchName );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_ClearAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_ClearAchievement( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
return lpSteamUserStats->ClearAchievement( pchName );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievementAndUnlockTime( ISteamUserStats* lpSteamUserStats, const char* pchName, bool* pbAchieved, uint32_t* punUnlockTime ) {
// Get the achievement status, and the time it was unlocked if unlocked.
// If the return value is true, but the unlock time is zero, that means it was unlocked before Steam
// began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetAchievementAndUnlockTime( ISteamUserStats* lpSteamUserStats, const char* pchName, bool* pbAchieved, uint32_t* punUnlockTime ) {
return lpSteamUserStats->GetAchievementAndUnlockTime( pchName, (bool*)pbAchieved, punUnlockTime );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_StoreStats( ISteamUserStats* lpSteamUserStats ) {
// Store the current data on the server, will get a callback when set
// And one callback for every new achievement
//
// If the callback has a result of k_EResultInvalidParam, one or more stats
// uploaded has been rejected, either because they broke constraints
// or were out of date. In this case the server sends back updated values.
// The stats should be re-iterated to keep in sync.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_StoreStats( ISteamUserStats* lpSteamUserStats ) {
return lpSteamUserStats->StoreStats( );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievementIcon( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
// Achievement / GroupAchievement metadata
// Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.
// A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback
// which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the
// specified achievement.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetAchievementIcon( ISteamUserStats* lpSteamUserStats, const char* pchName ) {
return lpSteamUserStats->GetAchievementIcon( pchName );
}
BS_I
DLL_FUNCTION(const char*) BS_UserStats_GetAchievementDisplayAttribute( ISteamUserStats* lpSteamUserStats, const char* pchName, const char* pchKey ) {
// Get general attributes for an achievement. Accepts the following keys:
// - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8)
// - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden)
DLL_FUNCTION(const char*) BS_ISteamUserStats_GetAchievementDisplayAttribute( ISteamUserStats* lpSteamUserStats, const char* pchName, const char* pchKey ) {
return lpSteamUserStats->GetAchievementDisplayAttribute( pchName, pchKey );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_IndicateAchievementProgress( ISteamUserStats* lpSteamUserStats, const char* pchName, uint32_t nCurProgress, uint32_t nMaxProgress ) {
// Achievement progress - triggers an AchievementProgress callback, that is all.
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_IndicateAchievementProgress( ISteamUserStats* lpSteamUserStats, const char* pchName, uint32_t nCurProgress, uint32_t nMaxProgress ) {
return lpSteamUserStats->IndicateAchievementProgress( pchName, nCurProgress, nMaxProgress );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetNumAchievements( ISteamUserStats* lpSteamUserStats ) {
// Used for iterating achievements. In general games should not need these functions because they should have a
// list of existing achievements compiled into them
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetNumAchievements( ISteamUserStats* lpSteamUserStats ) {
return lpSteamUserStats->GetNumAchievements( );
}
BS_I
DLL_FUNCTION(const char*) BS_UserStats_GetAchievementName( ISteamUserStats* lpSteamUserStats, uint32_t iAchievement ) {
// Get achievement name iAchievement in [0,GetNumAchievements)
DLL_FUNCTION(const char*) BS_ISteamUserStats_GetAchievementName( ISteamUserStats* lpSteamUserStats, uint32_t iAchievement ) {
return lpSteamUserStats->GetAchievementName( iAchievement );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_RequestUserStats( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser ) {
// Friends stats & achievements
// downloads stats for the user
// returns a UserStatsReceived_t received when completed
// if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail
// these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
//CALL_RESULT(UserStatsReceived_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_RequestUserStats( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser ) {
return new uint64_t( lpSteamUserStats->RequestUserStats( *steamIDUser ) );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserStat( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, uint32_t* pData ) {
// requests stat information for a user, usable after a successful call to RequestUserStats()
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetUserStat( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, uint32_t* pData ) {
return lpSteamUserStats->GetUserStat( *steamIDUser, pchName, (int32_t*)pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserStatF( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, float_t* pData ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetUserStatF( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, float_t* pData ) {
return lpSteamUserStats->GetUserStat( *steamIDUser, pchName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserAchievement( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, bool* pbAchieved ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetUserAchievement( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, bool* pbAchieved ) {
return lpSteamUserStats->GetUserAchievement( *steamIDUser, pchName, (bool*)pbAchieved );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetUserAchievementAndUnlockTime( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, bool* pbAchieved, uint32_t* punUnlockTime ) {
// See notes for GetAchievementAndUnlockTime above
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetUserAchievementAndUnlockTime( ISteamUserStats* lpSteamUserStats, CSteamID* steamIDUser, const char* pchName, bool* pbAchieved, uint32_t* punUnlockTime ) {
return lpSteamUserStats->GetUserAchievementAndUnlockTime( *steamIDUser, pchName, (bool*)pbAchieved, punUnlockTime );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_ResetAllStats( ISteamUserStats* lpSteamUserStats, uint32_t bAchievementsToo ) {
// Reset stats
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_ResetAllStats( ISteamUserStats* lpSteamUserStats, uint32_t bAchievementsToo ) {
return lpSteamUserStats->ResetAllStats( bAchievementsToo != 0 );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_FindOrCreateLeaderboard( ISteamUserStats* lpSteamUserStats, const char* pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) {
// Leaderboard functions
// asks the Steam back-end for a leaderboard by name, and will create it if it's not yet
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
//CALL_RESULT(LeaderboardFindResult_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_FindOrCreateLeaderboard( ISteamUserStats* lpSteamUserStats, const char* pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) {
return new uint64_t( lpSteamUserStats->FindOrCreateLeaderboard( pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ) );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_FindLeaderboard( ISteamUserStats* lpSteamUserStats, const char *pchLeaderboardName ) {
// as above, but won't create the leaderboard if it's not found
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
//CALL_RESULT(LeaderboardFindResult_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_FindLeaderboard( ISteamUserStats* lpSteamUserStats, const char *pchLeaderboardName ) {
return new uint64_t( lpSteamUserStats->FindLeaderboard( pchLeaderboardName ) );
}
BS_I
DLL_FUNCTION(const char*) BS_UserStats_GetLeaderboardName( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
// returns the name of a leaderboard
DLL_FUNCTION(const char*) BS_ISteamUserStats_GetLeaderboardName( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
return lpSteamUserStats->GetLeaderboardName( *hSteamLeaderboard );
}
BS_I
DLL_FUNCTION(int) BS_UserStats_GetLeaderboardEntryCount( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
// returns the total number of entries in a leaderboard, as of the last request
DLL_FUNCTION(int) BS_ISteamUserStats_GetLeaderboardEntryCount( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
return lpSteamUserStats->GetLeaderboardEntryCount( *hSteamLeaderboard );
}
BS_I
DLL_FUNCTION(ELeaderboardSortMethod) BS_UserStats_GetLeaderboardSortMethod( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
// returns the sort method of the leaderboard
DLL_FUNCTION(ELeaderboardSortMethod) BS_ISteamUserStats_GetLeaderboardSortMethod( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
return lpSteamUserStats->GetLeaderboardSortMethod( *hSteamLeaderboard );
}
BS_I
DLL_FUNCTION(ELeaderboardDisplayType) BS_UserStats_GetLeaderboardDisplayType( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
// returns the display type of the leaderboard
DLL_FUNCTION(ELeaderboardDisplayType) BS_ISteamUserStats_GetLeaderboardDisplayType( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard ) {
return lpSteamUserStats->GetLeaderboardDisplayType( *hSteamLeaderboard );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_DownloadLeaderboardEntries( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) {
// Asks the Steam back-end for a set of rows in the leaderboard.
// This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t
// LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below)
// You can ask for more entries than exist, and it will return as many as do exist.
// k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]
// k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate
// e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after
// k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user
//CALL_RESULT(LeaderboardScoresDownloaded_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_DownloadLeaderboardEntries( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) {
return new uint64_t( lpSteamUserStats->DownloadLeaderboardEntries( *hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ) );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_DownloadLeaderboardEntriesForUsers( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, CSteamID* prgUsers, int cUsers ) {
///#####
// as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers
// if a user doesn't have a leaderboard entry, they won't be included in the result
// a max of 100 users can be downloaded at a time, with only one outstanding call at a time
//CALL_RESULT(LeaderboardScoresDownloaded_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_DownloadLeaderboardEntriesForUsers( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, CSteamID* prgUsers, int cUsers ) {
return new uint64_t( lpSteamUserStats->DownloadLeaderboardEntriesForUsers( *hSteamLeaderboard, prgUsers, cUsers ) );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetDownloadedLeaderboardEntry( ISteamUserStats* lpSteamUserStats, SteamLeaderboardEntries_t* hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) {
// Returns data about a single leaderboard entry
// use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries
// e.g.
// void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded )
// {
// for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ )
// {
// LeaderboardEntry_t leaderboardEntry;
// int32 details[3]; // we know this is how many we've stored previously
// GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 );
// assert( leaderboardEntry.m_cDetails == 3 );
// ...
// }
// once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetDownloadedLeaderboardEntry( ISteamUserStats* lpSteamUserStats, SteamLeaderboardEntries_t* hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) {
return lpSteamUserStats->GetDownloadedLeaderboardEntry( *hSteamLeaderboardEntries, index, pLeaderboardEntry, pDetails, cDetailsMax );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_UploadLeaderboardScore( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32_t* pScoreDetails, int cScoreDetailsCount ) {
// Uploads a user score to the Steam back-end.
// This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t
// Details are extra game-defined information regarding how the user got that score
// pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list
//CALL_RESULT(LeaderboardScoreUploaded_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_UploadLeaderboardScore( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32_t* pScoreDetails, int cScoreDetailsCount ) {
return new uint64_t(lpSteamUserStats->UploadLeaderboardScore( *hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ));
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_AttachLeaderboardUGC( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, UGCHandle_t* hUGC ) {
// Attaches a piece of user generated content the user's entry on a leaderboard.
// hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare().
// This call is asynchronous, with the result returned in LeaderboardUGCSet_t.
//CALL_RESULT(LeaderboardUGCSet_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_AttachLeaderboardUGC( ISteamUserStats* lpSteamUserStats, SteamLeaderboard_t* hSteamLeaderboard, UGCHandle_t* hUGC ) {
return new uint64_t( lpSteamUserStats->AttachLeaderboardUGC( *hSteamLeaderboard, *hUGC ) );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_GetNumberOfCurrentPlayers( ISteamUserStats* lpSteamUserStats ) {
// Retrieves the number of players currently playing your game (online + offline)
// This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t
//CALL_RESULT(NumberOfCurrentPlayers_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_GetNumberOfCurrentPlayers( ISteamUserStats* lpSteamUserStats ) {
return new uint64_t( lpSteamUserStats->GetNumberOfCurrentPlayers( ) );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_RequestGlobalAchievementPercentages( ISteamUserStats* lpSteamUserStats ) {
// Requests that Steam fetch data on the percentage of players who have received each achievement
// for the game globally.
// This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t.
//CALL_RESULT(GlobalAchievementPercentagesReady_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_RequestGlobalAchievementPercentages( ISteamUserStats* lpSteamUserStats ) {
return new uint64_t( lpSteamUserStats->RequestGlobalAchievementPercentages( ) );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetMostAchievedAchievementInfo( ISteamUserStats* lpSteamUserStats, char *pchName, uint32_t unNameBufLen, float *pflPercent, bool* pbAchieved ) {
// Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch
// the next most achieved afterwards. Will return -1 if there is no data on achievement
// percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback).
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetMostAchievedAchievementInfo( ISteamUserStats* lpSteamUserStats, char *pchName, uint32_t unNameBufLen, float *pflPercent, bool* pbAchieved ) {
return lpSteamUserStats->GetMostAchievedAchievementInfo( pchName, unNameBufLen, pflPercent, pbAchieved );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetNextMostAchievedAchievementInfo( ISteamUserStats* lpSteamUserStats, int iIteratorPrevious, char *pchName, uint32_t unNameBufLen, float *pflPercent, bool *pbAchieved ) {
// Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another
// GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last
// achievement has been iterated.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetNextMostAchievedAchievementInfo( ISteamUserStats* lpSteamUserStats, int iIteratorPrevious, char *pchName, uint32_t unNameBufLen, float *pflPercent, bool *pbAchieved ) {
return lpSteamUserStats->GetNextMostAchievedAchievementInfo( iIteratorPrevious, pchName, unNameBufLen, pflPercent, pbAchieved );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetAchievementAchievedPercent( ISteamUserStats* lpSteamUserStats, const char *pchName, float *pflPercent ) {
// Returns the percentage of users who have achieved the specified achievement.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetAchievementAchievedPercent( ISteamUserStats* lpSteamUserStats, const char *pchName, float *pflPercent ) {
return lpSteamUserStats->GetAchievementAchievedPercent( pchName, pflPercent );
}
BS_I
DLL_FUNCTION(SteamAPICall_t*) BS_UserStats_RequestGlobalStats( ISteamUserStats* lpSteamUserStats, int nHistoryDays ) {
// Requests global stats data, which is available for stats marked as "aggregated".
// This call is asynchronous, with the results returned in GlobalStatsReceived_t.
// nHistoryDays specifies how many days of day-by-day history to retrieve in addition
// to the overall totals. The limit is 60.
//CALL_RESULT(GlobalStatsReceived_t)
DLL_FUNCTION(SteamAPICall_t*) BS_ISteamUserStats_RequestGlobalStats( ISteamUserStats* lpSteamUserStats, int nHistoryDays ) {
return new uint64_t( lpSteamUserStats->RequestGlobalStats( nHistoryDays ) );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatLL( ISteamUserStats* lpSteamUserStats, const char *pchStatName, int64* pData ) {
// Gets the lifetime totals for an aggregated stat
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetGlobalStatL( ISteamUserStats* lpSteamUserStats, const char *pchStatName, int64* pData ) {
return lpSteamUserStats->GetGlobalStat( pchStatName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatD( ISteamUserStats* lpSteamUserStats, const char *pchStatName, double* pData ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetGlobalStatD( ISteamUserStats* lpSteamUserStats, const char *pchStatName, double* pData ) {
return lpSteamUserStats->GetGlobalStat( pchStatName, pData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatHistoryLL( ISteamUserStats* lpSteamUserStats, const char *pchStatName, int64 *pData, uint32_t cubData ) {
// Gets history for an aggregated stat. pData will be filled with daily values, starting with today.
// So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago,
// etc. cubData is the size in bytes of the pubData buffer. Returns the number of
// elements actually set.
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetGlobalStatHistoryL( ISteamUserStats* lpSteamUserStats, const char *pchStatName, int64 *pData, uint32_t cubData ) {
return lpSteamUserStats->GetGlobalStatHistory( pchStatName, pData, cubData );
}
BS_I
DLL_FUNCTION(uint32_t) BS_UserStats_GetGlobalStatHistoryD( ISteamUserStats* lpSteamUserStats, const char *pchStatName, double *pData, uint32_t cubData ) {
DLL_FUNCTION(uint32_t) BS_ISteamUserStats_GetGlobalStatHistoryD( ISteamUserStats* lpSteamUserStats, const char *pchStatName, double *pData, uint32_t cubData ) {
return lpSteamUserStats->GetGlobalStatHistory( pchStatName, pData, cubData );
}
#pragma comment(linker, "/EXPORT:BS_UserStats_GetGlobalStatHistoryD=_BS_UserStats_GetGlobalStatHistoryD@16")
}
+7 -2
View File
@@ -16,7 +16,12 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamUtils*) BS_Utils() {
DLL_FUNCTION(ISteamUtils*) BS_SteamUtils() {
return SteamUtils();
}
BS_I
DLL_FUNCTION(ISteamUtils*) BS_SteamGameServerUtils() {
return SteamGameServerUtils();
}
#pragma message("SteamUtils is not ported yet. TODO!")
+3 -2
View File
@@ -16,7 +16,8 @@
#include "BlitzSteam.h"
DLL_FUNCTION(ISteamVideo*) BS_Video() {
DLL_FUNCTION(ISteamVideo*) BS_SteamVideo() {
return SteamVideo();
}
BS_I
#pragma message("SteamVideo is not ported yet. TODO!")