Merge branch 'master' into overlay_h

This commit is contained in:
Nemirtingas 2019-08-01 15:56:43 +02:00
commit 884f147e1b
39 changed files with 2255 additions and 22082 deletions

View file

@ -161,6 +161,8 @@ S_API void * S_CALLTYPE SteamInternal_CreateInterface( const char *ver )
steam_client = (ISteamClient016 *)get_steam_client();
} else if (strcmp(ver, "SteamClient017") == 0) {
steam_client = (ISteamClient017 *)get_steam_client();
} else if (strcmp(ver, "SteamClient018") == 0) {
steam_client = (ISteamClient018 *)get_steam_client();
} else if (strcmp(ver, STEAMCLIENT_INTERFACE_VERSION) == 0) {
steam_client = (ISteamClient *)get_steam_client();
} else {

View file

@ -197,6 +197,11 @@ S_API class ISteamParties * SteamAPI_ISteamClient_GetISteamParties(intptr_t inst
return get_steam_client()->GetISteamParties(hSteamUser, hSteamPipe, pchVersion);
}
S_API class ISteamRemotePlay * SteamAPI_ISteamClient_GetISteamRemotePlay(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion)
{
return get_steam_client()->GetISteamRemotePlay(hSteamUser, hSteamPipe, pchVersion);
}
S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser(intptr_t instancePtr)
{
return (get_steam_client()->steam_user)->GetHSteamUser();
@ -347,6 +352,11 @@ S_API SteamAPICall_t SteamAPI_ISteamUser_GetMarketEligibility(intptr_t instanceP
return (get_steam_client()->steam_user)->GetMarketEligibility();
}
S_API SteamAPICall_t SteamAPI_ISteamUser_GetDurationControl(intptr_t instancePtr)
{
return (get_steam_client()->steam_user)->GetDurationControl();
}
S_API const char * SteamAPI_ISteamFriends_GetPersonaName(intptr_t instancePtr)
{
return (get_steam_client()->steam_friends)->GetPersonaName();
@ -714,147 +724,386 @@ S_API int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(intptr_t
S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceAppActive(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetSecondsSinceAppActive();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetSecondsSinceAppActive();
}
S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetSecondsSinceComputerActive();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetSecondsSinceComputerActive();
}
S_API EUniverse SteamAPI_ISteamUtils_GetConnectedUniverse(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetConnectedUniverse();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetConnectedUniverse();
}
S_API uint32 SteamAPI_ISteamUtils_GetServerRealTime(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetServerRealTime();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetServerRealTime();
}
S_API const char * SteamAPI_ISteamUtils_GetIPCountry(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetIPCountry();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetIPCountry();
}
S_API bool SteamAPI_ISteamUtils_GetImageSize(intptr_t instancePtr, int iImage, uint32 * pnWidth, uint32 * pnHeight)
{
return ((ISteamUtils *)instancePtr)->GetImageSize(iImage, pnWidth, pnHeight);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetImageSize(iImage, pnWidth, pnHeight);
}
S_API bool SteamAPI_ISteamUtils_GetImageRGBA(intptr_t instancePtr, int iImage, uint8 * pubDest, int nDestBufferSize)
{
return ((ISteamUtils *)instancePtr)->GetImageRGBA(iImage, pubDest, nDestBufferSize);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetImageRGBA(iImage, pubDest, nDestBufferSize);
}
S_API bool SteamAPI_ISteamUtils_GetCSERIPPort(intptr_t instancePtr, uint32 * unIP, uint16 * usPort)
{
return ((ISteamUtils *)instancePtr)->GetCSERIPPort(unIP, usPort);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetCSERIPPort(unIP, usPort);
}
S_API uint8 SteamAPI_ISteamUtils_GetCurrentBatteryPower(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetCurrentBatteryPower();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetCurrentBatteryPower();
}
S_API uint32 SteamAPI_ISteamUtils_GetAppID(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetAppID();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetAppID();
}
S_API void SteamAPI_ISteamUtils_SetOverlayNotificationPosition(intptr_t instancePtr, ENotificationPosition eNotificationPosition)
{
return ((ISteamUtils *)instancePtr)->SetOverlayNotificationPosition(eNotificationPosition);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->SetOverlayNotificationPosition(eNotificationPosition);
}
S_API bool SteamAPI_ISteamUtils_IsAPICallCompleted(intptr_t instancePtr, SteamAPICall_t hSteamAPICall, bool * pbFailed)
{
return ((ISteamUtils *)instancePtr)->IsAPICallCompleted(hSteamAPICall, pbFailed);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->IsAPICallCompleted(hSteamAPICall, pbFailed);
}
S_API ESteamAPICallFailure SteamAPI_ISteamUtils_GetAPICallFailureReason(intptr_t instancePtr, SteamAPICall_t hSteamAPICall)
{
return ((ISteamUtils *)instancePtr)->GetAPICallFailureReason(hSteamAPICall);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetAPICallFailureReason(hSteamAPICall);
}
S_API bool SteamAPI_ISteamUtils_GetAPICallResult(intptr_t instancePtr, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed)
{
return ((ISteamUtils *)instancePtr)->GetAPICallResult(hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetAPICallResult(hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
}
S_API uint32 SteamAPI_ISteamUtils_GetIPCCallCount(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetIPCCallCount();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetIPCCallCount();
}
S_API void SteamAPI_ISteamUtils_SetWarningMessageHook(intptr_t instancePtr, SteamAPIWarningMessageHook_t pFunction)
{
return ((ISteamUtils *)instancePtr)->SetWarningMessageHook(pFunction);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->SetWarningMessageHook(pFunction);
}
S_API bool SteamAPI_ISteamUtils_IsOverlayEnabled(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->IsOverlayEnabled();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->IsOverlayEnabled();
}
S_API bool SteamAPI_ISteamUtils_BOverlayNeedsPresent(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->BOverlayNeedsPresent();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->BOverlayNeedsPresent();
}
S_API SteamAPICall_t SteamAPI_ISteamUtils_CheckFileSignature(intptr_t instancePtr, const char * szFileName)
{
return ((ISteamUtils *)instancePtr)->CheckFileSignature(szFileName);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->CheckFileSignature(szFileName);
}
S_API bool SteamAPI_ISteamUtils_ShowGamepadTextInput(intptr_t instancePtr, EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char * pchDescription, uint32 unCharMax, const char * pchExistingText)
{
return ((ISteamUtils *)instancePtr)->ShowGamepadTextInput(eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->ShowGamepadTextInput(eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText);
}
S_API uint32 SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetEnteredGamepadTextLength();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetEnteredGamepadTextLength();
}
S_API bool SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(intptr_t instancePtr, char * pchText, uint32 cchText)
{
return ((ISteamUtils *)instancePtr)->GetEnteredGamepadTextInput(pchText, cchText);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetEnteredGamepadTextInput(pchText, cchText);
}
S_API const char * SteamAPI_ISteamUtils_GetSteamUILanguage(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->GetSteamUILanguage();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->GetSteamUILanguage();
}
S_API bool SteamAPI_ISteamUtils_IsSteamRunningInVR(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->IsSteamRunningInVR();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->IsSteamRunningInVR();
}
S_API void SteamAPI_ISteamUtils_SetOverlayNotificationInset(intptr_t instancePtr, int nHorizontalInset, int nVerticalInset)
{
return ((ISteamUtils *)instancePtr)->SetOverlayNotificationInset(nHorizontalInset, nVerticalInset);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->SetOverlayNotificationInset(nHorizontalInset, nVerticalInset);
}
S_API bool SteamAPI_ISteamUtils_IsSteamInBigPictureMode(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->IsSteamInBigPictureMode();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->IsSteamInBigPictureMode();
}
S_API void SteamAPI_ISteamUtils_StartVRDashboard(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->StartVRDashboard();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->StartVRDashboard();
}
S_API bool SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(intptr_t instancePtr)
{
return ((ISteamUtils *)instancePtr)->IsVRHeadsetStreamingEnabled();
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->IsVRHeadsetStreamingEnabled();
}
S_API void SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(intptr_t instancePtr, bool bEnabled)
{
return ((ISteamUtils *)instancePtr)->SetVRHeadsetStreamingEnabled(bEnabled);
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->SetVRHeadsetStreamingEnabled(bEnabled);
}
S_API bool SteamAPI_ISteamUtils_IsSteamChinaLauncher(intptr_t instancePtr)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->IsSteamChinaLauncher();
}
S_API bool SteamAPI_ISteamUtils_InitFilterText(intptr_t instancePtr)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->InitFilterText();
}
S_API int SteamAPI_ISteamUtils_FilterText(intptr_t instancePtr, char * pchOutFilteredText, uint32 nByteSizeOutFilteredText, const char * pchInputMessage, bool bLegalOnly)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
auto ptr = get_steam_client()->steam_gameserver_utils;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_utils;
}
return (ptr)->FilterText(pchOutFilteredText, nByteSizeOutFilteredText, pchInputMessage, bLegalOnly);
}
S_API int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(intptr_t instancePtr)
@ -2597,6 +2846,16 @@ S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin(intptr_t ins
return (get_steam_client()->steam_controller)->TranslateActionOrigin(eDestinationInputType, eSourceOrigin);
}
S_API bool SteamAPI_ISteamInput_GetDeviceBindingRevision(intptr_t instancePtr, InputHandle_t inputHandle, int * pMajor, int * pMinor)
{
return (get_steam_client()->steam_controller)->GetDeviceBindingRevision(inputHandle, pMajor, pMinor);
}
S_API uint32 SteamAPI_ISteamInput_GetRemotePlaySessionID(intptr_t instancePtr, InputHandle_t inputHandle)
{
return (get_steam_client()->steam_controller)->GetRemotePlaySessionID(inputHandle);
}
S_API bool SteamAPI_ISteamController_Init(intptr_t instancePtr)
{
return (get_steam_client()->steam_controller)->Init();
@ -2762,6 +3021,11 @@ S_API EControllerActionOrigin SteamAPI_ISteamController_TranslateActionOrigin(in
return (get_steam_client()->steam_controller)->TranslateActionOrigin(eDestinationInputType, eSourceOrigin);
}
S_API bool SteamAPI_ISteamController_GetControllerBindingRevision(intptr_t instancePtr, ControllerHandle_t controllerHandle, int * pMajor, int * pMinor)
{
return (get_steam_client()->steam_controller)->GetControllerBindingRevision(controllerHandle, pMajor, pMinor);
}
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(intptr_t instancePtr, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
@ -2930,6 +3194,18 @@ S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(intptr_t instancePtr, UGCQu
return (ptr)->GetQueryUGCKeyValueTag(handle, index, keyValueTagIndex, pchKey, cchKeySize, pchValue, cchValueSize);
}
S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag0(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, const char * pchKey, char * pchValue, uint32 cchValueSize)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_ugc);
auto ptr = get_steam_client()->steam_gameserver_ugc;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_ugc;
}
return (ptr)->GetQueryUGCKeyValueTag(handle, index, pchKey, pchValue, cchValueSize);
}
S_API bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(intptr_t instancePtr, UGCQueryHandle_t handle)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
@ -3290,6 +3566,18 @@ S_API bool SteamAPI_ISteamUGC_SetAllowLegacyUpload(intptr_t instancePtr, UGCUpda
return (ptr)->SetAllowLegacyUpload(handle, bAllowLegacyUpload);
}
S_API bool SteamAPI_ISteamUGC_RemoveAllItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_ugc);
auto ptr = get_steam_client()->steam_gameserver_ugc;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_ugc;
}
return (ptr)->RemoveAllItemKeyValueTags(handle);
}
S_API bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey)
{
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
@ -4378,6 +4666,36 @@ S_API bool SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(intptr_t instan
return ((ISteamParentalSettings *)instancePtr)->BIsFeatureInBlockList(eFeature);
}
S_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount(intptr_t instancePtr)
{
return ((ISteamRemotePlay *)instancePtr)->GetSessionCount();
}
S_API uint32 SteamAPI_ISteamRemotePlay_GetSessionID(intptr_t instancePtr, int iSessionIndex)
{
return ((ISteamRemotePlay *)instancePtr)->GetSessionID(iSessionIndex);
}
S_API uint64 SteamAPI_ISteamRemotePlay_GetSessionSteamID(intptr_t instancePtr, uint32 unSessionID)
{
return ((ISteamRemotePlay *)instancePtr)->GetSessionSteamID(unSessionID).ConvertToUint64();
}
S_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName(intptr_t instancePtr, uint32 unSessionID)
{
return ((ISteamRemotePlay *)instancePtr)->GetSessionClientName(unSessionID);
}
S_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor(intptr_t instancePtr, uint32 unSessionID)
{
return ((ISteamRemotePlay *)instancePtr)->GetSessionClientFormFactor(unSessionID);
}
S_API bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution(intptr_t instancePtr, uint32 unSessionID, int * pnResolutionX, int * pnResolutionY)
{
return ((ISteamRemotePlay *)instancePtr)->BGetSessionClientResolution(unSessionID, pnResolutionX, pnResolutionY);
}
S_API bool SteamAPI_ISteamGameServer_InitGameServer(intptr_t instancePtr, uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char * pchVersionString)
{
return ((ISteamGameServer *)instancePtr)->InitGameServer(unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString);

View file

@ -18,6 +18,8 @@
#include "local_storage.h"
#include <fstream>
#include <algorithm>
#include <iterator>
struct File_Data {
std::string name;
@ -75,12 +77,12 @@ int Local_Storage::store_data_settings(std::string file, char *data, unsigned in
return -1;
}
int Local_Storage::get_file_data(std::string full_path, char *data, unsigned int max_length)
int Local_Storage::get_file_data(std::string full_path, char *data, unsigned int max_length, unsigned int offset)
{
return -1;
}
int Local_Storage::get_data(std::string folder, std::string file, char *data, unsigned int max_length)
int Local_Storage::get_data(std::string folder, std::string file, char *data, unsigned int max_length, unsigned int offset)
{
return -1;
}
@ -535,22 +537,19 @@ int Local_Storage::store_data_settings(std::string file, char *data, unsigned in
return store_file_data(get_global_settings_path(), file, data, length);
}
int Local_Storage::get_file_data(std::string full_path, char *data, unsigned int max_length)
int Local_Storage::get_file_data(std::string full_path, char *data, unsigned int max_length, unsigned int offset)
{
std::ifstream myfile;
myfile.open(full_path, std::ios::binary | std::ios::in);
if (!myfile.is_open()) return -1;
std::streampos size = myfile.tellg();
myfile.seekg (0, std::ios::beg);
if (size > max_length) max_length = size;
myfile.seekg (offset, std::ios::beg);
myfile.read (data, max_length);
myfile.close();
return myfile.gcount();
}
int Local_Storage::get_data(std::string folder, std::string file, char *data, unsigned int max_length)
int Local_Storage::get_data(std::string folder, std::string file, char *data, unsigned int max_length, unsigned int offset)
{
file = sanitize_file_name(file);
if (folder.back() != *PATH_SEPARATOR) {
@ -558,7 +557,7 @@ int Local_Storage::get_data(std::string folder, std::string file, char *data, un
}
std::string full_path = save_directory + appid + folder + file;
return get_file_data(full_path, data, max_length);
return get_file_data(full_path, data, max_length, offset);
}
int Local_Storage::get_data_settings(std::string file, char *data, unsigned int max_length)

View file

@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include "base.h"
#include <vector>
#ifndef LOCAL_STORAGE_INCLUDE
#define LOCAL_STORAGE_INCLUDE
@ -39,14 +40,14 @@ public:
static std::string get_game_settings_path();
static std::string get_user_appdata_path();
Local_Storage(std::string save_directory);
static int get_file_data(std::string full_path, char *data, unsigned int max_length);
static int get_file_data(std::string full_path, char *data, unsigned int max_length, unsigned int offset=0);
void setAppId(uint32 appid);
static int store_file_data(std::string folder, std::string file, char *data, unsigned int length);
static std::vector<std::string> get_filenames_path(std::string path);
int store_data(std::string folder, std::string file, char *data, unsigned int length);
int store_data_settings(std::string file, char *data, unsigned int length);
int get_data(std::string folder, std::string file, char *data, unsigned int max_length);
int get_data(std::string folder, std::string file, char *data, unsigned int max_length, unsigned int offset=0);
int get_data_settings(std::string file, char *data, unsigned int max_length);
int count_files(std::string folder);
bool iterate_file(std::string folder, int index, char *output_filename, int32 *output_size);

View file

@ -314,7 +314,7 @@ Steam_Client::Steam_Client()
steam_user_stats = new Steam_User_Stats(settings_client, local_storage, callback_results_client, callbacks_client);
steam_apps = new Steam_Apps(settings_client, callback_results_client);
steam_networking = new Steam_Networking(settings_client, network, callbacks_client, run_every_runcb);
steam_remote_storage = new Steam_Remote_Storage(local_storage, callback_results_client);
steam_remote_storage = new Steam_Remote_Storage(settings_client, local_storage, callback_results_client);
steam_screenshots = new Steam_Screenshots();
steam_http = new Steam_HTTP(settings_client, network, callback_results_client, callbacks_client);
steam_controller = new Steam_Controller();
@ -333,6 +333,7 @@ Steam_Client::Steam_Client()
steam_unified_messages = new Steam_Unified_Messages(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_game_search = new Steam_Game_Search(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_parties = new Steam_Parties(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_remoteplay = new Steam_RemotePlay(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
PRINT_DEBUG("client init gameserver\n");
steam_gameserver = new Steam_GameServer(settings_server, network, callbacks_server);
@ -680,6 +681,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
if (strcmp(pchVersion, "SteamNetworkingSockets001") == 0) {
return (void *)(ISteamNetworkingSockets001 *) steam_networking_sockets_temp;
} else if (strcmp(pchVersion, "SteamNetworkingSockets002") == 0) {
return (void *)(ISteamNetworkingSockets002 *) steam_networking_sockets_temp;
} else {
return (void *)(ISteamNetworkingSockets *) steam_networking_sockets_temp;
}
@ -694,6 +697,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
return (void *)(ISteamGameCoordinator *)steam_game_coordinator_temp;
} else if (strstr(pchVersion, "SteamNetworkingUtils") == pchVersion) {
if (strcmp(pchVersion, "SteamNetworkingUtils001") == 0) {
return (void *)(ISteamNetworkingUtils001 *)steam_networking_utils;
} else if (strcmp(pchVersion, STEAMNETWORKINGUTILS_INTERFACE_VERSION) == 0) {
return (void *)(ISteamNetworkingUtils *)steam_networking_utils;
} else {
return (void *)(ISteamNetworkingUtils *)steam_networking_utils;
@ -750,6 +755,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
return GetISteamParties(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "SteamInput") == pchVersion) {
return GetISteamInput(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "STEAMREMOTEPLAY_INTERFACE_VERSION") == pchVersion) {
return GetISteamRemotePlay(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "STEAMPARENTALSETTINGS_INTERFACE_VERSION") == pchVersion) {
return GetISteamParentalSettings(hSteamUser, hSteamPipe, pchVersion);
} else {
@ -1029,8 +1036,10 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION010") == 0) {
return (ISteamUGC *)(void *)(ISteamUGC010 *)steam_ugc_temp;
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION011") == 0) {
//TODO
return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp;
//TODO ?
return (ISteamUGC *)(void *)(ISteamUGC012 *)steam_ugc_temp;
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION012") == 0) {
return (ISteamUGC *)(void *)(ISteamUGC012 *)steam_ugc_temp;
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp;
} else {
@ -1209,6 +1218,15 @@ ISteamParties *Steam_Client::GetISteamParties( HSteamUser hSteamUser, HSteamPipe
return steam_parties;
}
ISteamRemotePlay *Steam_Client::GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{
PRINT_DEBUG("GetISteamRemotePlay %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL;
return steam_remoteplay;
}
void Steam_Client::RegisterCallback( class CCallbackBase *pCallback, int iCallback)
{
int base_callback = (iCallback / 100) * 100;

View file

@ -43,6 +43,7 @@
#include "steam_unified_messages.h"
#include "steam_gamesearch.h"
#include "steam_parties.h"
#include "steam_remoteplay.h"
#include "steam_gameserver.h"
#include "steam_gameserverstats.h"
@ -64,6 +65,7 @@ public ISteamClient014,
public ISteamClient015,
public ISteamClient016,
public ISteamClient017,
public ISteamClient018,
public ISteamClient
{
public:
@ -101,6 +103,7 @@ public:
Steam_Unified_Messages *steam_unified_messages;
Steam_Game_Search *steam_game_search;
Steam_Parties *steam_parties;
Steam_RemotePlay *steam_remoteplay;
Steam_GameServer *steam_gameserver;
Steam_Utils *steam_gameserver_utils;
@ -261,6 +264,9 @@ public:
// Steam Parties interface
ISteamParties *GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
// Steam Remote Play interface
ISteamRemotePlay *GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
void RegisterCallback( class CCallbackBase *pCallback, int iCallback);
void UnregisterCallback( class CCallbackBase *pCallback);

View file

@ -350,5 +350,22 @@ EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType,
return k_EInputActionOrigin_None;
}
bool GetControllerBindingRevision( ControllerHandle_t controllerHandle, int *pMajor, int *pMinor )
{
PRINT_DEBUG("GetControllerBindingRevision\n");
return false;
}
bool GetDeviceBindingRevision( InputHandle_t inputHandle, int *pMajor, int *pMinor )
{
PRINT_DEBUG("GetDeviceBindingRevision\n");
return false;
}
uint32 GetRemotePlaySessionID( InputHandle_t inputHandle )
{
PRINT_DEBUG("GetRemotePlaySessionID\n");
return 0;
}
};

View file

@ -48,6 +48,7 @@ struct Connect_Socket {
class Steam_Networking_Sockets :
public ISteamNetworkingSockets001,
public ISteamNetworkingSockets002,
public ISteamNetworkingSockets
{
class Settings *settings;
@ -866,6 +867,45 @@ bool GetIdentity( SteamNetworkingIdentity *pIdentity )
PRINT_DEBUG("Steam_Networking_Sockets::GetIdentity\n");
}
/// Indicate our desire to be ready participate in authenticated communications.
/// If we are currently not ready, then steps will be taken to obtain the necessary
/// certificates. (This includes a certificate for us, as well as any CA certificates
/// needed to authenticate peers.)
///
/// You can call this at program init time if you know that you are going to
/// be making authenticated connections, so that we will be ready immediately when
/// those connections are attempted. (Note that essentially all connections require
/// authentication, with the exception of ordinary UDP connections with authentication
/// disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don't call
/// this function, we will wait until a feature is utilized that that necessitates
/// these resources.
///
/// You can also call this function to force a retry, if failure has occurred.
/// Once we make an attempt and fail, we will not automatically retry.
/// In this respect, the behavior of the system after trying and failing is the same
/// as before the first attempt: attempting authenticated communication or calling
/// this function will call the system to attempt to acquire the necessary resources.
///
/// You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t
/// to monitor the status.
///
/// Returns the current value that would be returned from GetAuthenticationStatus.
ESteamNetworkingAvailability InitAuthentication()
{
PRINT_DEBUG("Steam_Networking_Sockets::InitAuthentication\n");
}
/// Query our readiness to participate in authenticated communications. A
/// SteamNetAuthenticationStatus_t callback is posted any time this status changes,
/// but you can use this function to query it at any time.
///
/// The value of SteamNetAuthenticationStatus_t::m_eAvail is returned. If you only
/// want this high level status, you can pass NULL for pDetails. If you want further
/// details, pass non-NULL to receive them.
ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails )
{
PRINT_DEBUG("Steam_Networking_Sockets::GetAuthenticationStatus\n");
}
//#ifndef STEAMNETWORKINGSOCKETS_OPENSOURCE
@ -971,14 +1011,44 @@ SteamNetworkingPOPID GetHostedDedicatedServerPOPID()
/// This function will fail if SteamDatagramServer_Init has not been called.
///
/// Returns false if the SDR_LISTEN_PORT environment variable is not set.
bool GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting )
bool GetHostedDedicatedServerAddress001( SteamDatagramHostedAddress *pRouting )
{
PRINT_DEBUG("Steam_Networking_Sockets::GetHostedDedicatedServerAddress %p\n", pRouting);
std::lock_guard<std::recursive_mutex> lock(global_mutex);
pRouting->SetDevAddress(network->getOwnIP(), 27054);
return true;
PRINT_DEBUG("Steam_Networking_Sockets::GetHostedDedicatedServerAddress002 %p\n", pRouting);
return GetHostedDedicatedServerAddress(pRouting) == k_EResultOK;
}
/// Return info about the hosted server. This contains the PoPID of the server,
/// and opaque routing information that can be used by the relays to send traffic
/// to your server.
///
/// You will need to send this information to your backend, and put it in tickets,
/// so that the relays will know how to forward traffic from
/// clients to your server. See SteamDatagramRelayAuthTicket for more info.
///
/// Also, note that the routing information is contained in SteamDatagramGameCoordinatorServerLogin,
/// so if possible, it's preferred to use GetGameCoordinatorServerLogin to send this info
/// to your game coordinator service, and also login securely at the same time.
///
/// On a successful exit, k_EResultOK is returned
///
/// Unsuccessful exit:
/// - Something other than k_EResultOK is returned.
/// - k_EResultInvalidState: We are not configured to listen for SDR (SDR_LISTEN_SOCKET
/// is not set.)
/// - k_EResultPending: we do not (yet) have the authentication information needed.
/// (See GetAuthenticationStatus.) If you use environment variables to pre-fetch
/// the network config, this data should always be available immediately.
/// - A non-localized diagnostic debug message will be placed in m_data that describes
/// the cause of the failure.
///
/// NOTE: The returned blob is not encrypted. Send it to your backend, but don't
/// directly share it with clients.
virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting )
{
std::lock_guard<std::recursive_mutex> lock(global_mutex);
pRouting->SetDevAddress(network->getOwnIP(), 27054);
return k_EResultOK;
}
/// Create a listen socket on the specified virtual port. The physical UDP port to use
/// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not
@ -1066,6 +1136,40 @@ bool SetConnectionConfigurationValue( HSteamNetConnection hConn, ESteamNetworkin
PRINT_DEBUG("Steam_Networking_Sockets::SetConnectionConfigurationValue\n");
}
/// Generate an authentication blob that can be used to securely login with
/// your backend, using SteamDatagram_ParseHostedServerLogin. (See
/// steamdatagram_gamecoordinator.h)
///
/// Before calling the function:
/// - Populate the app data in pLoginInfo (m_cbAppData and m_appData). You can leave
/// all other fields uninitialized.
/// - *pcbSignedBlob contains the size of the buffer at pBlob. (It should be
/// at least k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized.)
///
/// On a successful exit:
/// - k_EResultOK is returned
/// - All of the remaining fields of pLoginInfo will be filled out.
/// - *pcbSignedBlob contains the size of the serialized blob that has been
/// placed into pBlob.
///
/// Unsuccessful exit:
/// - Something other than k_EResultOK is returned.
/// - k_EResultNotLoggedOn: you are not logged in (yet)
/// - See GetHostedDedicatedServerAddress for more potential failure return values.
/// - A non-localized diagnostic debug message will be placed in pBlob that describes
/// the cause of the failure.
///
/// This works by signing the contents of the SteamDatagramGameCoordinatorServerLogin
/// with the cert that is issued to this server. In dev environments, it's OK if you do
/// not have a cert. (You will need to enable insecure dev login in SteamDatagram_ParseHostedServerLogin.)
/// Otherwise, you will need a signed cert.
///
/// NOTE: The routing blob returned here is not encrypted. Send it to your backend
/// and don't share it directly with clients.
EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob )
{
PRINT_DEBUG("Steam_Networking_Sockets::GetGameCoordinatorServerLogin\n");
}
// TEMP KLUDGE Call to invoke all queued callbacks.
// Eventually this function will go away, and callwacks will be ordinary Steamworks callbacks.

View file

@ -18,6 +18,7 @@
#include "base.h"
class Steam_Networking_Utils :
public ISteamNetworkingUtils001,
public ISteamNetworkingUtils
{
class Settings *settings;
@ -69,6 +70,20 @@ bool InitializeRelayAccess()
return true;
}
/// Fetch current status of the relay network.
///
/// SteamRelayNetworkStatus_t is also a callback. It will be triggered on
/// both the user and gameserver interfaces any time the status changes, or
/// ping measurement starts or stops.
///
/// SteamRelayNetworkStatus_t::m_eAvail is returned. If you want
/// more details, you can pass a non-NULL value.
ESteamNetworkingAvailability GetRelayNetworkStatus( SteamRelayNetworkStatus_t *pDetails )
{
PRINT_DEBUG("Steam_Networking_Utils::GetRelayNetworkStatus\n");
return k_ESteamNetworkingAvailability_Current;
}
float GetLocalPingLocation( SteamNetworkPingLocation_t &result )
{
PRINT_DEBUG("Steam_Networking_Utils::GetLocalPingLocation\n");

View file

@ -31,6 +31,10 @@ struct Stream_Write {
std::vector<char> file_data;
};
struct Downloaded_File {
std::string file;
uint64 total_size;
};
class Steam_Remote_Storage :
public ISteamRemoteStorage001,
@ -49,15 +53,19 @@ public ISteamRemoteStorage013,
public ISteamRemoteStorage
{
private:
class Settings *settings;
Local_Storage *local_storage;
class SteamCallResults *callback_results;
bool steam_cloud_enabled;
std::vector<struct Async_Read> async_reads;
std::vector<struct Stream_Write> stream_writes;
std::map<UGCHandle_t, std::string> shared_files;
std::map<UGCHandle_t, struct Downloaded_File> downloaded_files;
public:
Steam_Remote_Storage(Local_Storage *local_storage, class SteamCallResults *callback_results)
Steam_Remote_Storage(class Settings *settings, Local_Storage *local_storage, class SteamCallResults *callback_results)
{
this->settings = settings;
this->local_storage = local_storage;
this->callback_results = callback_results;
steam_cloud_enabled = true;
@ -176,9 +184,14 @@ SteamAPICall_t FileShare( const char *pchFile )
PRINT_DEBUG("Steam_Remote_Storage::FileShare\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
RemoteStorageFileShareResult_t data = {};
data.m_eResult = k_EResultOK;
data.m_hFile = generate_steam_api_call_id();
strncpy(data.m_rgchFilename, pchFile, sizeof(data.m_rgchFilename) - 1);
if (local_storage->file_exists(REMOTE_STORAGE_FOLDER, pchFile)) {
data.m_eResult = k_EResultOK;
data.m_hFile = generate_steam_api_call_id();
strncpy(data.m_rgchFilename, pchFile, sizeof(data.m_rgchFilename) - 1);
shared_files[data.m_hFile] = pchFile;
} else {
data.m_eResult = k_EResultFileNotFound;
}
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
}
@ -354,12 +367,28 @@ STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t )
SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority )
{
PRINT_DEBUG("Steam_Remote_Storage::UGCDownload\n");
RemoteStorageDownloadUGCResult_t data = {};
if (shared_files.count(hContent)) {
data.m_eResult = k_EResultOK;
data.m_hFile = hContent;
data.m_nAppID = settings->get_local_game_id().AppID();
data.m_nSizeInBytes = local_storage->file_size(REMOTE_STORAGE_FOLDER, shared_files[hContent]);
shared_files[hContent].copy(data.m_pchFileName, sizeof(data.m_pchFileName) - 1);
data.m_ulSteamIDOwner = settings->get_local_steam_id().ConvertToUint64();
downloaded_files[hContent].file = shared_files[hContent];
downloaded_files[hContent].total_size = data.m_nSizeInBytes;
} else {
data.m_eResult = k_EResultFileNotFound; //TODO: not sure if this is the right result
}
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
}
STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t )
SteamAPICall_t UGCDownload( UGCHandle_t hContent )
{
PRINT_DEBUG("Steam_Remote_Storage::UGCDownload old\n");
return UGCDownload(hContent, 1);
}
@ -392,16 +421,31 @@ bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, STEAM_OUT_STRING() c
int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction )
{
PRINT_DEBUG("Steam_Remote_Storage::UGCRead\n");
if (!downloaded_files.count(hContent) || cubDataToRead < 0) {
return -1; //TODO: is this the right return value?
}
Downloaded_File f = downloaded_files[hContent];
int read_data = local_storage->get_data(REMOTE_STORAGE_FOLDER, f.file, (char* )pvData, cubDataToRead, cOffset);
if (eAction == k_EUGCRead_Close || (eAction == k_EUGCRead_ContinueReadingUntilFinished && (read_data < cubDataToRead || (cOffset + cubDataToRead) >= f.total_size))) {
downloaded_files.erase(hContent);
}
PRINT_DEBUG("Read %i\n", read_data);
return read_data;
}
int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead )
{
PRINT_DEBUG("Steam_Remote_Storage::UGCRead old\n");
return UGCRead( hContent, pvData, cubDataToRead, 0);
}
int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset)
{
PRINT_DEBUG("Steam_Remote_Storage::UGCRead old\n");
PRINT_DEBUG("Steam_Remote_Storage::UGCRead old2\n");
return UGCRead(hContent, pvData, cubDataToRead, cOffset, k_EUGCRead_ContinueReadingUntilFinished);
}
// Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()

129
dll/steam_remoteplay.h Normal file
View file

@ -0,0 +1,129 @@
/* Copyright (C) 2019 Mr Goldberg
This file is part of the Goldberg Emulator
The Goldberg Emulator is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
The Goldberg Emulator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the Goldberg Emulator; if not, see
<http://www.gnu.org/licenses/>. */
#include "base.h"
class Steam_RemotePlay :
public ISteamRemotePlay
{
class Settings *settings;
class Networking *network;
class SteamCallResults *callback_results;
class SteamCallBacks *callbacks;
class RunEveryRunCB *run_every_runcb;
public:
static void steam_callback(void *object, Common_Message *msg)
{
PRINT_DEBUG("steam_remoteplay_callback\n");
Steam_RemotePlay *steam_remoteplay = (Steam_RemotePlay *)object;
steam_remoteplay->Callback(msg);
}
static void steam_run_every_runcb(void *object)
{
PRINT_DEBUG("steam_remoteplay_run_every_runcb\n");
Steam_RemotePlay *steam_remoteplay = (Steam_RemotePlay *)object;
steam_remoteplay->RunCallbacks();
}
Steam_RemotePlay(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb)
{
this->settings = settings;
this->network = network;
this->run_every_runcb = run_every_runcb;
//this->network->setCallback(CALLBACK_ID_USER_STATUS, settings->get_local_steam_id(), &Steam_RemotePlay::steam_callback, this);
this->run_every_runcb->add(&Steam_RemotePlay::steam_run_every_runcb, this);
this->callback_results = callback_results;
this->callbacks = callbacks;
}
~Steam_RemotePlay()
{
//TODO rm network callbacks
this->run_every_runcb->remove(&Steam_RemotePlay::steam_run_every_runcb, this);
}
// Get the number of currently connected Steam Remote Play sessions
uint32 GetSessionCount()
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionCount\n");
return 0;
}
// Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.
uint32 GetSessionID( int iSessionIndex )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionID\n");
return 0;
}
// Get the SteamID of the connected user
CSteamID GetSessionSteamID( uint32 unSessionID )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionSteamID\n");
return k_steamIDNil;
}
// Get the name of the session client device
// This returns NULL if the sessionID is not valid
const char *GetSessionClientName( uint32 unSessionID )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionClientName\n");
return NULL;
}
// Get the form factor of the session client device
ESteamDeviceFormFactor GetSessionClientFormFactor( uint32 unSessionID )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionClientFormFactor\n");
return k_ESteamDeviceFormFactorUnknown;
}
// Get the resolution, in pixels, of the session client device
// This is set to 0x0 if the resolution is not available
bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY )
{
PRINT_DEBUG("Steam_RemotePlay::BGetSessionClientResolution\n");
return false;
}
void RunCallbacks()
{
}
void Callback(Common_Message *msg)
{
if (msg->has_low_level()) {
if (msg->low_level().type() == Low_Level::CONNECT) {
}
if (msg->low_level().type() == Low_Level::DISCONNECT) {
}
}
if (msg->has_networking_sockets()) {
}
}
};

View file

@ -36,6 +36,7 @@ public ISteamUGC007,
public ISteamUGC008,
public ISteamUGC009,
public ISteamUGC010,
public ISteamUGC012,
public ISteamUGC
{
class Settings *settings;
@ -245,6 +246,11 @@ bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyVa
return false;
}
bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize )
{
PRINT_DEBUG("Steam_UGC::GetQueryUGCKeyValueTag2\n");
return false;
}
// Release the request to free up memory, after retrieving results
@ -487,6 +493,13 @@ bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload )
return false;
}
bool RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle )
{
PRINT_DEBUG("Steam_UGC::RemoveAllItemKeyValueTags\n");
return false;
}
// remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function)
bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey )
{
PRINT_DEBUG("Steam_UGC::RemoveItemKeyValueTags\n");

View file

@ -448,4 +448,13 @@ SteamAPICall_t GetMarketEligibility()
PRINT_DEBUG("GetMarketEligibility\n");
return 0;
}
// Retrieves anti indulgence / duration control for current user
STEAM_CALL_RESULT( DurationControl_t )
SteamAPICall_t GetDurationControl()
{
PRINT_DEBUG("GetDurationControl\n");
return 0;
}
};

View file

@ -345,4 +345,32 @@ void SetVRHeadsetStreamingEnabled( bool bEnabled )
{
PRINT_DEBUG("SetVRHeadsetStreamingEnabled\n");
}
// Returns whether this steam client is a Steam China specific client, vs the global client.
bool IsSteamChinaLauncher()
{
PRINT_DEBUG("IsSteamChinaLauncher\n");
return false;
}
// Initializes text filtering.
// Returns false if filtering is unavailable for the language the user is currently running in.
bool InitFilterText()
{
PRINT_DEBUG("InitFilterText\n");
return false;
}
// Filters the provided input message and places the filtered result into pchOutFilteredText.
// pchOutFilteredText is where the output will be placed, even if no filtering or censoring is performed
// nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText
// pchInputText is the input string that should be filtered, which can be ASCII or UTF-8
// bLegalOnly should be false if you want profanity and legally required filtering (where required) and true if you want legally required filtering only
// Returns the number of characters (not bytes) filtered.
int FilterText( char* pchOutFilteredText, uint32 nByteSizeOutFilteredText, const char * pchInputMessage, bool bLegalOnly )
{
PRINT_DEBUG("FilterText\n");
return 0;
}
};

View file

@ -156,8 +156,11 @@ public:
// Steam Parties interface
virtual ISteamParties *GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Steam Remote Play interface
virtual ISteamRemotePlay *GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
};
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient018"
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient019"
#ifndef STEAM_API_EXPORTS

View file

@ -0,0 +1,142 @@
#ifndef ISTEAMCLIENT018_H
#define ISTEAMCLIENT018_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamClient018
{
public:
// Creates a communication pipe to the Steam client.
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
virtual HSteamPipe CreateSteamPipe() = 0;
// Releases a previously created communications pipe
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
// connects to an existing global user, failing if none exists
// used by the game to coordinate with the steamUI
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
// used by game servers, create a steam user that won't be shared with anyone else
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0;
// removes an allocated user
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
// retrieves the ISteamUser interface associated with the handle
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// retrieves the ISteamGameServer interface associated with the handle
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// set the local IP and Port to bind to
// this must be set before CreateLocalUser()
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
// returns the ISteamFriends interface
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns the ISteamUtils interface
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns the ISteamMatchmaking interface
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns the ISteamMatchmakingServers interface
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns the a generic interface
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns the ISteamUserStats interface
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns the ISteamGameServerStats interface
virtual ISteamGameServerStats *GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns apps interface
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// networking
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// remote storage
virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// user screenshots
virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// game search
virtual ISteamGameSearch *GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
STEAM_PRIVATE_API( virtual void RunFrame() = 0; )
// returns the number of IPC calls made since the last time this function was called
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
// control how often you do them.
virtual uint32 GetIPCCallCount() = 0;
// API warning handling
// 'int' is the severity; 0 for msg, 1 for warning
// 'const char *' is the text of the message
// callbacks will occur directly after the API function is called that generated the warning or message.
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
// Trigger global shutdown for the DLL
virtual bool BShutdownIfAllPipesClosed() = 0;
// Expose HTTP interface
virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption.
STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; )
// Exposes the ISteamController interface - deprecated in favor of Steam Input
virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Exposes the ISteamUGC interface
virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// returns app list interface, only available on specially registered apps
virtual ISteamAppList *GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Music Player
virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Music Player Remote
virtual ISteamMusicRemote *GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;
// html page display
virtual ISteamHTMLSurface *GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;
// Helper functions for internal Steam usage
STEAM_PRIVATE_API( virtual void DEPRECATED_Set_SteamAPI_CPostAPIResultInProcess( void (*)() ) = 0; )
STEAM_PRIVATE_API( virtual void DEPRECATED_Remove_SteamAPI_CPostAPIResultInProcess( void (*)() ) = 0; )
STEAM_PRIVATE_API( virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func ) = 0; )
// inventory
virtual ISteamInventory *GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Video
virtual ISteamVideo *GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Parental controls
virtual ISteamParentalSettings *GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Exposes the Steam Input interface for controller support
virtual ISteamInput *GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// Steam Parties interface
virtual ISteamParties *GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
};
#endif // ISTEAMCLIENT018_H

View file

@ -27,6 +27,8 @@
#define STEAM_CONTROLLER_MAX_ORIGINS 8
#define STEAM_CONTROLLER_MAX_ACTIVE_LAYERS 16
// When sending an option to a specific controller handle, you can send to all controllers via this command
#define STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS UINT64_MAX
@ -345,6 +347,12 @@ enum EControllerActionOrigin
k_EControllerActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button
k_EControllerActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button
// Added in SDK 1.45
k_EControllerActionOrigin_PS4_DPad_Move,
k_EControllerActionOrigin_XBoxOne_DPad_Move,
k_EControllerActionOrigin_XBox360_DPad_Move,
k_EControllerActionOrigin_Switch_DPad_Move,
k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here.
k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
};
@ -489,7 +497,7 @@ public:
// Enumerate currently connected controllers
// handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles
// Returns the number of handles written to handlesOut
virtual int GetConnectedControllers( ControllerHandle_t *handlesOut ) = 0;
virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_COUNT, Receives list of connected controllers ) ControllerHandle_t *handlesOut ) = 0;
//-----------------------------------------------------------------------------
// ACTION SETS
@ -508,7 +516,10 @@ public:
virtual void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0;
virtual void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0;
virtual void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle ) = 0;
virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t *handlesOut ) = 0;
// Enumerate currently active layers
// handlesOut should point to a STEAM_CONTROLLER_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles.
// Returns the number of handles written to handlesOut
virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ACTIVE_LAYERS, Receives list of active layers ) ControllerActionSetHandle_t *handlesOut ) = 0;
//-----------------------------------------------------------------------------
// ACTIONS
@ -523,7 +534,7 @@ public:
// Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
// originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
virtual int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin *originsOut ) = 0;
virtual int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ORIGINS, Receives list of aciton origins ) EControllerActionOrigin *originsOut ) = 0;
// Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls.
virtual ControllerAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0;
@ -534,7 +545,7 @@ public:
// Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
// originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
virtual int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin *originsOut ) = 0;
virtual int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ORIGINS, Receives list of action origins ) EControllerActionOrigin *originsOut ) = 0;
// Get a local path to art for on-screen glyph for a particular origin - this call is cheap
virtual const char *GetGlyphForActionOrigin( EControllerActionOrigin eOrigin ) = 0;
@ -582,10 +593,10 @@ public:
// Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index
virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0;
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap.
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin.
virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0;
// Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized.
// Get a local path to art for on-screen glyph for a particular Xbox controller origin.
virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0;
// Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for
@ -594,6 +605,9 @@ public:
// Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EControllerActionOrigin_None
virtual EControllerActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin ) = 0;
// Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device
virtual bool GetControllerBindingRevision( ControllerHandle_t controllerHandle, int *pMajor, int *pMinor ) = 0;
};
#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController007"

View file

@ -23,6 +23,8 @@
#define STEAM_INPUT_MAX_ORIGINS 8
#define STEAM_INPUT_MAX_ACTIVE_LAYERS 16
// When sending an option to a specific controller handle, you can send to all devices via this command
#define STEAM_INPUT_HANDLE_ALL_CONTROLLERS UINT64_MAX
@ -184,7 +186,7 @@ enum EInputActionOrigin
k_EInputActionOrigin_PS4_Gyro_Pitch,
k_EInputActionOrigin_PS4_Gyro_Yaw,
k_EInputActionOrigin_PS4_Gyro_Roll,
k_EInputActionOrigin_PS4_Reserved0,
k_EInputActionOrigin_PS4_DPad_Move,
k_EInputActionOrigin_PS4_Reserved1,
k_EInputActionOrigin_PS4_Reserved2,
k_EInputActionOrigin_PS4_Reserved3,
@ -225,7 +227,7 @@ enum EInputActionOrigin
k_EInputActionOrigin_XBoxOne_DPad_South,
k_EInputActionOrigin_XBoxOne_DPad_West,
k_EInputActionOrigin_XBoxOne_DPad_East,
k_EInputActionOrigin_XBoxOne_Reserved0,
k_EInputActionOrigin_XBoxOne_DPad_Move,
k_EInputActionOrigin_XBoxOne_Reserved1,
k_EInputActionOrigin_XBoxOne_Reserved2,
k_EInputActionOrigin_XBoxOne_Reserved3,
@ -266,7 +268,7 @@ enum EInputActionOrigin
k_EInputActionOrigin_XBox360_DPad_South,
k_EInputActionOrigin_XBox360_DPad_West,
k_EInputActionOrigin_XBox360_DPad_East,
k_EInputActionOrigin_XBox360_Reserved0,
k_EInputActionOrigin_XBox360_DPad_Move,
k_EInputActionOrigin_XBox360_Reserved1,
k_EInputActionOrigin_XBox360_Reserved2,
k_EInputActionOrigin_XBox360_Reserved3,
@ -314,7 +316,7 @@ enum EInputActionOrigin
k_EInputActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon
k_EInputActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon
k_EInputActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon
k_EInputActionOrigin_Switch_Reserved0,
k_EInputActionOrigin_Switch_DPad_Move,
k_EInputActionOrigin_Switch_Reserved1,
k_EInputActionOrigin_Switch_Reserved2,
k_EInputActionOrigin_Switch_Reserved3,
@ -498,7 +500,7 @@ public:
// the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam.
// handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles
// Returns the number of handles written to handlesOut
virtual int GetConnectedControllers( InputHandle_t *handlesOut ) = 0;
virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_COUNT, Receives list of connected controllers ) InputHandle_t *handlesOut ) = 0;
//-----------------------------------------------------------------------------
// ACTION SETS
@ -517,7 +519,10 @@ public:
virtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;
virtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;
virtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0;
virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, InputActionSetHandle_t *handlesOut ) = 0;
// Enumerate currently active layers.
// handlesOut should point to a STEAM_INPUT_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles
// Returns the number of handles written to handlesOut
virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ACTIVE_LAYERS, Receives list of active layers ) InputActionSetHandle_t *handlesOut ) = 0;
//-----------------------------------------------------------------------------
// ACTIONS
@ -532,7 +537,7 @@ public:
// Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin *originsOut ) = 0;
virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0;
// Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls.
virtual InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0;
@ -543,12 +548,12 @@ public:
// Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin *originsOut ) = 0;
virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0;
// Get a local path to art for on-screen glyph for a particular origin - this call is cheap
// Get a local path to art for on-screen glyph for a particular origin
virtual const char *GetGlyphForActionOrigin( EInputActionOrigin eOrigin ) = 0;
// Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized
// Returns a localized string (from Steam's language setting) for the specified origin.
virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0;
// Stop analog momentum for the action if it is a mouse action in trackball mode
@ -594,10 +599,10 @@ public:
// Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index
virtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0;
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap.
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin.
virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0;
// Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized.
// Get a local path to art for on-screen glyph for a particular Xbox controller origin
virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0;
// Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for
@ -605,9 +610,16 @@ public:
virtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0;
// Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None
// When a new input type is added you will be able to pass in k_ESteamInputType_Unknown amd the closest origin that your version of the SDK regonized will be returned
// When a new input type is added you will be able to pass in k_ESteamInputType_Unknown and the closest origin that your version of the SDK recognized will be returned
// ex: if a Playstation 5 controller was released this function would return Playstation 4 origins.
virtual EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ) = 0;
// Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device
virtual bool GetDeviceBindingRevision( InputHandle_t inputHandle, int *pMajor, int *pMinor ) = 0;
// Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it
// See isteamremoteplay.h for more information on Steam Remote Play sessions
virtual uint32 GetRemotePlaySessionID( InputHandle_t inputHandle ) = 0;
};
#define STEAMINPUT_INTERFACE_VERSION "SteamInput001"

View file

@ -23,6 +23,8 @@ enum ELobbyType
k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends
// useful if you want a user in two lobbies, for example matching groups together
// a user can be in only one regular lobby, and up to two invisible lobbies
k_ELobbyTypePrivateUnique = 4, // private, unique and does not delete when empty - only one of these may exist per unique keypair set
// can only create from webapi
};
// lobby search filter tools

View file

@ -21,6 +21,7 @@
#include "steamnetworkingtypes.h"
class ISteamNetworkingSocketsCallbacks;
struct SteamNetAuthenticationStatus_t;
//-----------------------------------------------------------------------------
/// Lower level networking interface that more closely mirrors the standard
@ -84,7 +85,7 @@ public:
/// be able to connect to one or the other, then nVirtualPort should be a small integer (<1000)
/// unique to each listen socket you create.
///
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
/// when your app initializes
virtual HSteamListenSocket CreateListenSocketP2P( int nVirtualPort ) = 0;
@ -97,7 +98,7 @@ public:
/// client is online and facilitate a relay connection. Note that all P2P connections on
/// Steam are currently relayed.
///
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort ) = 0;
#endif
@ -312,6 +313,57 @@ public:
/// even if they are not signed into Steam.)
virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0;
/// Indicate our desire to be ready participate in authenticated communications.
/// If we are currently not ready, then steps will be taken to obtain the necessary
/// certificates. (This includes a certificate for us, as well as any CA certificates
/// needed to authenticate peers.)
///
/// You can call this at program init time if you know that you are going to
/// be making authenticated connections, so that we will be ready immediately when
/// those connections are attempted. (Note that essentially all connections require
/// authentication, with the exception of ordinary UDP connections with authentication
/// disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don't call
/// this function, we will wait until a feature is utilized that that necessitates
/// these resources.
///
/// You can also call this function to force a retry, if failure has occurred.
/// Once we make an attempt and fail, we will not automatically retry.
/// In this respect, the behavior of the system after trying and failing is the same
/// as before the first attempt: attempting authenticated communication or calling
/// this function will call the system to attempt to acquire the necessary resources.
///
/// You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t
/// to monitor the status.
///
/// Returns the current value that would be returned from GetAuthenticationStatus.
virtual ESteamNetworkingAvailability InitAuthentication() = 0;
/// Query our readiness to participate in authenticated communications. A
/// SteamNetAuthenticationStatus_t callback is posted any time this status changes,
/// but you can use this function to query it at any time.
///
/// The value of SteamNetAuthenticationStatus_t::m_eAvail is returned. If you only
/// want this high level status, you can pass NULL for pDetails. If you want further
/// details, pass non-NULL to receive them.
virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0;
/// Certificate provision by the application. (On Steam, Steam will handle all this automatically)
#ifndef STEAMNETWORKINGSOCKETS_STEAM
/// Get blob that describes a certificate request. You can send this to your game coordinator.
/// Upon entry, *pcbBlob should contain the size of the buffer. On successful exit, it will
/// return the number of bytes that were populated. You can pass pBlob=NULL to query for the required
/// size. (256 bytes is a very conservative estimate.)
///
/// Pass this blob to your game coordinator and call SteamDatagram_CreateCert.
virtual bool GetCertificateRequest( int *pcbBlob, void *pBlob, SteamNetworkingErrMsg &errMsg ) = 0;
/// Set the certificate. The certificate blob should be the output of
/// SteamDatagram_CreateCert.
virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0;
#endif
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
@ -340,43 +392,54 @@ public:
/// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses
/// connection to Steam or the central backend, or the app is restarted or crashes, etc.
///
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort ) = 0;
//
// Servers hosted in Valve data centers
// Servers hosted in data centers known to the Valve relay network
//
/// Returns the value of the SDR_LISTEN_PORT environment variable. This
/// is the UDP server your server will be listening on. This will
/// configured automatically for you in production environments. (You
/// should set it yourself for testing.)
/// configured automatically for you in production environments.
///
/// In development, you'll need to set it yourself. See
/// https://partner.steamgames.com/doc/api/ISteamNetworkingSockets
/// for more information on how to configure dev environments.
virtual uint16 GetHostedDedicatedServerPort() = 0;
/// If you are running in a production data center, this will return the data
/// center code. Returns 0 otherwise.
/// Returns 0 if SDR_LISTEN_PORT is not set. Otherwise, returns the data center the server
/// is running in. This will be k_SteamDatagramPOPID_dev in non-production envirionment.
virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0;
/// Return info about the hosted server. You will need to send this information to your
/// backend, and put it in tickets, so that the relays will know how to forward traffic from
/// Return info about the hosted server. This contains the PoPID of the server,
/// and opaque routing information that can be used by the relays to send traffic
/// to your server.
///
/// You will need to send this information to your backend, and put it in tickets,
/// so that the relays will know how to forward traffic from
/// clients to your server. See SteamDatagramRelayAuthTicket for more info.
///
/// NOTE ABOUT DEVELOPMENT ENVIRONMENTS:
/// In production in our data centers, these parameters are configured via environment variables.
/// In development, the only one you need to set is SDR_LISTEN_PORT, which is the local port you
/// want to listen on. Furthermore, if you are running your server behind a corporate firewall,
/// you probably will not be able to put the routing information returned by this function into
/// tickets. Instead, it should be a public internet address that the relays can use to send
/// data to your server. So you might just end up hardcoding a public address and setup port
/// forwarding on your corporate firewall. In that case, the port you put into the ticket
/// needs to be the public-facing port opened on your firewall, if it is different from the
/// actual server port.
/// Also, note that the routing information is contained in SteamDatagramGameCoordinatorServerLogin,
/// so if possible, it's preferred to use GetGameCoordinatorServerLogin to send this info
/// to your game coordinator service, and also login securely at the same time.
///
/// This function will fail if SteamDatagramServer_Init has not been called.
/// On a successful exit, k_EResultOK is returned
///
/// Returns false if the SDR_LISTEN_PORT environment variable is not set.
virtual bool GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0;
/// Unsuccessful exit:
/// - Something other than k_EResultOK is returned.
/// - k_EResultInvalidState: We are not configured to listen for SDR (SDR_LISTEN_SOCKET
/// is not set.)
/// - k_EResultPending: we do not (yet) have the authentication information needed.
/// (See GetAuthenticationStatus.) If you use environment variables to pre-fetch
/// the network config, this data should always be available immediately.
/// - A non-localized diagnostic debug message will be placed in m_data that describes
/// the cause of the failure.
///
/// NOTE: The returned blob is not encrypted. Send it to your backend, but don't
/// directly share it with clients.
virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0;
/// Create a listen socket on the specified virtual port. The physical UDP port to use
/// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not
@ -385,6 +448,38 @@ public:
/// Note that this call MUST be made through the SteamGameServerNetworkingSockets() interface
virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) = 0;
/// Generate an authentication blob that can be used to securely login with
/// your backend, using SteamDatagram_ParseHostedServerLogin. (See
/// steamdatagram_gamecoordinator.h)
///
/// Before calling the function:
/// - Populate the app data in pLoginInfo (m_cbAppData and m_appData). You can leave
/// all other fields uninitialized.
/// - *pcbSignedBlob contains the size of the buffer at pBlob. (It should be
/// at least k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized.)
///
/// On a successful exit:
/// - k_EResultOK is returned
/// - All of the remaining fields of pLoginInfo will be filled out.
/// - *pcbSignedBlob contains the size of the serialized blob that has been
/// placed into pBlob.
///
/// Unsuccessful exit:
/// - Something other than k_EResultOK is returned.
/// - k_EResultNotLoggedOn: you are not logged in (yet)
/// - See GetHostedDedicatedServerAddress for more potential failure return values.
/// - A non-localized diagnostic debug message will be placed in pBlob that describes
/// the cause of the failure.
///
/// This works by signing the contents of the SteamDatagramGameCoordinatorServerLogin
/// with the cert that is issued to this server. In dev environments, it's OK if you do
/// not have a cert. (You will need to enable insecure dev login in SteamDatagram_ParseHostedServerLogin.)
/// Otherwise, you will need a signed cert.
///
/// NOTE: The routing blob returned here is not encrypted. Send it to your backend
/// and don't share it directly with clients.
virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
// Invoke all callbacks queued for this interface.
@ -397,7 +492,7 @@ public:
protected:
// ~ISteamNetworkingSockets(); // Silence some warnings
};
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets002"
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets003"
extern "C" {
@ -483,6 +578,25 @@ struct SteamNetConnectionStatusChangedCallback_t
/// Previous state. (Current state is in m_info.m_eState)
ESteamNetworkingConnectionState m_eOldState;
};
/// A struct used to describe our readiness to participate in authenticated,
/// encrypted communication. In order to do this we need:
///
/// - The list of trusted CA certificates that might be relevant for this
/// app.
/// - A valid certificate issued by a CA.
struct SteamNetAuthenticationStatus_t
{
enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 2 };
/// Status
ESteamNetworkingAvailability m_eAvail;
/// Non-localized English language status. For diagnostic/debugging
/// purposes only.
char m_debugMsg[ 256 ];
};
#pragma pack( pop )
}

View file

@ -671,7 +671,7 @@ public:
/// This function will fail if SteamDatagramServer_Init has not been called.
///
/// Returns false if the SDR_LISTEN_PORT environment variable is not set.
virtual bool GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0;
virtual bool GetHostedDedicatedServerAddress001( SteamDatagramHostedAddress *pRouting ) = 0;
/// Create a listen socket on the specified virtual port. The physical UDP port to use
/// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not

View file

@ -0,0 +1,381 @@
#ifndef ISTEAMNETWORKINGSOCKETS002
#define ISTEAMNETWORKINGSOCKETS002
//-----------------------------------------------------------------------------
/// Lower level networking interface that more closely mirrors the standard
/// Berkeley sockets model. Sockets are hard! You should probably only use
/// this interface under the existing circumstances:
///
/// - You have an existing socket-based codebase you want to port, or coexist with.
/// - You want to be able to connect based on IP address, rather than (just) Steam ID.
/// - You need low-level control of bandwidth utilization, when to drop packets, etc.
///
/// Note that neither of the terms "connection" and "socket" will correspond
/// one-to-one with an underlying UDP socket. An attempt has been made to
/// keep the semantics as similar to the standard socket model when appropriate,
/// but some deviations do exist.
class ISteamNetworkingSockets002
{
public:
/// Creates a "server" socket that listens for clients to connect to by
/// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6)
///
/// You must select a specific local port to listen on and set it
/// the port field of the local address.
///
/// Usually you wil set the IP portion of the address to zero, (SteamNetworkingIPAddr::Clear()).
/// This means that you will not bind to any particular local interface. In addition,
/// if possible the socket will be bound in "dual stack" mode, which means that it can
/// accept both IPv4 and IPv6 clients. If you wish to bind a particular interface, then
/// set the local address to the appropriate IPv4 or IPv6 IP.
///
/// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t
/// will be posted. The connection will be in the connecting state.
virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress ) = 0;
/// Creates a connection and begins talking to a "server" over UDP at the
/// given IPv4 or IPv6 address. The remote host must be listening with a
/// matching call to CreateListenSocketIP on the specified port.
///
/// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start
/// connecting, and then another one on either timeout or successful connection.
///
/// If the server does not have any identity configured, then their network address
/// will be the only identity in use. Or, the network host may provide a platform-specific
/// identity with or without a valid certificate to authenticate that identity. (These
/// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's
/// up to your application to decide whether to allow the connection.
///
/// By default, all connections will get basic encryption sufficient to prevent
/// casual eavesdropping. But note that without certificates (or a shared secret
/// distributed through some other out-of-band mechanism), you don't have any
/// way of knowing who is actually on the other end, and thus are vulnerable to
/// man-in-the-middle attacks.
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P
///
/// nVirtualPort specifies how clients can connect to this socket using
/// ConnectP2P. It's very common for applications to only have one listening socket;
/// in that case, use zero. If you need to open multiple listen sockets and have clients
/// be able to connect to one or the other, then nVirtualPort should be a small integer (<1000)
/// unique to each listen socket you create.
///
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// when your app initializes
virtual HSteamListenSocket CreateListenSocketP2P( int nVirtualPort ) = 0;
/// Begin connecting to a server that is identified using a platform-specific identifier.
/// This requires some sort of third party rendezvous service, and will depend on the
/// platform and what other libraries and services you are integrating with.
///
/// At the time of this writing, there is only one supported rendezvous service: Steam.
/// Set the SteamID (whether "user" or "gameserver") and Steam will determine if the
/// client is online and facilitate a relay connection. Note that all P2P connections on
/// Steam are currently relayed.
///
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort ) = 0;
#endif
/// Accept an incoming connection that has been received on a listen socket.
///
/// When a connection attempt is received (perhaps after a few basic handshake
/// packets have been exchanged to prevent trivial spoofing), a connection interface
/// object is created in the k_ESteamNetworkingConnectionState_Connecting state
/// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your
/// application MUST either accept or close the connection. (It may not ignore it.)
/// Accepting the connection will transition it either into the connected state,
/// or the finding route state, depending on the connection type.
///
/// You should take action within a second or two, because accepting the connection is
/// what actually sends the reply notifying the client that they are connected. If you
/// delay taking action, from the client's perspective it is the same as the network
/// being unresponsive, and the client may timeout the connection attempt. In other
/// words, the client cannot distinguish between a delay caused by network problems
/// and a delay caused by the application.
///
/// This means that if your application goes for more than a few seconds without
/// processing callbacks (for example, while loading a map), then there is a chance
/// that a client may attempt to connect in that interval and fail due to timeout.
///
/// If the application does not respond to the connection attempt in a timely manner,
/// and we stop receiving communication from the client, the connection attempt will
/// be timed out locally, transitioning the connection to the
/// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also
/// close the connection before it is accepted, and a transition to the
/// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact
/// sequence of events.
///
/// Returns k_EResultInvalidParam if the handle is invalid.
/// Returns k_EResultInvalidState if the connection is not in the appropriate state.
/// (Remember that the connection state could change in between the time that the
/// notification being posted to the queue and when it is received by the application.)
virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0;
/// Disconnects from the remote host and invalidates the connection handle.
/// Any unread data on the connection is discarded.
///
/// nReason is an application defined code that will be received on the other
/// end and recorded (when possible) in backend analytics. The value should
/// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need
/// to communicate any information to the remote host, and do not want analytics to
/// be able to distinguish "normal" connection terminations from "exceptional" ones,
/// You may pass zero, in which case the generic value of
/// k_ESteamNetConnectionEnd_App_Generic will be used.
///
/// pszDebug is an optional human-readable diagnostic string that will be received
/// by the remote host and recorded (when possible) in backend analytics.
///
/// If you wish to put the socket into a "linger" state, where an attempt is made to
/// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data
/// is not flushed.
///
/// If the connection has already ended and you are just freeing up the
/// connection interface, the reason code, debug string, and linger flag are
/// ignored.
virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0;
/// Destroy a listen socket. All the connections that were accepting on the listen
/// socket are closed ungracefully.
virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0;
/// Set connection user data. the data is returned in the following places
/// - You can query it using GetConnectionUserData.
/// - The SteamNetworkingmessage_t structure.
/// - The SteamNetConnectionInfo_t structure. (Which is a member of SteamNetConnectionStatusChangedCallback_t.)
///
/// Returns false if the handle is invalid.
virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0;
/// Fetch connection user data. Returns -1 if handle is invalid
/// or if you haven't set any userdata on the connection.
virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0;
/// Set a name for the connection, used mostly for debugging
virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0;
/// Fetch connection name. Returns false if handle is invalid
virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0;
/// Send a message to the remote host on the specified connection.
///
/// nSendFlags determines the delivery guarantees that will be provided,
/// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable
///
/// Note that the semantics we use for messages are not precisely
/// the same as the semantics of a standard "stream" socket.
/// (SOCK_STREAM) For an ordinary stream socket, the boundaries
/// between chunks are not considered relevant, and the sizes of
/// the chunks of data written will not necessarily match up to
/// the sizes of the chunks that are returned by the reads on
/// the other end. The remote host might read a partial chunk,
/// or chunks might be coalesced. For the message semantics
/// used here, however, the sizes WILL match. Each send call
/// will match a successful read call on the remote host
/// one-for-one. If you are porting existing stream-oriented
/// code to the semantics of reliable messages, your code should
/// work the same, since reliable message semantics are more
/// strict than stream semantics. The only caveat is related to
/// performance: there is per-message overhead to retain the
/// message sizes, and so if your code sends many small chunks
/// of data, performance will suffer. Any code based on stream
/// sockets that does not write excessively small chunks will
/// work without any changes.
///
/// Returns:
/// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big.
/// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend)
/// - k_EResultInvalidState: connection is in an invalid state
/// - k_EResultNoConnection: connection has ended
/// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because
/// we were not ready to send it.
/// - k_EResultLimitExceeded: there was already too much data queued to be sent.
/// (See k_ESteamNetworkingConfig_SendBufferSize)
virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags ) = 0;
/// Flush any messages waiting on the Nagle timer and send them
/// at the next transmission opportunity (often that means right now).
///
/// If Nagle is enabled (it's on by default) then when calling
/// SendMessageToConnection the message will be buffered, up to the Nagle time
/// before being sent, to merge small messages into the same packet.
/// (See k_ESteamNetworkingConfig_NagleTime)
///
/// Returns:
/// k_EResultInvalidParam: invalid connection handle
/// k_EResultInvalidState: connection is in an invalid state
/// k_EResultNoConnection: connection has ended
/// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect.
virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0;
/// Fetch the next available message(s) from the connection, if any.
/// Returns the number of messages returned into your array, up to nMaxMessages.
/// If the connection handle is invalid, -1 is returned.
///
/// The order of the messages returned in the array is relevant.
/// Reliable messages will be received in the order they were sent (and with the
/// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket).
///
/// Unreliable messages may be dropped, or delivered out of order withrespect to
/// each other or with respect to reliable messages. The same unreliable message
/// may be received multiple times.
///
/// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each
/// of them free up resources after you are done. It is safe to keep the object alive for
/// a little while (put it into some queue, etc), and you may call Release() from any thread.
virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
/// Same as ReceiveMessagesOnConnection, but will return the next message available
/// on any connection that was accepted through the specified listen socket. Examine
/// SteamNetworkingMessage_t::m_conn to know which client connection.
///
/// Delivery order of messages among different clients is not defined. They may
/// be returned in an order different from what they were actually received. (Delivery
/// order of messages from the same client is well defined, and thus the order of the
/// messages is relevant!)
virtual int ReceiveMessagesOnListenSocket( HSteamListenSocket hSocket, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
/// Returns basic information about the high-level state of the connection.
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
/// Returns a small set of information about the real-time state of the connection
/// Returns false if the connection handle is invalid, or the connection has ended.
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
/// Returns detailed connection stats in text format. Useful
/// for dumping to a log, etc.
///
/// Returns:
/// -1 failure (bad connection handle)
/// 0 OK, your buffer was filled in and '\0'-terminated
/// >0 Your buffer was either nullptr, or it was too small and the text got truncated.
/// Try again with a buffer of at least N bytes.
virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0;
/// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to.
///
/// An IPv6 address of ::0 means "any IPv4 or IPv6"
/// An IPv6 address of ::ffff:0000:0000 means "any IPv4"
virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0;
/// Create a pair of connections that are talking to each other, e.g. a loopback connection.
/// This is very useful for testing, or so that your client/server code can work the same
/// even when you are running a local "server".
///
/// The two connections will immediately be placed into the connected state, and no callbacks
/// will be posted immediately. After this, if you close either connection, the other connection
/// will receive a callback, exactly as if they were communicating over the network. You must
/// close *both* sides in order to fully clean up the resources!
///
/// By default, internal buffers are used, completely bypassing the network, the chopping up of
/// messages into packets, encryption, copying the payload, etc. This means that loopback
/// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will
/// cause the socket pair to send packets through the local network loopback device (127.0.0.1)
/// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended
/// to encrypt and decrypt.
///
/// If you wish to assign a specific identity to either connection, you may pass a particular
/// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic
/// "localhost" identity. If you use real network loopback, this might be translated to the
/// actual bound loopback port. Otherwise, the port will be zero.
virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0;
/// Get the identity assigned to this interface.
/// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned
/// to the gameserver. Returns false and sets the result to an invalid identity if we don't know
/// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID
/// even if they are not signed into Steam.)
virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Clients connecting to dedicated servers hosted in a data center,
// using central-authority-granted tickets.
//
/// Call this when you receive a ticket from your backend / matchmaking system. Puts the
/// ticket into a persistent cache, and optionally returns the parsed ticket.
///
/// See stamdatagram_ticketgen.h for more details.
virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0;
/// Search cache for a ticket to talk to the server on the specified virtual port.
/// If found, returns the number of seconds until the ticket expires, and optionally
/// the complete cracked ticket. Returns 0 if we don't have a ticket.
///
/// Typically this is useful just to confirm that you have a ticket, before you
/// call ConnectToHostedDedicatedServer to connect to the server.
virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0;
/// Client call to connect to a server hosted in a Valve data center, on the specified virtual
/// port. You must have placed a ticket for this server into the cache, or else this connect attempt will fail!
///
/// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument
/// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses
/// connection to Steam or the central backend, or the app is restarted or crashes, etc.
///
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort ) = 0;
//
// Servers hosted in Valve data centers
//
/// Returns the value of the SDR_LISTEN_PORT environment variable. This
/// is the UDP server your server will be listening on. This will
/// configured automatically for you in production environments. (You
/// should set it yourself for testing.)
virtual uint16 GetHostedDedicatedServerPort() = 0;
/// If you are running in a production data center, this will return the data
/// center code. Returns 0 otherwise.
virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0;
/// Return info about the hosted server. You will need to send this information to your
/// backend, and put it in tickets, so that the relays will know how to forward traffic from
/// clients to your server. See SteamDatagramRelayAuthTicket for more info.
///
/// NOTE ABOUT DEVELOPMENT ENVIRONMENTS:
/// In production in our data centers, these parameters are configured via environment variables.
/// In development, the only one you need to set is SDR_LISTEN_PORT, which is the local port you
/// want to listen on. Furthermore, if you are running your server behind a corporate firewall,
/// you probably will not be able to put the routing information returned by this function into
/// tickets. Instead, it should be a public internet address that the relays can use to send
/// data to your server. So you might just end up hardcoding a public address and setup port
/// forwarding on your corporate firewall. In that case, the port you put into the ticket
/// needs to be the public-facing port opened on your firewall, if it is different from the
/// actual server port.
///
/// This function will fail if SteamDatagramServer_Init has not been called.
///
/// Returns false if the SDR_LISTEN_PORT environment variable is not set.
virtual bool GetHostedDedicatedServerAddress001( SteamDatagramHostedAddress *pRouting ) = 0;
/// Create a listen socket on the specified virtual port. The physical UDP port to use
/// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not
/// configured, this call will fail.
///
/// Note that this call MUST be made through the SteamGameServerNetworkingSockets() interface
virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
// Invoke all callbacks queued for this interface.
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
// So if you have code that is also targeting Steam, you should call this at about the
// same time you would call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks.
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
virtual void RunCallbacks( ISteamNetworkingSocketsCallbacks *pCallbacks ) = 0;
#endif
protected:
// ~ISteamNetworkingSockets(); // Silence some warnings
};
#endif // ISTEAMNETWORKINGSOCKETS002

View file

@ -14,6 +14,7 @@
#include "steamnetworkingtypes.h"
struct SteamDatagramRelayAuthTicket;
struct SteamRelayNetworkStatus_t;
//-----------------------------------------------------------------------------
/// Misc networking utilities for checking the local networking environment
@ -24,7 +25,7 @@ public:
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Initialization
// Initialization and status check
//
/// If you know that you are going to be using the relay network, call
@ -33,16 +34,25 @@ public:
/// happen the first time you use a feature that requires access to the
/// relay network, and that use will be delayed.
///
/// Returns true if initialization has completed successfully.
/// (It will probably return false on the first call.)
///
/// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
/// callbacks to know when initialization has completed.
/// Typically initialization completes in a few seconds.
///
/// Note: dedicated servers hosted with Valve do *not* need to call
/// this, since they do not make routing decisions. However, if the
/// dedicated server will be using P2P functionality, it will act as
/// Note: dedicated servers hosted in known data centers do *not* need
/// to call this, since they do not make routing decisions. However, if
/// the dedicated server will be using P2P functionality, it will act as
/// a "client" and this should be called.
inline bool InitializeRelayNetworkAccess();
inline void InitRelayNetworkAccess();
/// Fetch current status of the relay network.
///
/// SteamRelayNetworkStatus_t is also a callback. It will be triggered on
/// both the user and gameserver interfaces any time the status changes, or
/// ping measurement starts or stops.
///
/// SteamRelayNetworkStatus_t::m_eAvail is returned. If you want
/// more details, you can pass a non-NULL value.
virtual ESteamNetworkingAvailability GetRelayNetworkStatus( SteamRelayNetworkStatus_t *pDetails ) = 0;
//
// "Ping location" functions
@ -59,14 +69,14 @@ public:
// This is extremely useful to select peers for matchmaking!
//
// The markers can also be converted to a string, so they can be transmitted.
// We have a separate library you can use on your backend to manipulate
// these objects. (See steamdatagram_ticketgen.h)
// We have a separate library you can use on your app's matchmaking/coordinating
// server to manipulate these objects. (See steamdatagram_gamecoordinator.h)
/// Return location info for the current host. Returns the approximate
/// age of the data, in seconds, or -1 if no data is available.
///
/// It takes a few seconds to initialize access to the relay network. If
/// you call this very soon after calling InitializeRelayNetworkAccess,
/// you call this very soon after calling InitRelayNetworkAccess,
/// the data may not be available yet.
///
/// This always return the most up-to-date information we have available
@ -117,10 +127,6 @@ public:
/// the string.
virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0;
//
// Initialization / ping measurement status
//
/// Check if the ping data of sufficient recency is available, and if
/// it's too old, start refreshing it.
///
@ -136,13 +142,11 @@ public:
/// Returns false if sufficiently recent data is not available. In this
/// case, ping measurement is initiated, if it is not already active.
/// (You cannot restart a measurement already in progress.)
///
/// You can use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
/// to know when ping measurement completes.
virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0;
/// Return true if we are taking ping measurements to update our ping
/// location or select optimal routing. Ping measurement typically takes
/// a few seconds, perhaps up to 10 seconds.
virtual bool IsPingMeasurementInProgress() = 0;
//
// List of Valve data centers, and ping times to them. This might
// be useful to you if you are use our hosting, or just need to measure
@ -261,7 +265,7 @@ public:
protected:
// ~ISteamNetworkingUtils(); // Silence some warnings
};
#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils001"
#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils002"
// Global accessor.
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
@ -283,12 +287,48 @@ inline ISteamNetworkingUtils *SteamNetworkingUtils() { return (ISteamNetworkingU
#endif
#endif
/// A struct used to describe our readiness to use the relay network.
/// To do this we first need to fetch the network configuration,
/// which describes what POPs are available.
struct SteamRelayNetworkStatus_t
{
enum { k_iCallback = k_iSteamNetworkingUtilsCallbacks + 1 };
/// Summary status. When this is "current", initialization has
/// completed. Anything else means you are not ready yet, or
/// there is a significant problem.
ESteamNetworkingAvailability m_eAvail;
/// Nonzero if latency measurement is in progress (or pending,
/// awaiting a prerequisite).
int m_bPingMeasurementInProgress;
/// Status obtaining the network config. This is a prerequisite
/// for relay network access.
///
/// Failure to obtain the network config almost always indicates
/// a problem with the local internet connection.
ESteamNetworkingAvailability m_eAvailNetworkConfig;
/// Current ability to communicate with ANY relay. Note that
/// the complete failure to communicate with any relays almost
/// always indicates a problem with the local Internet connection.
/// (However, just because you can reach a single relay doesn't
/// mean that the local connection is in perfect health.)
ESteamNetworkingAvailability m_eAvailAnyRelay;
/// Non-localized English language status. For diagnostic/debugging
/// purposes only.
char m_debugMsg[ 256 ];
};
///////////////////////////////////////////////////////////////////////////////
//
// Internal stuff
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
inline bool ISteamNetworkingUtils::InitializeRelayNetworkAccess() { return CheckPingDataUpToDate( 1e10f ); }
inline void ISteamNetworkingUtils::InitRelayNetworkAccess() { CheckPingDataUpToDate( 1e10f ); }
#endif
inline bool ISteamNetworkingUtils::SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Int32, &val ); }
@ -298,7 +338,7 @@ inline bool ISteamNetworkingUtils::SetConnectionConfigValueInt32( HSteamNetConne
inline bool ISteamNetworkingUtils::SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Float, &val ); }
inline bool ISteamNetworkingUtils::SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_String, val ); }
#if !defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) && defined( STEAMNETWORKINGSOCKETS_STEAM )
#if !defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) && defined( STEAMNETWORKINGSOCKETS_STEAMCLIENT )
inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); }
inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); }
inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); }

View file

@ -0,0 +1,252 @@
#ifndef ISTEAMNETWORKINGUTILS001
#define ISTEAMNETWORKINGUTILS001
//-----------------------------------------------------------------------------
/// Misc networking utilities for checking the local networking environment
/// and estimating pings.
class ISteamNetworkingUtils001
{
public:
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Initialization
//
/// If you know that you are going to be using the relay network, call
/// this to initialize the relay network or check if that initialization
/// has completed. If you do not call this, the initialization will
/// happen the first time you use a feature that requires access to the
/// relay network, and that use will be delayed.
///
/// Returns true if initialization has completed successfully.
/// (It will probably return false on the first call.)
///
/// Typically initialization completes in a few seconds.
///
/// Note: dedicated servers hosted with Valve do *not* need to call
/// this, since they do not make routing decisions. However, if the
/// dedicated server will be using P2P functionality, it will act as
/// a "client" and this should be called.
inline bool InitializeRelayNetworkAccess();
//
// "Ping location" functions
//
// We use the ping times to the valve relays deployed worldwide to
// generate a "marker" that describes the location of an Internet host.
// Given two such markers, we can estimate the network latency between
// two hosts, without sending any packets. The estimate is based on the
// optimal route that is found through the Valve network. If you are
// using the Valve network to carry the traffic, then this is precisely
// the ping you want. If you are not, then the ping time will probably
// still be a reasonable estimate.
//
// This is extremely useful to select peers for matchmaking!
//
// The markers can also be converted to a string, so they can be transmitted.
// We have a separate library you can use on your backend to manipulate
// these objects. (See steamdatagram_ticketgen.h)
/// Return location info for the current host. Returns the approximate
/// age of the data, in seconds, or -1 if no data is available.
///
/// It takes a few seconds to initialize access to the relay network. If
/// you call this very soon after calling InitializeRelayNetworkAccess,
/// the data may not be available yet.
///
/// This always return the most up-to-date information we have available
/// right now, even if we are in the middle of re-calculating ping times.
virtual float GetLocalPingLocation( SteamNetworkPingLocation_t &result ) = 0;
/// Estimate the round-trip latency between two arbitrary locations, in
/// milliseconds. This is a conservative estimate, based on routing through
/// the relay network. For most basic relayed connections, this ping time
/// will be pretty accurate, since it will be based on the route likely to
/// be actually used.
///
/// If a direct IP route is used (perhaps via NAT traversal), then the route
/// will be different, and the ping time might be better. Or it might actually
/// be a bit worse! Standard IP routing is frequently suboptimal!
///
/// But even in this case, the estimate obtained using this method is a
/// reasonable upper bound on the ping time. (Also it has the advantage
/// of returning immediately and not sending any packets.)
///
/// In a few cases we might not able to estimate the route. In this case
/// a negative value is returned. k_nSteamNetworkingPing_Failed means
/// the reason was because of some networking difficulty. (Failure to
/// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot
/// currently answer the question for some other reason.
///
/// Do you need to be able to do this from a backend/matchmaking server?
/// You are looking for the "ticketgen" library.
virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0;
/// Same as EstimatePingTime, but assumes that one location is the local host.
/// This is a bit faster, especially if you need to calculate a bunch of
/// these in a loop to find the fastest one.
///
/// In rare cases this might return a slightly different estimate than combining
/// GetLocalPingLocation with EstimatePingTimeBetweenTwoLocations. That's because
/// this function uses a slightly more complete set of information about what
/// route would be taken.
virtual int EstimatePingTimeFromLocalHost( const SteamNetworkPingLocation_t &remoteLocation ) = 0;
/// Convert a ping location into a text format suitable for sending over the wire.
/// The format is a compact and human readable. However, it is subject to change
/// so please do not parse it yourself. Your buffer must be at least
/// k_cchMaxSteamNetworkingPingLocationString bytes.
virtual void ConvertPingLocationToString( const SteamNetworkPingLocation_t &location, char *pszBuf, int cchBufSize ) = 0;
/// Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand
/// the string.
virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0;
//
// Initialization / ping measurement status
//
/// Check if the ping data of sufficient recency is available, and if
/// it's too old, start refreshing it.
///
/// Please only call this function when you *really* do need to force an
/// immediate refresh of the data. (For example, in response to a specific
/// user input to refresh this information.) Don't call it "just in case",
/// before every connection, etc. That will cause extra traffic to be sent
/// for no benefit. The library will automatically refresh the information
/// as needed.
///
/// Returns true if sufficiently recent data is already available.
///
/// Returns false if sufficiently recent data is not available. In this
/// case, ping measurement is initiated, if it is not already active.
/// (You cannot restart a measurement already in progress.)
virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0;
/// Return true if we are taking ping measurements to update our ping
/// location or select optimal routing. Ping measurement typically takes
/// a few seconds, perhaps up to 10 seconds.
virtual bool IsPingMeasurementInProgress() = 0;
//
// List of Valve data centers, and ping times to them. This might
// be useful to you if you are use our hosting, or just need to measure
// latency to a cloud data center where we are running relays.
//
/// Fetch ping time of best available relayed route from this host to
/// the specified data center.
virtual int GetPingToDataCenter( SteamNetworkingPOPID popID, SteamNetworkingPOPID *pViaRelayPoP ) = 0;
/// Get *direct* ping time to the relays at the data center.
virtual int GetDirectPingToPOP( SteamNetworkingPOPID popID ) = 0;
/// Get number of network points of presence in the config
virtual int GetPOPCount() = 0;
/// Get list of all POP IDs. Returns the number of entries that were filled into
/// your list.
virtual int GetPOPList( SteamNetworkingPOPID *list, int nListSz ) = 0;
#endif // #ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Misc
//
/// Fetch current timestamp. This timer has the following properties:
///
/// - Monotonicity is guaranteed.
/// - The initial value will be at least 24*3600*30*1e6, i.e. about
/// 30 days worth of microseconds. In this way, the timestamp value of
/// 0 will always be at least "30 days ago". Also, negative numbers
/// will never be returned.
/// - Wraparound / overflow is not a practical concern.
///
/// If you are running under the debugger and stop the process, the clock
/// might not advance the full wall clock time that has elapsed between
/// calls. If the process is not blocked from normal operation, the
/// timestamp values will track wall clock time, even if you don't call
/// the function frequently.
///
/// The value is only meaningful for this run of the process. Don't compare
/// it to values obtained on another computer, or other runs of the same process.
virtual SteamNetworkingMicroseconds GetLocalTimestamp() = 0;
/// Set a function to receive network-related information that is useful for debugging.
/// This can be very useful during development, but it can also be useful for troubleshooting
/// problems with tech savvy end users. If you have a console or other log that customers
/// can examine, these log messages can often be helpful to troubleshoot network issues.
/// (Especially any warning/error messages.)
///
/// The detail level indicates what message to invoke your callback on. Lower numeric
/// value means more important, and the value you pass is the lowest priority (highest
/// numeric value) you wish to receive callbacks for.
///
/// Except when debugging, you should only use k_ESteamNetworkingSocketsDebugOutputType_Msg
/// or k_ESteamNetworkingSocketsDebugOutputType_Warning. For best performance, do NOT
/// request a high detail level and then filter out messages in your callback. Instead,
/// call function function to adjust the desired level of detail.
///
/// IMPORTANT: This may be called from a service thread, while we own a mutex, etc.
/// Your output function must be threadsafe and fast! Do not make any other
/// Steamworks calls from within the handler.
virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0;
//
// Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions.
//
// Shortcuts for common cases. (Implemented as inline functions below)
bool SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val );
bool SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val );
bool SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val );
bool SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val );
bool SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val );
bool SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val );
/// Set a configuration value.
/// - eValue: which value is being set
/// - eScope: Onto what type of object are you applying the setting?
/// - scopeArg: Which object you want to change? (Ignored for global scope). E.g. connection handle, listen socket handle, interface pointer, etc.
/// - eDataType: What type of data is in the buffer at pValue? This must match the type of the variable exactly!
/// - pArg: Value to set it to. You can pass NULL to remove a non-global sett at this scope,
/// causing the value for that object to use global defaults. Or at global scope, passing NULL
/// will reset any custom value and restore it to the system default.
/// NOTE: When setting callback functions, do not pass the function pointer directly.
/// Your argument should be a pointer to a function pointer.
virtual bool SetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0;
/// Get a configuration value.
/// - eValue: which value to fetch
/// - eScopeType: query setting on what type of object
/// - eScopeArg: the object to query the setting for
/// - pOutDataType: If non-NULL, the data type of the value is returned.
/// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.)
/// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required.
virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0;
/// Returns info about a configuration value. Returns false if the value does not exist.
/// pOutNextValue can be used to iterate through all of the known configuration values.
/// (Use GetFirstConfigValue() to begin the iteration, will be k_ESteamNetworkingConfig_Invalid on the last value)
/// Any of the output parameters can be NULL if you do not need that information.
virtual bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue ) = 0;
/// Return the lowest numbered configuration value available in the current environment.
virtual ESteamNetworkingConfigValue GetFirstConfigValue() = 0;
// String conversions. You'll usually access these using the respective
// inline methods.
virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0;
virtual bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0;
virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0;
virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0;
protected:
// ~ISteamNetworkingUtils(); // Silence some warnings
};
#endif // ISTEAMNETWORKINGUTILS001

View file

@ -0,0 +1,81 @@
//============ Copyright (c) Valve Corporation, All rights reserved. ============
#ifndef ISTEAMREMOTEPLAY_H
#define ISTEAMREMOTEPLAY_H
#ifdef _WIN32
#pragma once
#endif
#include "steam_api_common.h"
//-----------------------------------------------------------------------------
// Purpose: The form factor of a device
//-----------------------------------------------------------------------------
enum ESteamDeviceFormFactor
{
k_ESteamDeviceFormFactorUnknown,
k_ESteamDeviceFormFactorPhone,
k_ESteamDeviceFormFactorTablet,
k_ESteamDeviceFormFactorComputer,
k_ESteamDeviceFormFactorTV,
};
//-----------------------------------------------------------------------------
// Purpose: Functions to provide information about Steam Remote Play sessions
//-----------------------------------------------------------------------------
class ISteamRemotePlay
{
public:
// Get the number of currently connected Steam Remote Play sessions
virtual uint32 GetSessionCount() = 0;
// Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.
virtual uint32 GetSessionID( int iSessionIndex ) = 0;
// Get the SteamID of the connected user
virtual CSteamID GetSessionSteamID( uint32 unSessionID ) = 0;
// Get the name of the session client device
// This returns NULL if the sessionID is not valid
virtual const char *GetSessionClientName( uint32 unSessionID ) = 0;
// Get the form factor of the session client device
virtual ESteamDeviceFormFactor GetSessionClientFormFactor( uint32 unSessionID ) = 0;
// Get the resolution, in pixels, of the session client device
// This is set to 0x0 if the resolution is not available
virtual bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0;
};
#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION001"
// Global interface accessor
inline ISteamRemotePlay *SteamRemotePlay();
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemotePlay *, SteamRemotePlay, STEAMREMOTEPLAY_INTERFACE_VERSION );
// callbacks
#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
#elif defined( VALVE_CALLBACK_PACK_LARGE )
#pragma pack( push, 8 )
#else
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionConnected_t, k_iSteamRemotePlayCallbacks + 1 )
STEAM_CALLBACK_MEMBER( 0, uint32, m_unSessionID )
STEAM_CALLBACK_END( 0 )
STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCallbacks + 2 )
STEAM_CALLBACK_MEMBER( 0, uint32, m_unSessionID )
STEAM_CALLBACK_END( 0 )
#pragma pack( pop )
#endif // #define ISTEAMREMOTEPLAY_H

View file

@ -67,6 +67,7 @@ enum ERemoteStoragePlatform
k_ERemoteStoragePlatformLinux = (1 << 3),
k_ERemoteStoragePlatformReserved2 = (1 << 4),
k_ERemoteStoragePlatformAndroid = (1 << 5),
k_ERemoteStoragePlatformIOS = (1 << 6),
k_ERemoteStoragePlatformAll = 0xffffffff
};

View file

@ -226,6 +226,8 @@ public:
virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0;
virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0;
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
// Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found.
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
// Release the request to free up memory, after retrieving results
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
@ -271,6 +273,7 @@ public:
virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder
virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size
virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size.
virtual bool RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle ) = 0; // remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function)
virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag.
virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
@ -350,7 +353,7 @@ public:
virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0;
};
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION012"
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION013"
#ifndef STEAM_API_EXPORTS
// Global interface accessor

162
sdk_includes/isteamugc012.h Normal file
View file

@ -0,0 +1,162 @@
#ifndef ISTEAMUGC012_H
#define ISTEAMUGC012_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamUGC012
{
public:
// Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
// Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
// Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set.
virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0;
// Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this)
virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
// Send the query to Steam
STEAM_CALL_RESULT( SteamUGCQueryCompleted_t )
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
// Retrieve an individual result after receiving the callback for querying UGC
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0;
virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0;
virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0;
virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0;
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
// Release the request to free up memory, after retrieving results
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
// Options to set for querying UGC
virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
virtual bool SetReturnOnlyIDs( UGCQueryHandle_t handle, bool bReturnOnlyIDs ) = 0;
virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0;
virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0;
virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0;
virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0;
virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0;
virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0;
virtual bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint32 unDays ) = 0;
virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0;
virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0;
// Options only for querying user UGC
virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0;
// Options only for querying all UGC
virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0;
virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0;
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
// Steam Workshop Creator API
STEAM_CALL_RESULT( CreateItemResult_t )
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate()
virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item
virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item
virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)
virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item
virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item
virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder
virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size
virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size.
virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag.
virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
virtual bool AddItemPreviewVideo( UGCUpdateHandle_t handle, const char *pszVideoID ) = 0; // add preview video for this item
virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item
virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
STEAM_CALL_RESULT( SubmitItemUpdateResult_t )
virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate()
virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0;
// Steam Workshop Consumer API
STEAM_CALL_RESULT( SetUserItemVoteResult_t )
virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0;
STEAM_CALL_RESULT( GetUserItemVoteResult_t )
virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0;
STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t )
virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t )
virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP
STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t )
virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits
virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items
virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs
// get EItemState flags about item on this client
virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0;
// get info about currently installed content on disc for items that have k_EItemStateInstalled set
// if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder)
virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, STEAM_OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0;
// get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once
virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0;
// download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed,
// then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time.
// If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.
virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0;
// game servers can set a specific workshop folder before issuing any UGC commands.
// This is helpful if you want to support multiple game servers running out of the same install folder
virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0;
// SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends
virtual void SuspendDownloads( bool bSuspend ) = 0;
// usage tracking
STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t )
virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t )
virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t )
virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0;
// parent-child relationship or dependency management
STEAM_CALL_RESULT( AddUGCDependencyResult_t )
virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
STEAM_CALL_RESULT( RemoveUGCDependencyResult_t )
virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
// add/remove app dependence/requirements (usually DLC)
STEAM_CALL_RESULT( AddAppDependencyResult_t )
virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
STEAM_CALL_RESULT( RemoveAppDependencyResult_t )
virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
// request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times
// until all app dependencies have been returned
STEAM_CALL_RESULT( GetAppDependenciesResult_t )
virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0;
// delete the item without prompting the user
STEAM_CALL_RESULT( DeleteItemResult_t )
virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0;
};
#endif // ISTEAMUGC012_H

View file

@ -206,6 +206,11 @@ public:
STEAM_CALL_RESULT( MarketEligibilityResponse_t )
virtual SteamAPICall_t GetMarketEligibility() = 0;
// Retrieves anti indulgence / duration control for current user
STEAM_CALL_RESULT( DurationControl_t )
virtual SteamAPICall_t GetDurationControl() = 0;
};
#define STEAMUSER_INTERFACE_VERSION "SteamUser020"
@ -385,6 +390,27 @@ struct MarketEligibilityResponse_t
};
//-----------------------------------------------------------------------------
// Purpose: sent for games with enabled anti indulgence / duration control, for
// enabled users. Lets the game know whether persistent rewards or XP should be
// granted at normal rate, half rate, or zero rate.
//
// This callback is fired asynchronously in response to timers triggering.
// It is also fired in response to calls to GetDurationControl().
//-----------------------------------------------------------------------------
struct DurationControl_t
{
enum { k_iCallback = k_iSteamUserCallbacks + 67 };
EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications)
AppId_t m_appid; // appid generating playtime
bool m_bApplicable; // is duration control applicable to user + game combination
int32 m_csecsLast5h; // playtime in trailing 5 hour window plus current session, in seconds
EDurationControlProgress m_progress; // recommended progress
EDurationControlNotification m_notification; // notification to show, if any (always k_EDurationControlNotification_None for API calls)
};
#pragma pack( pop )

View file

@ -169,6 +169,21 @@ public:
// The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game.
// (this is useful for games that have asymmetric multiplayer gameplay)
virtual void SetVRHeadsetStreamingEnabled( bool bEnabled ) = 0;
// Returns whether this steam client is a Steam China specific client, vs the global client.
virtual bool IsSteamChinaLauncher() = 0;
// Initializes text filtering.
// Returns false if filtering is unavailable for the language the user is currently running in.
virtual bool InitFilterText() = 0;
// Filters the provided input message and places the filtered result into pchOutFilteredText.
// pchOutFilteredText is where the output will be placed, even if no filtering or censoring is performed
// nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText
// pchInputText is the input string that should be filtered, which can be ASCII or UTF-8
// bLegalOnly should be false if you want profanity and legally required filtering (where required) and true if you want legally required filtering only
// Returns the number of characters (not bytes) filtered.
virtual int FilterText( char* pchOutFilteredText, uint32 nByteSizeOutFilteredText, const char * pchInputMessage, bool bLegalOnly ) = 0;
};
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils009"

View file

@ -33,6 +33,7 @@
#include "isteamclient015.h"
#include "isteamclient016.h"
#include "isteamclient017.h"
#include "isteamclient018.h"
#include "isteamuser.h"
#include "isteamuser009.h"
#include "isteamuser010.h"
@ -89,7 +90,9 @@
#include "isteamnetworkingsocketsserialized.h"
#include "isteamnetworkingsockets.h"
#include "isteamnetworkingutils.h"
#include "isteamnetworkingutils001.h"
#include "isteamnetworkingsockets001.h"
#include "isteamnetworkingsockets002.h"
#include "isteamremotestorage.h"
#include "isteamremotestorage001.h"
#include "isteamremotestorage002.h"
@ -125,6 +128,7 @@
#include "isteamugc008.h"
#include "isteamugc009.h"
#include "isteamugc010.h"
#include "isteamugc012.h"
#include "isteamapplist.h"
#include "isteamhtmlsurface.h"
#include "isteamhtmlsurface001.h"
@ -140,6 +144,7 @@
#include "isteammasterserverupdater.h"
#include "isteamunifiedmessages.h"
#include "isteaminput.h"
#include "isteamremoteplay.h"
//----------------------------------------------------------------------------------------------------------------------------------------------------------//

File diff suppressed because it is too large Load diff

View file

@ -93,6 +93,7 @@ int const_k_iSteamUserStatsCallbacks = 1100;
int const_k_iSteamNetworkingCallbacks = 1200;
int const_k_iSteamNetworkingSocketsCallbacks = 1220;
int const_k_iSteamNetworkingMessagesCallbacks = 1250;
int const_k_iSteamNetworkingUtilsCallbacks = 1280;
int const_k_iClientRemoteStorageCallbacks = 1300;
int const_k_iClientDepotBuilderCallbacks = 1400;
int const_k_iSteamGameServerItemsCallbacks = 1500;
@ -135,6 +136,9 @@ int const_k_iClientShaderCallbacks = 5100;
int const_k_iSteamGameSearchCallbacks = 5200;
int const_k_iSteamPartiesCallbacks = 5300;
int const_k_iClientPartiesCallbacks = 5400;
int const_k_iSteamSTARCallbacks = 5500;
int const_k_iClientSTARCallbacks = 5600;
int const_k_iSteamRemotePlayCallbacks = 5700;
int const_k_cchPersonaNameMax = 128;
int const_k_cwchPersonaNameMax = 32;
int const_k_cchMaxRichPresenceKeys = 30;
@ -145,6 +149,7 @@ int const_k_cchLeaderboardNameMax = 128;
int const_k_cLeaderboardDetailsMax = 64;
unsigned long const_k_SteamItemInstanceIDInvalid = 0xffffffff;
int const_k_SteamInventoryResultInvalid = -1;
int const_k_cchBroadcastGameDataMax = 8192;
@ -188,6 +193,7 @@ S_API class ISteamVideo * SteamAPI_ISteamClient_GetISteamVideo(intptr_t instance
S_API class ISteamParentalSettings * SteamAPI_ISteamClient_GetISteamParentalSettings(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion);
S_API class ISteamInput * SteamAPI_ISteamClient_GetISteamInput(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion);
S_API class ISteamParties * SteamAPI_ISteamClient_GetISteamParties(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion);
S_API class ISteamRemotePlay * SteamAPI_ISteamClient_GetISteamRemotePlay(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion);
S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser(intptr_t instancePtr);
S_API bool SteamAPI_ISteamUser_BLoggedOn(intptr_t instancePtr);
S_API uint64 SteamAPI_ISteamUser_GetSteamID(intptr_t instancePtr);
@ -218,6 +224,7 @@ S_API bool SteamAPI_ISteamUser_BIsTwoFactorEnabled(intptr_t instancePtr);
S_API bool SteamAPI_ISteamUser_BIsPhoneIdentifying(intptr_t instancePtr);
S_API bool SteamAPI_ISteamUser_BIsPhoneRequiringVerification(intptr_t instancePtr);
S_API SteamAPICall_t SteamAPI_ISteamUser_GetMarketEligibility(intptr_t instancePtr);
S_API SteamAPICall_t SteamAPI_ISteamUser_GetDurationControl(intptr_t instancePtr);
S_API const char * SteamAPI_ISteamFriends_GetPersonaName(intptr_t instancePtr);
S_API SteamAPICall_t SteamAPI_ISteamFriends_SetPersonaName(intptr_t instancePtr, const char * pchPersonaName);
S_API EPersonaState SteamAPI_ISteamFriends_GetPersonaState(intptr_t instancePtr);
@ -320,6 +327,9 @@ S_API bool SteamAPI_ISteamUtils_IsSteamInBigPictureMode(intptr_t instancePtr);
S_API void SteamAPI_ISteamUtils_StartVRDashboard(intptr_t instancePtr);
S_API bool SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(intptr_t instancePtr);
S_API void SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(intptr_t instancePtr, bool bEnabled);
S_API bool SteamAPI_ISteamUtils_IsSteamChinaLauncher(intptr_t instancePtr);
S_API bool SteamAPI_ISteamUtils_InitFilterText(intptr_t instancePtr);
S_API int SteamAPI_ISteamUtils_FilterText(intptr_t instancePtr, char * pchOutFilteredText, uint32 nByteSizeOutFilteredText, const char * pchInputMessage, bool bLegalOnly);
S_API int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(intptr_t instancePtr);
S_API bool SteamAPI_ISteamMatchmaking_GetFavoriteGame(intptr_t instancePtr, int iGame, AppId_t * pnAppID, uint32 * pnIP, uint16 * pnConnPort, uint16 * pnQueryPort, uint32 * punFlags, uint32 * pRTime32LastPlayedOnServer);
S_API int SteamAPI_ISteamMatchmaking_AddFavoriteGame(intptr_t instancePtr, AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer);
@ -668,6 +678,8 @@ S_API const char * SteamAPI_ISteamInput_GetStringForXboxOrigin(intptr_t instance
S_API const char * SteamAPI_ISteamInput_GetGlyphForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin);
S_API EInputActionOrigin SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(intptr_t instancePtr, InputHandle_t inputHandle, EXboxOrigin eOrigin);
S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin(intptr_t instancePtr, ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin);
S_API bool SteamAPI_ISteamInput_GetDeviceBindingRevision(intptr_t instancePtr, InputHandle_t inputHandle, int * pMajor, int * pMinor);
S_API uint32 SteamAPI_ISteamInput_GetRemotePlaySessionID(intptr_t instancePtr, InputHandle_t inputHandle);
S_API bool SteamAPI_ISteamController_Init(intptr_t instancePtr);
S_API bool SteamAPI_ISteamController_Shutdown(intptr_t instancePtr);
S_API void SteamAPI_ISteamController_RunFrame(intptr_t instancePtr);
@ -701,6 +713,7 @@ S_API const char * SteamAPI_ISteamController_GetStringForXboxOrigin(intptr_t ins
S_API const char * SteamAPI_ISteamController_GetGlyphForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin);
S_API EControllerActionOrigin SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(intptr_t instancePtr, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin);
S_API EControllerActionOrigin SteamAPI_ISteamController_TranslateActionOrigin(intptr_t instancePtr, ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin);
S_API bool SteamAPI_ISteamController_GetControllerBindingRevision(intptr_t instancePtr, ControllerHandle_t controllerHandle, int * pMajor, int * pMinor);
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(intptr_t instancePtr, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage);
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage);
S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor);
@ -715,6 +728,7 @@ S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(intptr_t instan
S_API bool SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, char * pchURLOrVideoID, uint32 cchURLSize, char * pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType * pPreviewType);
S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index);
S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, char * pchKey, uint32 cchKeySize, char * pchValue, uint32 cchValueSize);
S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag0(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, const char * pchKey, char * pchValue, uint32 cchValueSize);
S_API bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(intptr_t instancePtr, UGCQueryHandle_t handle);
S_API bool SteamAPI_ISteamUGC_AddRequiredTag(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pTagName);
S_API bool SteamAPI_ISteamUGC_AddExcludedTag(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pTagName);
@ -745,6 +759,7 @@ S_API bool SteamAPI_ISteamUGC_SetItemTags(intptr_t instancePtr, UGCUpdateHandle_
S_API bool SteamAPI_ISteamUGC_SetItemContent(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszContentFolder);
S_API bool SteamAPI_ISteamUGC_SetItemPreview(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile);
S_API bool SteamAPI_ISteamUGC_SetAllowLegacyUpload(intptr_t instancePtr, UGCUpdateHandle_t handle, bool bAllowLegacyUpload);
S_API bool SteamAPI_ISteamUGC_RemoveAllItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle);
S_API bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey);
S_API bool SteamAPI_ISteamUGC_AddItemKeyValueTag(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey, const char * pchValue);
S_API bool SteamAPI_ISteamUGC_AddItemPreviewFile(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile, EItemPreviewType type);
@ -860,12 +875,25 @@ S_API void SteamAPI_ISteamVideo_GetVideoURL(intptr_t instancePtr, AppId_t unVide
S_API bool SteamAPI_ISteamVideo_IsBroadcasting(intptr_t instancePtr, int * pnNumViewers);
S_API void SteamAPI_ISteamVideo_GetOPFSettings(intptr_t instancePtr, AppId_t unVideoAppID);
S_API bool SteamAPI_ISteamVideo_GetOPFStringForApp(intptr_t instancePtr, AppId_t unVideoAppID, char * pchBuffer, int32 * pnBufferSize);
S_API bool SteamAPI_ISteamTV_IsBroadcasting(intptr_t instancePtr, int * pnNumViewers);
S_API void SteamAPI_ISteamTV_AddBroadcastGameData(intptr_t instancePtr, const char * pchKey, const char * pchValue);
S_API void SteamAPI_ISteamTV_RemoveBroadcastGameData(intptr_t instancePtr, const char * pchKey);
S_API void SteamAPI_ISteamTV_AddTimelineMarker(intptr_t instancePtr, const char * pchTemplateName, bool bPersistent, uint8 nColorR, uint8 nColorG, uint8 nColorB);
S_API void SteamAPI_ISteamTV_RemoveTimelineMarker(intptr_t instancePtr);
S_API uint32 SteamAPI_ISteamTV_AddRegion(intptr_t instancePtr, const char * pchElementName, const char * pchTimelineDataSection, const struct SteamTVRegion_t * pSteamTVRegion, ESteamTVRegionBehavior eSteamTVRegionBehavior);
S_API void SteamAPI_ISteamTV_RemoveRegion(intptr_t instancePtr, uint32 unRegionHandle);
S_API bool SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled(intptr_t instancePtr);
S_API bool SteamAPI_ISteamParentalSettings_BIsParentalLockLocked(intptr_t instancePtr);
S_API bool SteamAPI_ISteamParentalSettings_BIsAppBlocked(intptr_t instancePtr, AppId_t nAppID);
S_API bool SteamAPI_ISteamParentalSettings_BIsAppInBlockList(intptr_t instancePtr, AppId_t nAppID);
S_API bool SteamAPI_ISteamParentalSettings_BIsFeatureBlocked(intptr_t instancePtr, EParentalFeature eFeature);
S_API bool SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(intptr_t instancePtr, EParentalFeature eFeature);
S_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount(intptr_t instancePtr);
S_API uint32 SteamAPI_ISteamRemotePlay_GetSessionID(intptr_t instancePtr, int iSessionIndex);
S_API uint64 SteamAPI_ISteamRemotePlay_GetSessionSteamID(intptr_t instancePtr, uint32 unSessionID);
S_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName(intptr_t instancePtr, uint32 unSessionID);
S_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor(intptr_t instancePtr, uint32 unSessionID);
S_API bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution(intptr_t instancePtr, uint32 unSessionID, int * pnResolutionX, int * pnResolutionY);
S_API bool SteamAPI_ISteamGameServer_InitGameServer(intptr_t instancePtr, uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char * pchVersionString);
S_API void SteamAPI_ISteamGameServer_SetProduct(intptr_t instancePtr, const char * pszProduct);
S_API void SteamAPI_ISteamGameServer_SetGameDescription(intptr_t instancePtr, const char * pszGameDescription);

View file

@ -196,6 +196,8 @@ class ISteamParentalSettings;
class ISteamGameSearch;
class ISteamInput;
class ISteamParties;
class ISteamTV;
class ISteamRemotePlay;
//-----------------------------------------------------------------------------
// Purpose: Base values for callback identifiers, each callback must
@ -215,6 +217,7 @@ enum { k_iSteamUserStatsCallbacks = 1100 };
enum { k_iSteamNetworkingCallbacks = 1200 };
enum { k_iSteamNetworkingSocketsCallbacks = 1220 };
enum { k_iSteamNetworkingMessagesCallbacks = 1250 };
enum { k_iSteamNetworkingUtilsCallbacks = 1280 };
enum { k_iClientRemoteStorageCallbacks = 1300 };
enum { k_iClientDepotBuilderCallbacks = 1400 };
enum { k_iSteamGameServerItemsCallbacks = 1500 };
@ -257,6 +260,9 @@ enum { k_iClientShaderCallbacks = 5100 };
enum { k_iSteamGameSearchCallbacks = 5200 };
enum { k_iSteamPartiesCallbacks = 5300 };
enum { k_iClientPartiesCallbacks = 5400 };
enum { k_iSteamSTARCallbacks = 5500 };
enum { k_iClientSTARCallbacks = 5600 };
enum { k_iSteamRemotePlayCallbacks = 5700 };
// Macro used to define a type-safe accessor that will always return the version
// of the interface of the *header file* you are compiling with! We also bounce
@ -325,6 +331,7 @@ public:
ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; }
ISteamInventory* SteamInventory() const { return m_pSteamInventory; }
ISteamVideo* SteamVideo() const { return m_pSteamVideo; }
ISteamTV* SteamTV() const { return m_pSteamTV; }
ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; }
ISteamInput* SteamInput() const { return m_pSteamInput; }
private:
@ -349,6 +356,7 @@ private:
ISteamHTMLSurface *m_pSteamHTMLSurface;
ISteamInventory *m_pSteamInventory;
ISteamVideo *m_pSteamVideo;
ISteamTV *m_pSteamTV;
ISteamParentalSettings *m_pSteamParentalSettings;
ISteamInput *m_pSteamInput;
};

File diff suppressed because it is too large Load diff

View file

@ -301,6 +301,7 @@ enum EAppType
k_EAppType_Music = 0x2000, // Music files
k_EAppType_Series = 0x4000, // Container app for video series
k_EAppType_Comic = 0x8000, // Comic Book
k_EAppType_Beta = 0x10000, // this is a beta version of a game
k_EAppType_Shortcut = 0x40000000, // just a shortcut, client side only
k_EAppType_DepotOnly = 0x80000000, // placeholder since depots and apps share the same namespace
@ -515,12 +516,14 @@ enum EVRHMDType
k_eEVRHMDType_HTC_VivePre = 2, // htc vive pre
k_eEVRHMDType_HTC_Vive = 3, // htc vive consumer release
k_eEVRHMDType_HTC_VivePro = 4, // htc vive pro release
k_eEVRHMDType_HTC_ViveCosmos = 5, // HTC Vive Cosmos
k_eEVRHMDType_HTC_Unknown = 20, // unknown htc hmd
k_eEVRHMDType_Oculus_DK1 = 21, // Oculus DK1
k_eEVRHMDType_Oculus_DK2 = 22, // Oculus DK2
k_eEVRHMDType_Oculus_Rift = 23, // Oculus rift
k_eEVRHMDType_Oculus_Rift = 23, // Oculus Rift
k_eEVRHMDType_Oculus_RiftS = 24, // Oculus Rift S
k_eEVRHMDType_Oculus_Unknown = 40, // // Oculus unknown HMD
@ -548,6 +551,9 @@ enum EVRHMDType
k_eEVRHMDType_Huawei_VR2 = 121, // Huawei VR2 3DOF headset
k_eEVRHMDType_Huawei_EndOfRange = 129, // end of Huawei HMD range
k_eEVRHmdType_Valve_Unknown = 130, // Valve Unknown HMD
k_eEVRHmdType_Valve_Index = 131, // Valve Index HMD
};
@ -556,7 +562,7 @@ enum EVRHMDType
//-----------------------------------------------------------------------------
static inline bool BIsOculusHMD( EVRHMDType eType )
{
return eType == k_eEVRHMDType_Oculus_DK1 || eType == k_eEVRHMDType_Oculus_DK2 || eType == k_eEVRHMDType_Oculus_Rift || eType == k_eEVRHMDType_Oculus_Unknown;
return eType == k_eEVRHMDType_Oculus_DK1 || eType == k_eEVRHMDType_Oculus_DK2 || eType == k_eEVRHMDType_Oculus_Rift || eType == k_eEVRHMDType_Oculus_RiftS || eType == k_eEVRHMDType_Oculus_Unknown;
}
@ -647,6 +653,31 @@ enum EMarketNotAllowedReasonFlags
};
//
// describes XP / progress restrictions to apply for games with duration control /
// anti-indulgence enabled for minor Steam China users.
//
enum EDurationControlProgress
{
k_EDurationControlProgress_Full, // Full progress
k_EDurationControlProgress_Half, // XP or persistent rewards should be halved
k_EDurationControlProgress_None, // XP or persistent rewards should be stopped
};
//
// describes which notification timer has expired, for steam china duration control feature
//
enum EDurationControlNotification
{
k_EDurationControlNotification_None, // just informing you about progress, no notification to show
k_EDurationControlNotification_1Hour, // "you've been playing for an hour"
k_EDurationControlNotification_3Hours, // "you've been playing for 3 hours; take a break"
k_EDurationControlNotification_HalfProgress, // "your XP / progress is half normal"
k_EDurationControlNotification_NoProgress, // "your XP / progress is zero"
};
#pragma pack( push, 1 )
#define CSTEAMID_DEFINED

View file

@ -36,7 +36,6 @@ const size_t k_cbSteamDatagramMaxSerializedTicket = 512;
/// to the intended destination, but otherwise clients really should not
/// need to know what's inside. (Indeed, we don't really want them to
/// know, as it could reveal information useful to an attacker.)
#ifndef IS_STEAMDATAGRAMROUTER
struct SteamDatagramHostedAddress
{
@ -73,7 +72,7 @@ struct SteamDatagramHostedAddress
/// Convert to/from std::string (or anything that acts like it).
/// Useful for interfacing with google protobuf. It's a template
/// mainly so that we don't have to include <string> in the header.
/// Note: by "string", we don't mean that it's text. Ut's a binary
/// Note: by "string", we don't mean that it's text. It's a binary
/// blob, and it might have zeros in it. (std::string can handle that.)
template <typename T> bool SetFromStdString( const T &str )
{
@ -90,9 +89,7 @@ struct SteamDatagramHostedAddress
{
str->assign( m_data, m_cbSize );
}
};
#endif
/// Ticket used to gain access to the relay network.
struct SteamDatagramRelayAuthTicket
@ -228,7 +225,7 @@ private:
if ( m_nExtraFields >= k_nMaxExtraFields )
{
assert( false );
return nullptr;
return NULL;
}
ExtraField *p = &m_vecExtraFields[ m_nExtraFields++ ];
p->m_eType = eType;
@ -244,4 +241,46 @@ private:
#pragma pack(pop)
/// Max size of user data blob
const size_t k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData = 2048;
/// Max size of serialized data blob
const size_t k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized = 4096;
/// Structure that describes a gameserver attempting to authenticate
/// with your central server allocator / matchmaking service ("game coordinator").
/// This is useful because the game coordinator needs to know:
///
/// - What data center is the gameserver running in?
/// - The routing blob of the gameserver
/// - Is the gameserver actually trusted?
///
/// Using this structure, you can securely communicate this information
/// to your server, and you can do this WITHOUT maintaining any
/// whitelists or tables of IP addresses.
///
/// See ISteamNetworkingSockets::GetGameCoordinatorServerLogin
struct SteamDatagramGameCoordinatorServerLogin
{
/// Server's identity
SteamNetworkingIdentity m_identity;
/// Routing info. Note that this includes the POPID
SteamDatagramHostedAddress m_routing;
/// AppID that the server thinks it is running
AppId_t m_nAppID;
/// Unix timestamp when this was generated
RTime32 m_rtime;
/// Size of application data
int m_cbAppData;
/// Application data. This is any additional information
/// that you need to identify the server not contained above.
/// (E.g. perhaps a public IP as seen by the coordinator service.)
char m_appData[ k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData ];
};
#endif // STEAMDATAGRAM_TICKETS_H

View file

@ -29,4 +29,6 @@ S_API bool SteamEncryptedAppTicket_BUserOwnsAppInTicket( uint8 *rgubTicketDecryp
S_API bool SteamEncryptedAppTicket_BUserIsVacBanned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
S_API const uint8 *SteamEncryptedAppTicket_GetUserVariableData( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pcubUserData );
S_API const uint8 *SteamEncryptedAppTicket_GetUserVariableData( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pcubUserData );
S_API bool SteamEncryptedAppTicket_BIsTicketSigned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, const uint8 *pubRSAKey, uint32 cubRSAKey );

View file

@ -19,8 +19,10 @@
#ifdef STEAMNETWORKINGSOCKETS_STATIC_LINK
#define STEAMNETWORKINGSOCKETS_INTERFACE extern
#endif
#define STEAMNETWORKINGSOCKETS_STEAMCLIENT
#define STEAMNETWORKINGSOCKETS_ENABLE_SDR
//#include <steam/steam_api_common.h>
#define STEAMNETWORKINGSOCKETS_ENABLE_P2P
#include "steam_api_common.h"
//
//----------------------------------------
@ -35,7 +37,10 @@
struct SteamDatagramRelayAuthTicket;
struct SteamDatagramHostedAddress;
struct SteamDatagramGameCoordinatorServerLogin;
struct SteamNetConnectionStatusChangedCallback_t;
struct SteamNetAuthenticationStatus_t;
struct SteamRelayNetworkStatus_t;
/// Handle used to identify a connection to a remote host.
typedef uint32 HSteamNetConnection;
@ -63,6 +68,33 @@ typedef uint32 SteamNetworkingPOPID;
/// microsecond *resolution*.
typedef int64 SteamNetworkingMicroseconds;
/// Describe the status of a particular network resource
enum ESteamNetworkingAvailability
{
// Negative values indicate a problem.
//
// In general, we will not automatically retry unless you take some action that
// depends on of requests this resource, such as querying the status, attempting
// to initiate a connection, receive a connection, etc. If you do not take any
// action at all, we do not automatically retry in the background.
k_ESteamNetworkingAvailability_CannotTry = -102, // A dependent resource is missing, so this service is unavailable. (E.g. we cannot talk to routers because Internet is down or we don't have the network config.)
k_ESteamNetworkingAvailability_Failed = -101, // We have tried for enough time that we would expect to have been successful by now. We have never been successful
k_ESteamNetworkingAvailability_Previously = -100, // We tried and were successful at one time, but now it looks like we have a problem
k_ESteamNetworkingAvailability_Retrying = -10, // We previously failed and are currently retrying
// Not a problem, but not ready either
k_ESteamNetworkingAvailability_NeverTried = 1, // We don't know because we haven't ever checked/tried
k_ESteamNetworkingAvailability_Waiting = 2, // We're waiting on a dependent resource to be acquired. (E.g. we cannot obtain a cert until we are logged into Steam. We cannot measure latency to relays until we have the network config.)
k_ESteamNetworkingAvailability_Attempting = 3, // We're actively trying now, but are not yet successful.
k_ESteamNetworkingAvailability_Current = 100, // Resource is online/available
k_ESteamNetworkingAvailability_Unknown = 0, // Internal dummy/sentinel, or value is not applicable in this context
k_ESteamNetworkingAvailability__Force32bit = 0x7fffffff,
};
//
// Describing network hosts
//
@ -70,15 +102,16 @@ typedef int64 SteamNetworkingMicroseconds;
/// Different methods of describing the identity of a network host
enum ESteamNetworkingIdentityType
{
// Dummy/unknown/invalid
// Dummy/empty/invalid.
// Plese note that if we parse a string that we don't recognize
// but that appears reasonable, we will NOT use this type. Instead
// we'll use k_ESteamNetworkingIdentityType_UnknownType.
k_ESteamNetworkingIdentityType_Invalid = 0,
//
// Basic platform-specific identifiers.
//
k_ESteamNetworkingIdentityType_SteamID = 16, // 64-bit CSteamID
k_ESteamNetworkingIdentityType_XboxPairwiseID = 17, // Publisher-specific user identity, as string
//k_ESteamNetworkingIdentityType_PlaystationSomething = 18,
//
// Special identifiers.
@ -103,6 +136,13 @@ enum ESteamNetworkingIdentityType
k_ESteamNetworkingIdentityType_GenericString = 2,
k_ESteamNetworkingIdentityType_GenericBytes = 3,
// This identity type is used when we parse a string that looks like is a
// valid identity, just of a kind that we don't recognize. In this case, we
// can often still communicate with the peer! Allowing such identities
// for types we do not recognize useful is very useful for forward
// compatibility.
k_ESteamNetworkingIdentityType_UnknownType = 4,
// Make sure this enum is stored in an int.
k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff,
};
@ -173,9 +213,6 @@ struct SteamNetworkingIdentity
void SetSteamID64( uint64 steamID ); // Takes SteamID as raw 64-bit number
uint64 GetSteamID64() const; // Returns 0 if identity is not SteamID
bool SetXboxPairwiseID( const char *pszString ); // Returns false if invalid length
const char *GetXboxPairwiseID() const; // Returns nullptr if not Xbox ID
void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port
const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address.
@ -206,7 +243,6 @@ struct SteamNetworkingIdentity
enum {
k_cchMaxString = 128, // Max length of the buffer needed to hold any identity, formatted in string format by ToString
k_cchMaxGenericString = 32, // Max length of the string for generic string identities. Including terminating '\0'
k_cchMaxXboxPairwiseID = 32, // Including terminating '\0'
k_cbMaxGenericBytes = 32,
};
@ -220,8 +256,8 @@ struct SteamNetworkingIdentity
union {
uint64 m_steamID64;
char m_szGenericString[ k_cchMaxGenericString ];
char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ];
uint8 m_genericBytes[ k_cbMaxGenericBytes ];
char m_szUnknownRawString[ k_cchMaxString ];
SteamNetworkingIPAddr m_ip;
uint32 m_reserved[ 32 ]; // Pad structure to leave easy room for future expansion
};
@ -926,6 +962,15 @@ enum ESteamNetworkingConfigValue
/// (You can examine the incoming connection and decide whether to accept it.)
k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23,
/// [connection int32] Do not send UDP packets with a payload of
/// larger than N bytes. If you set this, k_ESteamNetworkingConfig_MTU_DataSize
/// is automatically adjusted
k_ESteamNetworkingConfig_MTU_PacketSize = 32,
/// [connection int32] (read only) Maximum message size you can send that
/// will not fragment, based on k_ESteamNetworkingConfig_MTU_PacketSize
k_ESteamNetworkingConfig_MTU_DataSize = 33,
//
// Settings for SDR relayed connections
//
@ -1059,6 +1104,9 @@ inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id,
szCode[4] = 0;
}
/// The POPID "dev" is used in non-production environments for testing.
const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v';
///////////////////////////////////////////////////////////////////////////////
//
// Internal stuff
@ -1083,24 +1131,21 @@ inline void SteamNetworkingIdentity::SetSteamID( CSteamID steamID ) { SetSteamID
inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID( GetSteamID64() ); }
inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; }
inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; }
inline bool SteamNetworkingIdentity::SetXboxPairwiseID( const char *pszString ) { size_t l = strlen( pszString ); if ( l < 1 || l >= sizeof(m_szXboxPairwiseID) ) return false;
m_eType = k_ESteamNetworkingIdentityType_XboxPairwiseID; m_cbSize = int(l+1); memcpy( m_szXboxPairwiseID, pszString, m_cbSize ); return true; }
inline const char *SteamNetworkingIdentity::GetXboxPairwiseID() const { return m_eType == k_ESteamNetworkingIdentityType_XboxPairwiseID ? m_szXboxPairwiseID : nullptr; }
inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; }
inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : nullptr; }
inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : NULL; }
inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); }
inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); }
inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false;
m_eType = k_ESteamNetworkingIdentityType_GenericString; m_cbSize = int(l+1); memcpy( m_szGenericString, pszString, m_cbSize ); return true; }
inline const char *SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : nullptr; }
inline const char *SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : NULL; }
inline bool SteamNetworkingIdentity::SetGenericBytes( const void *data, size_t cbLen ) { if ( cbLen > sizeof(m_genericBytes) ) return false;
m_eType = k_ESteamNetworkingIdentityType_GenericBytes; m_cbSize = int(cbLen); memcpy( m_genericBytes, data, m_cbSize ); return true; }
inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return nullptr;
inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return NULL;
cbLen = m_cbSize; return m_genericBytes; }
inline bool SteamNetworkingIdentity::operator==(const SteamNetworkingIdentity &x ) const { return m_eType == x.m_eType && m_cbSize == x.m_cbSize && memcmp( m_genericBytes, x.m_genericBytes, m_cbSize ) == 0; }
inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)( this ); }
#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || !defined( STEAMNETWORKINGSOCKETS_STEAM )
#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || !defined( STEAMNETWORKINGSOCKETS_STEAMCLIENT )
STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort );
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr );
STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf );