From b936d55c5a60833edd329282767dea335c369dd5 Mon Sep 17 00:00:00 2001 From: Alonso Mondal <80124074+AlonsoMondal@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:43:07 -0600 Subject: [PATCH 1/2] Adding windows specific compiler directive for strncasecmp=_strnicmp def (#52) --- code/source/playfab/PlayFabCurlHttpPlugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/source/playfab/PlayFabCurlHttpPlugin.cpp b/code/source/playfab/PlayFabCurlHttpPlugin.cpp index 77706a99..10518c9c 100644 --- a/code/source/playfab/PlayFabCurlHttpPlugin.cpp +++ b/code/source/playfab/PlayFabCurlHttpPlugin.cpp @@ -12,7 +12,9 @@ char(*__countof_helper(_CountofType(&_Array)[_SizeOfArray]))[_SizeOfArray]; #define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0) #endif -#define strncasecmp(x,y,z) _strnicmp(x,y,z) +#ifdef _WIN32 + #define strncasecmp(x,y,z) _strnicmp(x,y,z) +#endif namespace PlayFab { From 3e63cdda3ffe055b69e4b2d353160fe5a7b3ff44 Mon Sep 17 00:00:00 2001 From: PlayFab SDK Team Date: Mon, 5 Aug 2024 22:15:46 +0000 Subject: [PATCH 2/2] https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#240802 --- build/GDK/XPlatCppGdk.vcxproj | 5 + build/GDK/XPlatCppGdk.vcxproj.filters | 15 + build/Linux/makefile | 2 + build/Windows/XPlatCppWindows.vcxproj | 5 + build/Windows/XPlatCppWindows.vcxproj.filters | 15 + build/Xbox/XPlatXbox.vcxproj | 5 + build/Xbox/XPlatXbox.vcxproj.filters | 15 + code/include/playfab/PlayFabAdminDataModels.h | 500 +++- .../playfab/PlayFabAuthenticationDataModels.h | 92 +- .../include/playfab/PlayFabClientDataModels.h | 26 +- .../playfab/PlayFabCloudScriptDataModels.h | 13 +- code/include/playfab/PlayFabError.h | 48 +- code/include/playfab/PlayFabLeaderboardsApi.h | 87 + .../playfab/PlayFabLeaderboardsDataModels.h | 2179 +++++++++++++++++ .../playfab/PlayFabLeaderboardsInstanceApi.h | 99 + .../playfab/PlayFabMultiplayerDataModels.h | 22 +- .../include/playfab/PlayFabServerDataModels.h | 500 +++- code/source/playfab/PlayFabCurlHttpPlugin.cpp | 4 +- .../source/playfab/PlayFabLeaderboardsApi.cpp | 1137 +++++++++ .../PlayFabLeaderboardsInstanceApi.cpp | 1190 +++++++++ code/source/playfab/PlayFabSettings.cpp | 6 +- com.playfab.xplatcppsdk.v141.autopkg | 4 +- com.playfab.xplatcppsdk.v141.nuspec | 4 +- com.playfab.xplatcppsdk.v142.autopkg | 4 +- com.playfab.xplatcppsdk.v142.nuspec | 4 +- com.playfab.xplatxboxsdk.v141.autopkg | 4 +- 26 files changed, 5942 insertions(+), 43 deletions(-) create mode 100644 code/include/playfab/PlayFabLeaderboardsApi.h create mode 100644 code/include/playfab/PlayFabLeaderboardsDataModels.h create mode 100644 code/include/playfab/PlayFabLeaderboardsInstanceApi.h create mode 100644 code/source/playfab/PlayFabLeaderboardsApi.cpp create mode 100644 code/source/playfab/PlayFabLeaderboardsInstanceApi.cpp diff --git a/build/GDK/XPlatCppGdk.vcxproj b/build/GDK/XPlatCppGdk.vcxproj index 2472bacb..9380ce6b 100644 --- a/build/GDK/XPlatCppGdk.vcxproj +++ b/build/GDK/XPlatCppGdk.vcxproj @@ -506,6 +506,9 @@ + + + @@ -565,6 +568,8 @@ + + diff --git a/build/GDK/XPlatCppGdk.vcxproj.filters b/build/GDK/XPlatCppGdk.vcxproj.filters index c7727eac..3e451a0e 100644 --- a/build/GDK/XPlatCppGdk.vcxproj.filters +++ b/build/GDK/XPlatCppGdk.vcxproj.filters @@ -140,6 +140,15 @@ Header Files\playfab + + Header Files\playfab + + + Header Files\playfab + + + Header Files\playfab + Header Files\playfab @@ -310,6 +319,12 @@ Source Files\playfab + + Source Files\playfab + + + Source Files\playfab + Source Files\playfab diff --git a/build/Linux/makefile b/build/Linux/makefile index c5d0c64e..e547e402 100644 --- a/build/Linux/makefile +++ b/build/Linux/makefile @@ -45,6 +45,8 @@ OBJS = stdafx.o \ PlayFabInsightsInstanceApi.o \ PlayFabGroupsApi.o \ PlayFabGroupsInstanceApi.o \ + PlayFabLeaderboardsApi.o \ + PlayFabLeaderboardsInstanceApi.o \ PlayFabLocalizationApi.o \ PlayFabLocalizationInstanceApi.o \ PlayFabMultiplayerApi.o \ diff --git a/build/Windows/XPlatCppWindows.vcxproj b/build/Windows/XPlatCppWindows.vcxproj index c579841e..d052d366 100644 --- a/build/Windows/XPlatCppWindows.vcxproj +++ b/build/Windows/XPlatCppWindows.vcxproj @@ -153,6 +153,9 @@ + + + @@ -212,6 +215,8 @@ + + diff --git a/build/Windows/XPlatCppWindows.vcxproj.filters b/build/Windows/XPlatCppWindows.vcxproj.filters index fc73fef9..e1dfb013 100644 --- a/build/Windows/XPlatCppWindows.vcxproj.filters +++ b/build/Windows/XPlatCppWindows.vcxproj.filters @@ -140,6 +140,15 @@ Header Files\playfab + + Header Files\playfab + + + Header Files\playfab + + + Header Files\playfab + Header Files\playfab @@ -311,6 +320,12 @@ Source Files\playfab + + Source Files\playfab + + + Source Files\playfab + Source Files\playfab diff --git a/build/Xbox/XPlatXbox.vcxproj b/build/Xbox/XPlatXbox.vcxproj index 27faa4d0..b6cc499c 100644 --- a/build/Xbox/XPlatXbox.vcxproj +++ b/build/Xbox/XPlatXbox.vcxproj @@ -206,6 +206,9 @@ + + + @@ -265,6 +268,8 @@ + + diff --git a/build/Xbox/XPlatXbox.vcxproj.filters b/build/Xbox/XPlatXbox.vcxproj.filters index 69436ce6..5dfeebbd 100644 --- a/build/Xbox/XPlatXbox.vcxproj.filters +++ b/build/Xbox/XPlatXbox.vcxproj.filters @@ -140,6 +140,15 @@ Header Files\playfab + + Header Files\playfab + + + Header Files\playfab + + + Header Files\playfab + Header Files\playfab @@ -313,6 +322,12 @@ Source Files\playfab + + Source Files\playfab + + + Source Files\playfab + Source Files\playfab diff --git a/code/include/playfab/PlayFabAdminDataModels.h b/code/include/playfab/PlayFabAdminDataModels.h index a24692ca..7c63c462 100644 --- a/code/include/playfab/PlayFabAdminDataModels.h +++ b/code/include/playfab/PlayFabAdminDataModels.h @@ -5470,6 +5470,20 @@ namespace PlayFab GenericErrorCodesStatisticDefinitionModificationNotAllowedWhileLinked, GenericErrorCodesLeaderboardUpdateNotAllowedWhileLinked, GenericErrorCodesCloudScriptAzureFunctionsEventHubRequestError, + GenericErrorCodesExternalEntityNotAllowedForTier, + GenericErrorCodesInvalidBaseTimeForInterval, + GenericErrorCodesEntityTypeMismatchWithStatDefinition, + GenericErrorCodesSpecifiedVersionLeaderboardNotFound, + GenericErrorCodesLeaderboardColumnLengthMismatchWithStatDefinition, + GenericErrorCodesDuplicateColumnNameFound, + GenericErrorCodesLinkedStatisticColumnNotFound, + GenericErrorCodesLinkedStatisticColumnRequired, + GenericErrorCodesMultipleLinkedStatisticsNotAllowed, + GenericErrorCodesDuplicateLinkedStatisticColumnNameFound, + GenericErrorCodesAggregationTypeNotAllowedForMultiColumnStatistic, + GenericErrorCodesMaxQueryableVerionsValueNotAllowedForTier, + GenericErrorCodesStatisticDefinitionHasNullOrEmptyVersionConfiguration, + GenericErrorCodesStatisticColumnLengthMismatch, GenericErrorCodesMatchmakingEntityInvalid, GenericErrorCodesMatchmakingPlayerAttributesInvalid, GenericErrorCodesMatchmakingQueueNotFound, @@ -5647,6 +5661,7 @@ namespace PlayFab GenericErrorCodesEventSinkTitleUnauthorized, GenericErrorCodesEventSinkInsufficientRoleAssignment, GenericErrorCodesEventSinkContainerNotFound, + GenericErrorCodesEventSinkTenantIdInvalid, GenericErrorCodesOperationCanceled, GenericErrorCodesInvalidDisplayNameRandomSuffixLength, GenericErrorCodesAllowNonUniquePlayerDisplayNamesDisableNotAllowed, @@ -5716,9 +5731,36 @@ namespace PlayFab GenericErrorCodesTrueSkillJobAlreadyExists, GenericErrorCodesTrueSkillJobNotFound, GenericErrorCodesTrueSkillOperationCanceled, - GenericErrorCodesStateShareUnauthorized, + GenericErrorCodesTrueSkillActiveModelLimitExceeded, + GenericErrorCodesTrueSkillTotalModelLimitExceeded, + GenericErrorCodesTrueSkillUnknownInitialModelId, + GenericErrorCodesTrueSkillUnauthorizedForJob, + GenericErrorCodesTrueSkillInvalidScenarioName, + GenericErrorCodesTrueSkillConditionStateIsRequired, + GenericErrorCodesTrueSkillEventStateIsRequired, + GenericErrorCodesTrueSkillDuplicateEvent, + GenericErrorCodesTrueSkillDuplicateCondition, + GenericErrorCodesTrueSkillInvalidAnomalyThreshold, + GenericErrorCodesTrueSkillConditionKeyLimitExceeded, + GenericErrorCodesTrueSkillConditionValuePerKeyLimitExceeded, + GenericErrorCodesTrueSkillInvalidTimestamp, + GenericErrorCodesTrueSkillEventLimitExceeded, + GenericErrorCodesTrueSkillInvalidPlayers, + GenericErrorCodesTrueSkillTrueSkillPlayerNull, + GenericErrorCodesTrueSkillInvalidPlayerId, + GenericErrorCodesTrueSkillInvalidSquadSize, + GenericErrorCodesTrueSkillConditionSetNotInModel, + GenericErrorCodesGameSaveManifestNotFound, + GenericErrorCodesGameSaveManifestVersionAlreadyExists, + GenericErrorCodesGameSaveConflictUpdatingManifest, + GenericErrorCodesStateShareForbidden, + GenericErrorCodesStateShareTitleNotInFlight, GenericErrorCodesStateShareStateNotFound, - GenericErrorCodesStateShareLinkNotFound + GenericErrorCodesStateShareLinkNotFound, + GenericErrorCodesStateShareStateRedemptionLimitExceeded, + GenericErrorCodesStateShareStateRedemptionLimitNotUpdated, + GenericErrorCodesStateShareCreatedStatesLimitExceeded, + GenericErrorCodesStateShareIdMissingOrMalformed }; inline void ToJsonEnum(const GenericErrorCodes input, Json::Value& output) @@ -8558,6 +8600,76 @@ namespace PlayFab output = Json::Value("CloudScriptAzureFunctionsEventHubRequestError"); return; } + if (input == GenericErrorCodes::GenericErrorCodesExternalEntityNotAllowedForTier) + { + output = Json::Value("ExternalEntityNotAllowedForTier"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesInvalidBaseTimeForInterval) + { + output = Json::Value("InvalidBaseTimeForInterval"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesEntityTypeMismatchWithStatDefinition) + { + output = Json::Value("EntityTypeMismatchWithStatDefinition"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesSpecifiedVersionLeaderboardNotFound) + { + output = Json::Value("SpecifiedVersionLeaderboardNotFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesLeaderboardColumnLengthMismatchWithStatDefinition) + { + output = Json::Value("LeaderboardColumnLengthMismatchWithStatDefinition"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesDuplicateColumnNameFound) + { + output = Json::Value("DuplicateColumnNameFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnNotFound) + { + output = Json::Value("LinkedStatisticColumnNotFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnRequired) + { + output = Json::Value("LinkedStatisticColumnRequired"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesMultipleLinkedStatisticsNotAllowed) + { + output = Json::Value("MultipleLinkedStatisticsNotAllowed"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesDuplicateLinkedStatisticColumnNameFound) + { + output = Json::Value("DuplicateLinkedStatisticColumnNameFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesAggregationTypeNotAllowedForMultiColumnStatistic) + { + output = Json::Value("AggregationTypeNotAllowedForMultiColumnStatistic"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesMaxQueryableVerionsValueNotAllowedForTier) + { + output = Json::Value("MaxQueryableVerionsValueNotAllowedForTier"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStatisticDefinitionHasNullOrEmptyVersionConfiguration) + { + output = Json::Value("StatisticDefinitionHasNullOrEmptyVersionConfiguration"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStatisticColumnLengthMismatch) + { + output = Json::Value("StatisticColumnLengthMismatch"); + return; + } if (input == GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid) { output = Json::Value("MatchmakingEntityInvalid"); @@ -9443,6 +9555,11 @@ namespace PlayFab output = Json::Value("EventSinkContainerNotFound"); return; } + if (input == GenericErrorCodes::GenericErrorCodesEventSinkTenantIdInvalid) + { + output = Json::Value("EventSinkTenantIdInvalid"); + return; + } if (input == GenericErrorCodes::GenericErrorCodesOperationCanceled) { output = Json::Value("OperationCanceled"); @@ -9788,9 +9905,124 @@ namespace PlayFab output = Json::Value("TrueSkillOperationCanceled"); return; } - if (input == GenericErrorCodes::GenericErrorCodesStateShareUnauthorized) + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillActiveModelLimitExceeded) + { + output = Json::Value("TrueSkillActiveModelLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillTotalModelLimitExceeded) + { + output = Json::Value("TrueSkillTotalModelLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillUnknownInitialModelId) + { + output = Json::Value("TrueSkillUnknownInitialModelId"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillUnauthorizedForJob) + { + output = Json::Value("TrueSkillUnauthorizedForJob"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidScenarioName) + { + output = Json::Value("TrueSkillInvalidScenarioName"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionStateIsRequired) + { + output = Json::Value("TrueSkillConditionStateIsRequired"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillEventStateIsRequired) + { + output = Json::Value("TrueSkillEventStateIsRequired"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateEvent) { - output = Json::Value("StateShareUnauthorized"); + output = Json::Value("TrueSkillDuplicateEvent"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateCondition) + { + output = Json::Value("TrueSkillDuplicateCondition"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidAnomalyThreshold) + { + output = Json::Value("TrueSkillInvalidAnomalyThreshold"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionKeyLimitExceeded) + { + output = Json::Value("TrueSkillConditionKeyLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionValuePerKeyLimitExceeded) + { + output = Json::Value("TrueSkillConditionValuePerKeyLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidTimestamp) + { + output = Json::Value("TrueSkillInvalidTimestamp"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillEventLimitExceeded) + { + output = Json::Value("TrueSkillEventLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayers) + { + output = Json::Value("TrueSkillInvalidPlayers"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillTrueSkillPlayerNull) + { + output = Json::Value("TrueSkillTrueSkillPlayerNull"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayerId) + { + output = Json::Value("TrueSkillInvalidPlayerId"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidSquadSize) + { + output = Json::Value("TrueSkillInvalidSquadSize"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionSetNotInModel) + { + output = Json::Value("TrueSkillConditionSetNotInModel"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesGameSaveManifestNotFound) + { + output = Json::Value("GameSaveManifestNotFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesGameSaveManifestVersionAlreadyExists) + { + output = Json::Value("GameSaveManifestVersionAlreadyExists"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesGameSaveConflictUpdatingManifest) + { + output = Json::Value("GameSaveConflictUpdatingManifest"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareForbidden) + { + output = Json::Value("StateShareForbidden"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareTitleNotInFlight) + { + output = Json::Value("StateShareTitleNotInFlight"); return; } if (input == GenericErrorCodes::GenericErrorCodesStateShareStateNotFound) @@ -9803,6 +10035,26 @@ namespace PlayFab output = Json::Value("StateShareLinkNotFound"); return; } + if (input == GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitExceeded) + { + output = Json::Value("StateShareStateRedemptionLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitNotUpdated) + { + output = Json::Value("StateShareStateRedemptionLimitNotUpdated"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareCreatedStatesLimitExceeded) + { + output = Json::Value("StateShareCreatedStatesLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareIdMissingOrMalformed) + { + output = Json::Value("StateShareIdMissingOrMalformed"); + return; + } } inline void FromJsonEnum(const Json::Value& input, GenericErrorCodes& output) { @@ -12646,6 +12898,76 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesCloudScriptAzureFunctionsEventHubRequestError; return; } + if (inputStr == "ExternalEntityNotAllowedForTier") + { + output = GenericErrorCodes::GenericErrorCodesExternalEntityNotAllowedForTier; + return; + } + if (inputStr == "InvalidBaseTimeForInterval") + { + output = GenericErrorCodes::GenericErrorCodesInvalidBaseTimeForInterval; + return; + } + if (inputStr == "EntityTypeMismatchWithStatDefinition") + { + output = GenericErrorCodes::GenericErrorCodesEntityTypeMismatchWithStatDefinition; + return; + } + if (inputStr == "SpecifiedVersionLeaderboardNotFound") + { + output = GenericErrorCodes::GenericErrorCodesSpecifiedVersionLeaderboardNotFound; + return; + } + if (inputStr == "LeaderboardColumnLengthMismatchWithStatDefinition") + { + output = GenericErrorCodes::GenericErrorCodesLeaderboardColumnLengthMismatchWithStatDefinition; + return; + } + if (inputStr == "DuplicateColumnNameFound") + { + output = GenericErrorCodes::GenericErrorCodesDuplicateColumnNameFound; + return; + } + if (inputStr == "LinkedStatisticColumnNotFound") + { + output = GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnNotFound; + return; + } + if (inputStr == "LinkedStatisticColumnRequired") + { + output = GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnRequired; + return; + } + if (inputStr == "MultipleLinkedStatisticsNotAllowed") + { + output = GenericErrorCodes::GenericErrorCodesMultipleLinkedStatisticsNotAllowed; + return; + } + if (inputStr == "DuplicateLinkedStatisticColumnNameFound") + { + output = GenericErrorCodes::GenericErrorCodesDuplicateLinkedStatisticColumnNameFound; + return; + } + if (inputStr == "AggregationTypeNotAllowedForMultiColumnStatistic") + { + output = GenericErrorCodes::GenericErrorCodesAggregationTypeNotAllowedForMultiColumnStatistic; + return; + } + if (inputStr == "MaxQueryableVerionsValueNotAllowedForTier") + { + output = GenericErrorCodes::GenericErrorCodesMaxQueryableVerionsValueNotAllowedForTier; + return; + } + if (inputStr == "StatisticDefinitionHasNullOrEmptyVersionConfiguration") + { + output = GenericErrorCodes::GenericErrorCodesStatisticDefinitionHasNullOrEmptyVersionConfiguration; + return; + } + if (inputStr == "StatisticColumnLengthMismatch") + { + output = GenericErrorCodes::GenericErrorCodesStatisticColumnLengthMismatch; + return; + } if (inputStr == "MatchmakingEntityInvalid") { output = GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid; @@ -13531,6 +13853,11 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesEventSinkContainerNotFound; return; } + if (inputStr == "EventSinkTenantIdInvalid") + { + output = GenericErrorCodes::GenericErrorCodesEventSinkTenantIdInvalid; + return; + } if (inputStr == "OperationCanceled") { output = GenericErrorCodes::GenericErrorCodesOperationCanceled; @@ -13876,9 +14203,124 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesTrueSkillOperationCanceled; return; } - if (inputStr == "StateShareUnauthorized") + if (inputStr == "TrueSkillActiveModelLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillActiveModelLimitExceeded; + return; + } + if (inputStr == "TrueSkillTotalModelLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillTotalModelLimitExceeded; + return; + } + if (inputStr == "TrueSkillUnknownInitialModelId") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillUnknownInitialModelId; + return; + } + if (inputStr == "TrueSkillUnauthorizedForJob") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillUnauthorizedForJob; + return; + } + if (inputStr == "TrueSkillInvalidScenarioName") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidScenarioName; + return; + } + if (inputStr == "TrueSkillConditionStateIsRequired") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionStateIsRequired; + return; + } + if (inputStr == "TrueSkillEventStateIsRequired") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillEventStateIsRequired; + return; + } + if (inputStr == "TrueSkillDuplicateEvent") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateEvent; + return; + } + if (inputStr == "TrueSkillDuplicateCondition") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateCondition; + return; + } + if (inputStr == "TrueSkillInvalidAnomalyThreshold") { - output = GenericErrorCodes::GenericErrorCodesStateShareUnauthorized; + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidAnomalyThreshold; + return; + } + if (inputStr == "TrueSkillConditionKeyLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionKeyLimitExceeded; + return; + } + if (inputStr == "TrueSkillConditionValuePerKeyLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionValuePerKeyLimitExceeded; + return; + } + if (inputStr == "TrueSkillInvalidTimestamp") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidTimestamp; + return; + } + if (inputStr == "TrueSkillEventLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillEventLimitExceeded; + return; + } + if (inputStr == "TrueSkillInvalidPlayers") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayers; + return; + } + if (inputStr == "TrueSkillTrueSkillPlayerNull") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillTrueSkillPlayerNull; + return; + } + if (inputStr == "TrueSkillInvalidPlayerId") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayerId; + return; + } + if (inputStr == "TrueSkillInvalidSquadSize") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidSquadSize; + return; + } + if (inputStr == "TrueSkillConditionSetNotInModel") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionSetNotInModel; + return; + } + if (inputStr == "GameSaveManifestNotFound") + { + output = GenericErrorCodes::GenericErrorCodesGameSaveManifestNotFound; + return; + } + if (inputStr == "GameSaveManifestVersionAlreadyExists") + { + output = GenericErrorCodes::GenericErrorCodesGameSaveManifestVersionAlreadyExists; + return; + } + if (inputStr == "GameSaveConflictUpdatingManifest") + { + output = GenericErrorCodes::GenericErrorCodesGameSaveConflictUpdatingManifest; + return; + } + if (inputStr == "StateShareForbidden") + { + output = GenericErrorCodes::GenericErrorCodesStateShareForbidden; + return; + } + if (inputStr == "StateShareTitleNotInFlight") + { + output = GenericErrorCodes::GenericErrorCodesStateShareTitleNotInFlight; return; } if (inputStr == "StateShareStateNotFound") @@ -13891,6 +14333,26 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesStateShareLinkNotFound; return; } + if (inputStr == "StateShareStateRedemptionLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitExceeded; + return; + } + if (inputStr == "StateShareStateRedemptionLimitNotUpdated") + { + output = GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitNotUpdated; + return; + } + if (inputStr == "StateShareCreatedStatesLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesStateShareCreatedStatesLimitExceeded; + return; + } + if (inputStr == "StateShareIdMissingOrMalformed") + { + output = GenericErrorCodes::GenericErrorCodesStateShareIdMissingOrMalformed; + return; + } } enum class LoginIdentityProvider @@ -13916,7 +14378,8 @@ namespace PlayFab LoginIdentityProviderOpenIdConnect, LoginIdentityProviderApple, LoginIdentityProviderNintendoSwitchAccount, - LoginIdentityProviderGooglePlayGames + LoginIdentityProviderGooglePlayGames, + LoginIdentityProviderXboxMobileStore }; inline void ToJsonEnum(const LoginIdentityProvider input, Json::Value& output) @@ -14031,6 +14494,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == LoginIdentityProvider::LoginIdentityProviderXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, LoginIdentityProvider& output) { @@ -14149,6 +14617,11 @@ namespace PlayFab output = LoginIdentityProvider::LoginIdentityProviderGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = LoginIdentityProvider::LoginIdentityProviderXboxMobileStore; + return; + } } enum class PushNotificationPlatform @@ -20084,7 +20557,8 @@ namespace PlayFab UserOriginationOpenIdConnect, UserOriginationApple, UserOriginationNintendoSwitchAccount, - UserOriginationGooglePlayGames + UserOriginationGooglePlayGames, + UserOriginationXboxMobileStore }; inline void ToJsonEnum(const UserOrigination input, Json::Value& output) @@ -20209,6 +20683,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == UserOrigination::UserOriginationXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, UserOrigination& output) { @@ -20337,6 +20816,11 @@ namespace PlayFab output = UserOrigination::UserOriginationGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = UserOrigination::UserOriginationXboxMobileStore; + return; + } } // Admin Classes diff --git a/code/include/playfab/PlayFabAuthenticationDataModels.h b/code/include/playfab/PlayFabAuthenticationDataModels.h index ed8d99b1..eba18fb1 100644 --- a/code/include/playfab/PlayFabAuthenticationDataModels.h +++ b/code/include/playfab/PlayFabAuthenticationDataModels.h @@ -14,7 +14,14 @@ namespace PlayFab { IdentifiedDeviceTypeUnknown, IdentifiedDeviceTypeXboxOne, - IdentifiedDeviceTypeScarlett + IdentifiedDeviceTypeScarlett, + IdentifiedDeviceTypeWindowsOneCore, + IdentifiedDeviceTypeWindowsOneCoreMobile, + IdentifiedDeviceTypeWin32, + IdentifiedDeviceTypeandroid, + IdentifiedDeviceTypeiOS, + IdentifiedDeviceTypePlayStation, + IdentifiedDeviceTypeNintendo }; inline void ToJsonEnum(const IdentifiedDeviceType input, Json::Value& output) @@ -34,6 +41,41 @@ namespace PlayFab output = Json::Value("Scarlett"); return; } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypeWindowsOneCore) + { + output = Json::Value("WindowsOneCore"); + return; + } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypeWindowsOneCoreMobile) + { + output = Json::Value("WindowsOneCoreMobile"); + return; + } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypeWin32) + { + output = Json::Value("Win32"); + return; + } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypeandroid) + { + output = Json::Value("android"); + return; + } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypeiOS) + { + output = Json::Value("iOS"); + return; + } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypePlayStation) + { + output = Json::Value("PlayStation"); + return; + } + if (input == IdentifiedDeviceType::IdentifiedDeviceTypeNintendo) + { + output = Json::Value("Nintendo"); + return; + } } inline void FromJsonEnum(const Json::Value& input, IdentifiedDeviceType& output) { @@ -57,6 +99,41 @@ namespace PlayFab output = IdentifiedDeviceType::IdentifiedDeviceTypeScarlett; return; } + if (inputStr == "WindowsOneCore") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypeWindowsOneCore; + return; + } + if (inputStr == "WindowsOneCoreMobile") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypeWindowsOneCoreMobile; + return; + } + if (inputStr == "Win32") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypeWin32; + return; + } + if (inputStr == "android") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypeandroid; + return; + } + if (inputStr == "iOS") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypeiOS; + return; + } + if (inputStr == "PlayStation") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypePlayStation; + return; + } + if (inputStr == "Nintendo") + { + output = IdentifiedDeviceType::IdentifiedDeviceTypeNintendo; + return; + } } enum class LoginIdentityProvider @@ -82,7 +159,8 @@ namespace PlayFab LoginIdentityProviderOpenIdConnect, LoginIdentityProviderApple, LoginIdentityProviderNintendoSwitchAccount, - LoginIdentityProviderGooglePlayGames + LoginIdentityProviderGooglePlayGames, + LoginIdentityProviderXboxMobileStore }; inline void ToJsonEnum(const LoginIdentityProvider input, Json::Value& output) @@ -197,6 +275,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == LoginIdentityProvider::LoginIdentityProviderXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, LoginIdentityProvider& output) { @@ -315,6 +398,11 @@ namespace PlayFab output = LoginIdentityProvider::LoginIdentityProviderGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = LoginIdentityProvider::LoginIdentityProviderXboxMobileStore; + return; + } } // Authentication Classes diff --git a/code/include/playfab/PlayFabClientDataModels.h b/code/include/playfab/PlayFabClientDataModels.h index c979f2e2..30b750e7 100644 --- a/code/include/playfab/PlayFabClientDataModels.h +++ b/code/include/playfab/PlayFabClientDataModels.h @@ -4941,7 +4941,8 @@ namespace PlayFab LoginIdentityProviderOpenIdConnect, LoginIdentityProviderApple, LoginIdentityProviderNintendoSwitchAccount, - LoginIdentityProviderGooglePlayGames + LoginIdentityProviderGooglePlayGames, + LoginIdentityProviderXboxMobileStore }; inline void ToJsonEnum(const LoginIdentityProvider input, Json::Value& output) @@ -5056,6 +5057,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == LoginIdentityProvider::LoginIdentityProviderXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, LoginIdentityProvider& output) { @@ -5174,6 +5180,11 @@ namespace PlayFab output = LoginIdentityProvider::LoginIdentityProviderGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = LoginIdentityProvider::LoginIdentityProviderXboxMobileStore; + return; + } } enum class PushNotificationPlatform @@ -5874,7 +5885,8 @@ namespace PlayFab UserOriginationOpenIdConnect, UserOriginationApple, UserOriginationNintendoSwitchAccount, - UserOriginationGooglePlayGames + UserOriginationGooglePlayGames, + UserOriginationXboxMobileStore }; inline void ToJsonEnum(const UserOrigination input, Json::Value& output) @@ -5999,6 +6011,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == UserOrigination::UserOriginationXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, UserOrigination& output) { @@ -6127,6 +6144,11 @@ namespace PlayFab output = UserOrigination::UserOriginationGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = UserOrigination::UserOriginationXboxMobileStore; + return; + } } // Client Classes diff --git a/code/include/playfab/PlayFabCloudScriptDataModels.h b/code/include/playfab/PlayFabCloudScriptDataModels.h index 85bd36eb..2474d61a 100644 --- a/code/include/playfab/PlayFabCloudScriptDataModels.h +++ b/code/include/playfab/PlayFabCloudScriptDataModels.h @@ -3001,7 +3001,8 @@ namespace PlayFab LoginIdentityProviderOpenIdConnect, LoginIdentityProviderApple, LoginIdentityProviderNintendoSwitchAccount, - LoginIdentityProviderGooglePlayGames + LoginIdentityProviderGooglePlayGames, + LoginIdentityProviderXboxMobileStore }; inline void ToJsonEnum(const LoginIdentityProvider input, Json::Value& output) @@ -3116,6 +3117,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == LoginIdentityProvider::LoginIdentityProviderXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, LoginIdentityProvider& output) { @@ -3234,6 +3240,11 @@ namespace PlayFab output = LoginIdentityProvider::LoginIdentityProviderGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = LoginIdentityProvider::LoginIdentityProviderXboxMobileStore; + return; + } } enum class PushNotificationPlatform diff --git a/code/include/playfab/PlayFabError.h b/code/include/playfab/PlayFabError.h index 91cc814f..947a4a51 100644 --- a/code/include/playfab/PlayFabError.h +++ b/code/include/playfab/PlayFabError.h @@ -578,6 +578,20 @@ namespace PlayFab PlayFabErrorStatisticDefinitionModificationNotAllowedWhileLinked = 1577, PlayFabErrorLeaderboardUpdateNotAllowedWhileLinked = 1578, PlayFabErrorCloudScriptAzureFunctionsEventHubRequestError = 1579, + PlayFabErrorExternalEntityNotAllowedForTier = 1580, + PlayFabErrorInvalidBaseTimeForInterval = 1581, + PlayFabErrorEntityTypeMismatchWithStatDefinition = 1582, + PlayFabErrorSpecifiedVersionLeaderboardNotFound = 1583, + PlayFabErrorLeaderboardColumnLengthMismatchWithStatDefinition = 1584, + PlayFabErrorDuplicateColumnNameFound = 1585, + PlayFabErrorLinkedStatisticColumnNotFound = 1586, + PlayFabErrorLinkedStatisticColumnRequired = 1587, + PlayFabErrorMultipleLinkedStatisticsNotAllowed = 1588, + PlayFabErrorDuplicateLinkedStatisticColumnNameFound = 1589, + PlayFabErrorAggregationTypeNotAllowedForMultiColumnStatistic = 1590, + PlayFabErrorMaxQueryableVerionsValueNotAllowedForTier = 1591, + PlayFabErrorStatisticDefinitionHasNullOrEmptyVersionConfiguration = 1592, + PlayFabErrorStatisticColumnLengthMismatch = 1593, PlayFabErrorMatchmakingEntityInvalid = 2001, PlayFabErrorMatchmakingPlayerAttributesInvalid = 2002, PlayFabErrorMatchmakingQueueNotFound = 2016, @@ -755,6 +769,7 @@ namespace PlayFab PlayFabErrorEventSinkTitleUnauthorized = 15012, PlayFabErrorEventSinkInsufficientRoleAssignment = 15013, PlayFabErrorEventSinkContainerNotFound = 15014, + PlayFabErrorEventSinkTenantIdInvalid = 15015, PlayFabErrorOperationCanceled = 16000, PlayFabErrorInvalidDisplayNameRandomSuffixLength = 17000, PlayFabErrorAllowNonUniquePlayerDisplayNamesDisableNotAllowed = 17001, @@ -824,9 +839,36 @@ namespace PlayFab PlayFabErrorTrueSkillJobAlreadyExists = 20044, PlayFabErrorTrueSkillJobNotFound = 20045, PlayFabErrorTrueSkillOperationCanceled = 20046, - PlayFabErrorStateShareUnauthorized = 21000, - PlayFabErrorStateShareStateNotFound = 21001, - PlayFabErrorStateShareLinkNotFound = 21002, + PlayFabErrorTrueSkillActiveModelLimitExceeded = 20047, + PlayFabErrorTrueSkillTotalModelLimitExceeded = 20048, + PlayFabErrorTrueSkillUnknownInitialModelId = 20049, + PlayFabErrorTrueSkillUnauthorizedForJob = 20050, + PlayFabErrorTrueSkillInvalidScenarioName = 20051, + PlayFabErrorTrueSkillConditionStateIsRequired = 20052, + PlayFabErrorTrueSkillEventStateIsRequired = 20053, + PlayFabErrorTrueSkillDuplicateEvent = 20054, + PlayFabErrorTrueSkillDuplicateCondition = 20055, + PlayFabErrorTrueSkillInvalidAnomalyThreshold = 20056, + PlayFabErrorTrueSkillConditionKeyLimitExceeded = 20057, + PlayFabErrorTrueSkillConditionValuePerKeyLimitExceeded = 20058, + PlayFabErrorTrueSkillInvalidTimestamp = 20059, + PlayFabErrorTrueSkillEventLimitExceeded = 20060, + PlayFabErrorTrueSkillInvalidPlayers = 20061, + PlayFabErrorTrueSkillTrueSkillPlayerNull = 20062, + PlayFabErrorTrueSkillInvalidPlayerId = 20063, + PlayFabErrorTrueSkillInvalidSquadSize = 20064, + PlayFabErrorTrueSkillConditionSetNotInModel = 20065, + PlayFabErrorGameSaveManifestNotFound = 20300, + PlayFabErrorGameSaveManifestVersionAlreadyExists = 20301, + PlayFabErrorGameSaveConflictUpdatingManifest = 20302, + PlayFabErrorStateShareForbidden = 21000, + PlayFabErrorStateShareTitleNotInFlight = 21001, + PlayFabErrorStateShareStateNotFound = 21002, + PlayFabErrorStateShareLinkNotFound = 21003, + PlayFabErrorStateShareStateRedemptionLimitExceeded = 21004, + PlayFabErrorStateShareStateRedemptionLimitNotUpdated = 21005, + PlayFabErrorStateShareCreatedStatesLimitExceeded = 21006, + PlayFabErrorStateShareIdMissingOrMalformed = 21007, }; /// diff --git a/code/include/playfab/PlayFabLeaderboardsApi.h b/code/include/playfab/PlayFabLeaderboardsApi.h new file mode 100644 index 00000000..921b47b3 --- /dev/null +++ b/code/include/playfab/PlayFabLeaderboardsApi.h @@ -0,0 +1,87 @@ +#pragma once + +#if !defined(DISABLE_PLAYFABENTITY_API) + +#include +#include + +namespace PlayFab +{ + class CallRequestContainerBase; + class CallRequestContainer; + + /// + /// Main interface for PlayFab Sdk, specifically all Leaderboards APIs + /// + class PlayFabLeaderboardsAPI + { + public: + /// + /// Calls the Update function on your implementation of the IHttpPlugin to check for responses to HTTP requests. + /// All api's (Client, Server, Admin etc.) share the same IHttpPlugin. + /// This means that you only need to call Update() on one API to retrieve the responses for all APIs. + /// Additional calls to Update (on any API) during the same tick are unlikely to retrieve additional responses. + /// Call Update when your game ticks as follows: + /// Leaderboards.Update(); + /// + static size_t Update(); + static void ForgetAllCredentials(); + + + // ------------ Generated API calls + static void CreateLeaderboardDefinition(LeaderboardsModels::CreateLeaderboardDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void CreateStatisticDefinition(LeaderboardsModels::CreateStatisticDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void DeleteLeaderboardDefinition(LeaderboardsModels::DeleteLeaderboardDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void DeleteLeaderboardEntries(LeaderboardsModels::DeleteLeaderboardEntriesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void DeleteStatisticDefinition(LeaderboardsModels::DeleteStatisticDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void DeleteStatistics(LeaderboardsModels::DeleteStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetFriendLeaderboardForEntity(LeaderboardsModels::GetFriendLeaderboardForEntityRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetLeaderboard(LeaderboardsModels::GetEntityLeaderboardRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetLeaderboardAroundEntity(LeaderboardsModels::GetLeaderboardAroundEntityRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetLeaderboardDefinition(LeaderboardsModels::GetLeaderboardDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetLeaderboardForEntities(LeaderboardsModels::GetLeaderboardForEntitiesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetStatisticDefinition(LeaderboardsModels::GetStatisticDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetStatisticDefinitions(LeaderboardsModels::GetStatisticDefinitionsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetStatistics(LeaderboardsModels::GetStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetStatisticsForEntities(LeaderboardsModels::GetStatisticsForEntitiesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void IncrementLeaderboardVersion(LeaderboardsModels::IncrementLeaderboardVersionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void IncrementStatisticVersion(LeaderboardsModels::IncrementStatisticVersionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void ListLeaderboardDefinitions(LeaderboardsModels::ListLeaderboardDefinitionsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void ListStatisticDefinitions(LeaderboardsModels::ListStatisticDefinitionsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void UnlinkLeaderboardFromStatistic(LeaderboardsModels::UnlinkLeaderboardFromStatisticRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void UpdateLeaderboardEntries(LeaderboardsModels::UpdateLeaderboardEntriesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void UpdateStatistics(LeaderboardsModels::UpdateStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + + private: + PlayFabLeaderboardsAPI(); // Private constructor, static class should never have an instance + PlayFabLeaderboardsAPI(const PlayFabLeaderboardsAPI& other); // Private copy-constructor, static class should never have an instance + + // ------------ Generated result handlers + static void OnCreateLeaderboardDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnCreateStatisticDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnDeleteLeaderboardDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnDeleteLeaderboardEntriesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnDeleteStatisticDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnDeleteStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetFriendLeaderboardForEntityResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetLeaderboardResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetLeaderboardAroundEntityResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetLeaderboardDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetLeaderboardForEntitiesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetStatisticDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetStatisticDefinitionsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetStatisticsForEntitiesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnIncrementLeaderboardVersionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnIncrementStatisticVersionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnListLeaderboardDefinitionsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnListStatisticDefinitionsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnUnlinkLeaderboardFromStatisticResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnUpdateLeaderboardEntriesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnUpdateStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + + static bool ValidateResult(PlayFabResultCommon& resultCommon, const CallRequestContainer& container); + }; +} + +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabLeaderboardsDataModels.h b/code/include/playfab/PlayFabLeaderboardsDataModels.h new file mode 100644 index 00000000..94d9a6b9 --- /dev/null +++ b/code/include/playfab/PlayFabLeaderboardsDataModels.h @@ -0,0 +1,2179 @@ +#pragma once + +#if !defined(DISABLE_PLAYFABENTITY_API) + +#include +#include + +namespace PlayFab +{ + namespace LeaderboardsModels + { + // Leaderboards Enums + enum class ExternalFriendSources + { + ExternalFriendSourcesNone, + ExternalFriendSourcesSteam, + ExternalFriendSourcesFacebook, + ExternalFriendSourcesXbox, + ExternalFriendSourcesPsn, + ExternalFriendSourcesAll + }; + + inline void ToJsonEnum(const ExternalFriendSources input, Json::Value& output) + { + if (input == ExternalFriendSources::ExternalFriendSourcesNone) + { + output = Json::Value("None"); + return; + } + if (input == ExternalFriendSources::ExternalFriendSourcesSteam) + { + output = Json::Value("Steam"); + return; + } + if (input == ExternalFriendSources::ExternalFriendSourcesFacebook) + { + output = Json::Value("Facebook"); + return; + } + if (input == ExternalFriendSources::ExternalFriendSourcesXbox) + { + output = Json::Value("Xbox"); + return; + } + if (input == ExternalFriendSources::ExternalFriendSourcesPsn) + { + output = Json::Value("Psn"); + return; + } + if (input == ExternalFriendSources::ExternalFriendSourcesAll) + { + output = Json::Value("All"); + return; + } + } + inline void FromJsonEnum(const Json::Value& input, ExternalFriendSources& output) + { + if (!input.isString()) + { + return; + } + const std::string& inputStr = input.asString(); + if (inputStr == "None") + { + output = ExternalFriendSources::ExternalFriendSourcesNone; + return; + } + if (inputStr == "Steam") + { + output = ExternalFriendSources::ExternalFriendSourcesSteam; + return; + } + if (inputStr == "Facebook") + { + output = ExternalFriendSources::ExternalFriendSourcesFacebook; + return; + } + if (inputStr == "Xbox") + { + output = ExternalFriendSources::ExternalFriendSourcesXbox; + return; + } + if (inputStr == "Psn") + { + output = ExternalFriendSources::ExternalFriendSourcesPsn; + return; + } + if (inputStr == "All") + { + output = ExternalFriendSources::ExternalFriendSourcesAll; + return; + } + } + + enum class LeaderboardSortDirection + { + LeaderboardSortDirectionDescending, + LeaderboardSortDirectionAscending + }; + + inline void ToJsonEnum(const LeaderboardSortDirection input, Json::Value& output) + { + if (input == LeaderboardSortDirection::LeaderboardSortDirectionDescending) + { + output = Json::Value("Descending"); + return; + } + if (input == LeaderboardSortDirection::LeaderboardSortDirectionAscending) + { + output = Json::Value("Ascending"); + return; + } + } + inline void FromJsonEnum(const Json::Value& input, LeaderboardSortDirection& output) + { + if (!input.isString()) + { + return; + } + const std::string& inputStr = input.asString(); + if (inputStr == "Descending") + { + output = LeaderboardSortDirection::LeaderboardSortDirectionDescending; + return; + } + if (inputStr == "Ascending") + { + output = LeaderboardSortDirection::LeaderboardSortDirectionAscending; + return; + } + } + + enum class ResetInterval + { + ResetIntervalManual, + ResetIntervalHour, + ResetIntervalDay, + ResetIntervalWeek, + ResetIntervalMonth + }; + + inline void ToJsonEnum(const ResetInterval input, Json::Value& output) + { + if (input == ResetInterval::ResetIntervalManual) + { + output = Json::Value("Manual"); + return; + } + if (input == ResetInterval::ResetIntervalHour) + { + output = Json::Value("Hour"); + return; + } + if (input == ResetInterval::ResetIntervalDay) + { + output = Json::Value("Day"); + return; + } + if (input == ResetInterval::ResetIntervalWeek) + { + output = Json::Value("Week"); + return; + } + if (input == ResetInterval::ResetIntervalMonth) + { + output = Json::Value("Month"); + return; + } + } + inline void FromJsonEnum(const Json::Value& input, ResetInterval& output) + { + if (!input.isString()) + { + return; + } + const std::string& inputStr = input.asString(); + if (inputStr == "Manual") + { + output = ResetInterval::ResetIntervalManual; + return; + } + if (inputStr == "Hour") + { + output = ResetInterval::ResetIntervalHour; + return; + } + if (inputStr == "Day") + { + output = ResetInterval::ResetIntervalDay; + return; + } + if (inputStr == "Week") + { + output = ResetInterval::ResetIntervalWeek; + return; + } + if (inputStr == "Month") + { + output = ResetInterval::ResetIntervalMonth; + return; + } + } + + enum class StatisticAggregationMethod + { + StatisticAggregationMethodLast, + StatisticAggregationMethodMin, + StatisticAggregationMethodMax, + StatisticAggregationMethodSum + }; + + inline void ToJsonEnum(const StatisticAggregationMethod input, Json::Value& output) + { + if (input == StatisticAggregationMethod::StatisticAggregationMethodLast) + { + output = Json::Value("Last"); + return; + } + if (input == StatisticAggregationMethod::StatisticAggregationMethodMin) + { + output = Json::Value("Min"); + return; + } + if (input == StatisticAggregationMethod::StatisticAggregationMethodMax) + { + output = Json::Value("Max"); + return; + } + if (input == StatisticAggregationMethod::StatisticAggregationMethodSum) + { + output = Json::Value("Sum"); + return; + } + } + inline void FromJsonEnum(const Json::Value& input, StatisticAggregationMethod& output) + { + if (!input.isString()) + { + return; + } + const std::string& inputStr = input.asString(); + if (inputStr == "Last") + { + output = StatisticAggregationMethod::StatisticAggregationMethodLast; + return; + } + if (inputStr == "Min") + { + output = StatisticAggregationMethod::StatisticAggregationMethodMin; + return; + } + if (inputStr == "Max") + { + output = StatisticAggregationMethod::StatisticAggregationMethodMax; + return; + } + if (inputStr == "Sum") + { + output = StatisticAggregationMethod::StatisticAggregationMethodSum; + return; + } + } + + // Leaderboards Classes + struct LinkedStatisticColumn : public PlayFabBaseModel + { + std::string LinkedStatisticColumnName; + std::string LinkedStatisticName; + + LinkedStatisticColumn() : + PlayFabBaseModel(), + LinkedStatisticColumnName(), + LinkedStatisticName() + {} + + LinkedStatisticColumn(const LinkedStatisticColumn& src) : + PlayFabBaseModel(), + LinkedStatisticColumnName(src.LinkedStatisticColumnName), + LinkedStatisticName(src.LinkedStatisticName) + {} + + ~LinkedStatisticColumn() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["LinkedStatisticColumnName"], LinkedStatisticColumnName); + FromJsonUtilS(input["LinkedStatisticName"], LinkedStatisticName); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_LinkedStatisticColumnName; ToJsonUtilS(LinkedStatisticColumnName, each_LinkedStatisticColumnName); output["LinkedStatisticColumnName"] = each_LinkedStatisticColumnName; + Json::Value each_LinkedStatisticName; ToJsonUtilS(LinkedStatisticName, each_LinkedStatisticName); output["LinkedStatisticName"] = each_LinkedStatisticName; + return output; + } + }; + + struct LeaderboardColumn : public PlayFabBaseModel + { + Boxed pfLinkedStatisticColumn; + std::string Name; + LeaderboardSortDirection SortDirection; + + LeaderboardColumn() : + PlayFabBaseModel(), + pfLinkedStatisticColumn(), + Name(), + SortDirection() + {} + + LeaderboardColumn(const LeaderboardColumn& src) : + PlayFabBaseModel(), + pfLinkedStatisticColumn(src.pfLinkedStatisticColumn), + Name(src.Name), + SortDirection(src.SortDirection) + {} + + ~LeaderboardColumn() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["LinkedStatisticColumn"], pfLinkedStatisticColumn); + FromJsonUtilS(input["Name"], Name); + FromJsonEnum(input["SortDirection"], SortDirection); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_pfLinkedStatisticColumn; ToJsonUtilO(pfLinkedStatisticColumn, each_pfLinkedStatisticColumn); output["LinkedStatisticColumn"] = each_pfLinkedStatisticColumn; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_SortDirection; ToJsonEnum(SortDirection, each_SortDirection); output["SortDirection"] = each_SortDirection; + return output; + } + }; + + struct VersionConfiguration : public PlayFabBaseModel + { + Int32 MaxQueryableVersions; + ResetInterval pfResetInterval; + + VersionConfiguration() : + PlayFabBaseModel(), + MaxQueryableVersions(), + pfResetInterval() + {} + + VersionConfiguration(const VersionConfiguration& src) : + PlayFabBaseModel(), + MaxQueryableVersions(src.MaxQueryableVersions), + pfResetInterval(src.pfResetInterval) + {} + + ~VersionConfiguration() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["MaxQueryableVersions"], MaxQueryableVersions); + FromJsonEnum(input["ResetInterval"], pfResetInterval); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_MaxQueryableVersions; ToJsonUtilP(MaxQueryableVersions, each_MaxQueryableVersions); output["MaxQueryableVersions"] = each_MaxQueryableVersions; + Json::Value each_pfResetInterval; ToJsonEnum(pfResetInterval, each_pfResetInterval); output["ResetInterval"] = each_pfResetInterval; + return output; + } + }; + + struct CreateLeaderboardDefinitionRequest : public PlayFabRequestCommon + { + std::list Columns; + std::map CustomTags; + std::string EntityType; + std::string Name; + Int32 SizeLimit; + VersionConfiguration pfVersionConfiguration; + + CreateLeaderboardDefinitionRequest() : + PlayFabRequestCommon(), + Columns(), + CustomTags(), + EntityType(), + Name(), + SizeLimit(), + pfVersionConfiguration() + {} + + CreateLeaderboardDefinitionRequest(const CreateLeaderboardDefinitionRequest& src) : + PlayFabRequestCommon(), + Columns(src.Columns), + CustomTags(src.CustomTags), + EntityType(src.EntityType), + Name(src.Name), + SizeLimit(src.SizeLimit), + pfVersionConfiguration(src.pfVersionConfiguration) + {} + + ~CreateLeaderboardDefinitionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["EntityType"], EntityType); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilP(input["SizeLimit"], SizeLimit); + FromJsonUtilO(input["VersionConfiguration"], pfVersionConfiguration); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_EntityType; ToJsonUtilS(EntityType, each_EntityType); output["EntityType"] = each_EntityType; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_SizeLimit; ToJsonUtilP(SizeLimit, each_SizeLimit); output["SizeLimit"] = each_SizeLimit; + Json::Value each_pfVersionConfiguration; ToJsonUtilO(pfVersionConfiguration, each_pfVersionConfiguration); output["VersionConfiguration"] = each_pfVersionConfiguration; + return output; + } + }; + + struct StatisticColumn : public PlayFabBaseModel + { + StatisticAggregationMethod AggregationMethod; + std::string Name; + + StatisticColumn() : + PlayFabBaseModel(), + AggregationMethod(), + Name() + {} + + StatisticColumn(const StatisticColumn& src) : + PlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + Name(src.Name) + {} + + ~StatisticColumn() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonEnum(input["AggregationMethod"], AggregationMethod); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_AggregationMethod; ToJsonEnum(AggregationMethod, each_AggregationMethod); output["AggregationMethod"] = each_AggregationMethod; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct CreateStatisticDefinitionRequest : public PlayFabRequestCommon + { + std::list Columns; + std::map CustomTags; + std::string EntityType; + std::string Name; + Boxed pfVersionConfiguration; + + CreateStatisticDefinitionRequest() : + PlayFabRequestCommon(), + Columns(), + CustomTags(), + EntityType(), + Name(), + pfVersionConfiguration() + {} + + CreateStatisticDefinitionRequest(const CreateStatisticDefinitionRequest& src) : + PlayFabRequestCommon(), + Columns(src.Columns), + CustomTags(src.CustomTags), + EntityType(src.EntityType), + Name(src.Name), + pfVersionConfiguration(src.pfVersionConfiguration) + {} + + ~CreateStatisticDefinitionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["EntityType"], EntityType); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilO(input["VersionConfiguration"], pfVersionConfiguration); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_EntityType; ToJsonUtilS(EntityType, each_EntityType); output["EntityType"] = each_EntityType; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_pfVersionConfiguration; ToJsonUtilO(pfVersionConfiguration, each_pfVersionConfiguration); output["VersionConfiguration"] = each_pfVersionConfiguration; + return output; + } + }; + + struct DeleteLeaderboardDefinitionRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + + DeleteLeaderboardDefinitionRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name() + {} + + DeleteLeaderboardDefinitionRequest(const DeleteLeaderboardDefinitionRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name) + {} + + ~DeleteLeaderboardDefinitionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct DeleteLeaderboardEntriesRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::list EntityIds; + std::string Name; + + DeleteLeaderboardEntriesRequest() : + PlayFabRequestCommon(), + CustomTags(), + EntityIds(), + Name() + {} + + DeleteLeaderboardEntriesRequest(const DeleteLeaderboardEntriesRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + EntityIds(src.EntityIds), + Name(src.Name) + {} + + ~DeleteLeaderboardEntriesRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["EntityIds"], EntityIds); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_EntityIds; ToJsonUtilS(EntityIds, each_EntityIds); output["EntityIds"] = each_EntityIds; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct DeleteStatisticDefinitionRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + + DeleteStatisticDefinitionRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name() + {} + + DeleteStatisticDefinitionRequest(const DeleteStatisticDefinitionRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name) + {} + + ~DeleteStatisticDefinitionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct EntityKey : public PlayFabBaseModel + { + std::string Id; + std::string Type; + + EntityKey() : + PlayFabBaseModel(), + Id(), + Type() + {} + + EntityKey(const EntityKey& src) : + PlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + ~EntityKey() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["Id"], Id); + FromJsonUtilS(input["Type"], Type); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Id; ToJsonUtilS(Id, each_Id); output["Id"] = each_Id; + Json::Value each_Type; ToJsonUtilS(Type, each_Type); output["Type"] = each_Type; + return output; + } + }; + + struct StatisticDelete : public PlayFabBaseModel + { + std::string Name; + + StatisticDelete() : + PlayFabBaseModel(), + Name() + {} + + StatisticDelete(const StatisticDelete& src) : + PlayFabBaseModel(), + Name(src.Name) + {} + + ~StatisticDelete() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct DeleteStatisticsRequest : public PlayFabRequestCommon + { + std::map CustomTags; + Boxed Entity; + std::list Statistics; + + DeleteStatisticsRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entity(), + Statistics() + {} + + DeleteStatisticsRequest(const DeleteStatisticsRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entity(src.Entity), + Statistics(src.Statistics) + {} + + ~DeleteStatisticsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilO(input["Statistics"], Statistics); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_Statistics; ToJsonUtilO(Statistics, each_Statistics); output["Statistics"] = each_Statistics; + return output; + } + }; + + struct DeleteStatisticsResponse : public PlayFabResultCommon + { + Boxed Entity; + + DeleteStatisticsResponse() : + PlayFabResultCommon(), + Entity() + {} + + DeleteStatisticsResponse(const DeleteStatisticsResponse& src) : + PlayFabResultCommon(), + Entity(src.Entity) + {} + + ~DeleteStatisticsResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Entity"], Entity); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + return output; + } + }; + + struct EmptyResponse : public PlayFabResultCommon + { + + EmptyResponse() : + PlayFabResultCommon() + {} + + EmptyResponse(const EmptyResponse&) : + PlayFabResultCommon() + {} + + ~EmptyResponse() = default; + + void FromJson(const Json::Value&) override + { + } + + Json::Value ToJson() const override + { + Json::Value output; + return output; + } + }; + + struct EntityLeaderboardEntry : public PlayFabBaseModel + { + std::string DisplayName; + Boxed Entity; + time_t LastUpdated; + std::string Metadata; + Int32 Rank; + std::list Scores; + + EntityLeaderboardEntry() : + PlayFabBaseModel(), + DisplayName(), + Entity(), + LastUpdated(), + Metadata(), + Rank(), + Scores() + {} + + EntityLeaderboardEntry(const EntityLeaderboardEntry& src) : + PlayFabBaseModel(), + DisplayName(src.DisplayName), + Entity(src.Entity), + LastUpdated(src.LastUpdated), + Metadata(src.Metadata), + Rank(src.Rank), + Scores(src.Scores) + {} + + ~EntityLeaderboardEntry() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["DisplayName"], DisplayName); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilT(input["LastUpdated"], LastUpdated); + FromJsonUtilS(input["Metadata"], Metadata); + FromJsonUtilP(input["Rank"], Rank); + FromJsonUtilS(input["Scores"], Scores); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_DisplayName; ToJsonUtilS(DisplayName, each_DisplayName); output["DisplayName"] = each_DisplayName; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_LastUpdated; ToJsonUtilT(LastUpdated, each_LastUpdated); output["LastUpdated"] = each_LastUpdated; + Json::Value each_Metadata; ToJsonUtilS(Metadata, each_Metadata); output["Metadata"] = each_Metadata; + Json::Value each_Rank; ToJsonUtilP(Rank, each_Rank); output["Rank"] = each_Rank; + Json::Value each_Scores; ToJsonUtilS(Scores, each_Scores); output["Scores"] = each_Scores; + return output; + } + }; + + struct EntityStatisticValue : public PlayFabBaseModel + { + std::string Metadata; + std::string Name; + std::list Scores; + Int32 Version; + + EntityStatisticValue() : + PlayFabBaseModel(), + Metadata(), + Name(), + Scores(), + Version() + {} + + EntityStatisticValue(const EntityStatisticValue& src) : + PlayFabBaseModel(), + Metadata(src.Metadata), + Name(src.Name), + Scores(src.Scores), + Version(src.Version) + {} + + ~EntityStatisticValue() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["Metadata"], Metadata); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilS(input["Scores"], Scores); + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Metadata; ToJsonUtilS(Metadata, each_Metadata); output["Metadata"] = each_Metadata; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_Scores; ToJsonUtilS(Scores, each_Scores); output["Scores"] = each_Scores; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct EntityStatistics : public PlayFabBaseModel + { + Boxed pfEntityKey; + std::list Statistics; + + EntityStatistics() : + PlayFabBaseModel(), + pfEntityKey(), + Statistics() + {} + + EntityStatistics(const EntityStatistics& src) : + PlayFabBaseModel(), + pfEntityKey(src.pfEntityKey), + Statistics(src.Statistics) + {} + + ~EntityStatistics() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["EntityKey"], pfEntityKey); + FromJsonUtilO(input["Statistics"], Statistics); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_pfEntityKey; ToJsonUtilO(pfEntityKey, each_pfEntityKey); output["EntityKey"] = each_pfEntityKey; + Json::Value each_Statistics; ToJsonUtilO(Statistics, each_Statistics); output["Statistics"] = each_Statistics; + return output; + } + }; + + struct GetEntityLeaderboardRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string LeaderboardName; + Uint32 PageSize; + Boxed StartingPosition; + Boxed Version; + + GetEntityLeaderboardRequest() : + PlayFabRequestCommon(), + CustomTags(), + LeaderboardName(), + PageSize(), + StartingPosition(), + Version() + {} + + GetEntityLeaderboardRequest(const GetEntityLeaderboardRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + LeaderboardName(src.LeaderboardName), + PageSize(src.PageSize), + StartingPosition(src.StartingPosition), + Version(src.Version) + {} + + ~GetEntityLeaderboardRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["LeaderboardName"], LeaderboardName); + FromJsonUtilP(input["PageSize"], PageSize); + FromJsonUtilP(input["StartingPosition"], StartingPosition); + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_LeaderboardName; ToJsonUtilS(LeaderboardName, each_LeaderboardName); output["LeaderboardName"] = each_LeaderboardName; + Json::Value each_PageSize; ToJsonUtilP(PageSize, each_PageSize); output["PageSize"] = each_PageSize; + Json::Value each_StartingPosition; ToJsonUtilP(StartingPosition, each_StartingPosition); output["StartingPosition"] = each_StartingPosition; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct GetEntityLeaderboardResponse : public PlayFabResultCommon + { + std::list Columns; + std::list Rankings; + Uint32 Version; + + GetEntityLeaderboardResponse() : + PlayFabResultCommon(), + Columns(), + Rankings(), + Version() + {} + + GetEntityLeaderboardResponse(const GetEntityLeaderboardResponse& src) : + PlayFabResultCommon(), + Columns(src.Columns), + Rankings(src.Rankings), + Version(src.Version) + {} + + ~GetEntityLeaderboardResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilO(input["Rankings"], Rankings); + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_Rankings; ToJsonUtilO(Rankings, each_Rankings); output["Rankings"] = each_Rankings; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct GetFriendLeaderboardForEntityRequest : public PlayFabRequestCommon + { + std::map CustomTags; + Boxed Entity; + Boxed pfExternalFriendSources; + std::string LeaderboardName; + Boxed Version; + std::string XboxToken; + + GetFriendLeaderboardForEntityRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entity(), + pfExternalFriendSources(), + LeaderboardName(), + Version(), + XboxToken() + {} + + GetFriendLeaderboardForEntityRequest(const GetFriendLeaderboardForEntityRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entity(src.Entity), + pfExternalFriendSources(src.pfExternalFriendSources), + LeaderboardName(src.LeaderboardName), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + ~GetFriendLeaderboardForEntityRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilE(input["ExternalFriendSources"], pfExternalFriendSources); + FromJsonUtilS(input["LeaderboardName"], LeaderboardName); + FromJsonUtilP(input["Version"], Version); + FromJsonUtilS(input["XboxToken"], XboxToken); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_pfExternalFriendSources; ToJsonUtilE(pfExternalFriendSources, each_pfExternalFriendSources); output["ExternalFriendSources"] = each_pfExternalFriendSources; + Json::Value each_LeaderboardName; ToJsonUtilS(LeaderboardName, each_LeaderboardName); output["LeaderboardName"] = each_LeaderboardName; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + Json::Value each_XboxToken; ToJsonUtilS(XboxToken, each_XboxToken); output["XboxToken"] = each_XboxToken; + return output; + } + }; + + struct GetLeaderboardAroundEntityRequest : public PlayFabRequestCommon + { + std::map CustomTags; + Boxed Entity; + std::string LeaderboardName; + Uint32 MaxSurroundingEntries; + Boxed Version; + + GetLeaderboardAroundEntityRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entity(), + LeaderboardName(), + MaxSurroundingEntries(), + Version() + {} + + GetLeaderboardAroundEntityRequest(const GetLeaderboardAroundEntityRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entity(src.Entity), + LeaderboardName(src.LeaderboardName), + MaxSurroundingEntries(src.MaxSurroundingEntries), + Version(src.Version) + {} + + ~GetLeaderboardAroundEntityRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilS(input["LeaderboardName"], LeaderboardName); + FromJsonUtilP(input["MaxSurroundingEntries"], MaxSurroundingEntries); + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_LeaderboardName; ToJsonUtilS(LeaderboardName, each_LeaderboardName); output["LeaderboardName"] = each_LeaderboardName; + Json::Value each_MaxSurroundingEntries; ToJsonUtilP(MaxSurroundingEntries, each_MaxSurroundingEntries); output["MaxSurroundingEntries"] = each_MaxSurroundingEntries; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct GetLeaderboardDefinitionRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + + GetLeaderboardDefinitionRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name() + {} + + GetLeaderboardDefinitionRequest(const GetLeaderboardDefinitionRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name) + {} + + ~GetLeaderboardDefinitionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct GetLeaderboardDefinitionResponse : public PlayFabResultCommon + { + std::list Columns; + time_t Created; + std::string EntityType; + Boxed LastResetTime; + std::string Name; + Int32 SizeLimit; + Uint32 Version; + VersionConfiguration pfVersionConfiguration; + + GetLeaderboardDefinitionResponse() : + PlayFabResultCommon(), + Columns(), + Created(), + EntityType(), + LastResetTime(), + Name(), + SizeLimit(), + Version(), + pfVersionConfiguration() + {} + + GetLeaderboardDefinitionResponse(const GetLeaderboardDefinitionResponse& src) : + PlayFabResultCommon(), + Columns(src.Columns), + Created(src.Created), + EntityType(src.EntityType), + LastResetTime(src.LastResetTime), + Name(src.Name), + SizeLimit(src.SizeLimit), + Version(src.Version), + pfVersionConfiguration(src.pfVersionConfiguration) + {} + + ~GetLeaderboardDefinitionResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilT(input["Created"], Created); + FromJsonUtilS(input["EntityType"], EntityType); + FromJsonUtilT(input["LastResetTime"], LastResetTime); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilP(input["SizeLimit"], SizeLimit); + FromJsonUtilP(input["Version"], Version); + FromJsonUtilO(input["VersionConfiguration"], pfVersionConfiguration); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_Created; ToJsonUtilT(Created, each_Created); output["Created"] = each_Created; + Json::Value each_EntityType; ToJsonUtilS(EntityType, each_EntityType); output["EntityType"] = each_EntityType; + Json::Value each_LastResetTime; ToJsonUtilT(LastResetTime, each_LastResetTime); output["LastResetTime"] = each_LastResetTime; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_SizeLimit; ToJsonUtilP(SizeLimit, each_SizeLimit); output["SizeLimit"] = each_SizeLimit; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + Json::Value each_pfVersionConfiguration; ToJsonUtilO(pfVersionConfiguration, each_pfVersionConfiguration); output["VersionConfiguration"] = each_pfVersionConfiguration; + return output; + } + }; + + struct GetLeaderboardForEntitiesRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::list EntityIds; + std::string LeaderboardName; + Boxed Version; + + GetLeaderboardForEntitiesRequest() : + PlayFabRequestCommon(), + CustomTags(), + EntityIds(), + LeaderboardName(), + Version() + {} + + GetLeaderboardForEntitiesRequest(const GetLeaderboardForEntitiesRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + EntityIds(src.EntityIds), + LeaderboardName(src.LeaderboardName), + Version(src.Version) + {} + + ~GetLeaderboardForEntitiesRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["EntityIds"], EntityIds); + FromJsonUtilS(input["LeaderboardName"], LeaderboardName); + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_EntityIds; ToJsonUtilS(EntityIds, each_EntityIds); output["EntityIds"] = each_EntityIds; + Json::Value each_LeaderboardName; ToJsonUtilS(LeaderboardName, each_LeaderboardName); output["LeaderboardName"] = each_LeaderboardName; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct GetStatisticDefinitionRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + + GetStatisticDefinitionRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name() + {} + + GetStatisticDefinitionRequest(const GetStatisticDefinitionRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name) + {} + + ~GetStatisticDefinitionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct GetStatisticDefinitionResponse : public PlayFabResultCommon + { + std::list Columns; + time_t Created; + std::string EntityType; + Boxed LastResetTime; + std::list LinkedLeaderboardNames; + std::string Name; + Uint32 Version; + Boxed pfVersionConfiguration; + + GetStatisticDefinitionResponse() : + PlayFabResultCommon(), + Columns(), + Created(), + EntityType(), + LastResetTime(), + LinkedLeaderboardNames(), + Name(), + Version(), + pfVersionConfiguration() + {} + + GetStatisticDefinitionResponse(const GetStatisticDefinitionResponse& src) : + PlayFabResultCommon(), + Columns(src.Columns), + Created(src.Created), + EntityType(src.EntityType), + LastResetTime(src.LastResetTime), + LinkedLeaderboardNames(src.LinkedLeaderboardNames), + Name(src.Name), + Version(src.Version), + pfVersionConfiguration(src.pfVersionConfiguration) + {} + + ~GetStatisticDefinitionResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilT(input["Created"], Created); + FromJsonUtilS(input["EntityType"], EntityType); + FromJsonUtilT(input["LastResetTime"], LastResetTime); + FromJsonUtilS(input["LinkedLeaderboardNames"], LinkedLeaderboardNames); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilP(input["Version"], Version); + FromJsonUtilO(input["VersionConfiguration"], pfVersionConfiguration); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_Created; ToJsonUtilT(Created, each_Created); output["Created"] = each_Created; + Json::Value each_EntityType; ToJsonUtilS(EntityType, each_EntityType); output["EntityType"] = each_EntityType; + Json::Value each_LastResetTime; ToJsonUtilT(LastResetTime, each_LastResetTime); output["LastResetTime"] = each_LastResetTime; + Json::Value each_LinkedLeaderboardNames; ToJsonUtilS(LinkedLeaderboardNames, each_LinkedLeaderboardNames); output["LinkedLeaderboardNames"] = each_LinkedLeaderboardNames; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + Json::Value each_pfVersionConfiguration; ToJsonUtilO(pfVersionConfiguration, each_pfVersionConfiguration); output["VersionConfiguration"] = each_pfVersionConfiguration; + return output; + } + }; + + struct GetStatisticDefinitionsRequest : public PlayFabRequestCommon + { + std::map CustomTags; + + GetStatisticDefinitionsRequest() : + PlayFabRequestCommon(), + CustomTags() + {} + + GetStatisticDefinitionsRequest(const GetStatisticDefinitionsRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags) + {} + + ~GetStatisticDefinitionsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + return output; + } + }; + + struct StatisticDefinition : public PlayFabBaseModel + { + std::list Columns; + time_t Created; + std::string EntityType; + Boxed LastResetTime; + std::list LinkedLeaderboardNames; + std::string Name; + Uint32 Version; + Boxed pfVersionConfiguration; + + StatisticDefinition() : + PlayFabBaseModel(), + Columns(), + Created(), + EntityType(), + LastResetTime(), + LinkedLeaderboardNames(), + Name(), + Version(), + pfVersionConfiguration() + {} + + StatisticDefinition(const StatisticDefinition& src) : + PlayFabBaseModel(), + Columns(src.Columns), + Created(src.Created), + EntityType(src.EntityType), + LastResetTime(src.LastResetTime), + LinkedLeaderboardNames(src.LinkedLeaderboardNames), + Name(src.Name), + Version(src.Version), + pfVersionConfiguration(src.pfVersionConfiguration) + {} + + ~StatisticDefinition() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilT(input["Created"], Created); + FromJsonUtilS(input["EntityType"], EntityType); + FromJsonUtilT(input["LastResetTime"], LastResetTime); + FromJsonUtilS(input["LinkedLeaderboardNames"], LinkedLeaderboardNames); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilP(input["Version"], Version); + FromJsonUtilO(input["VersionConfiguration"], pfVersionConfiguration); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_Created; ToJsonUtilT(Created, each_Created); output["Created"] = each_Created; + Json::Value each_EntityType; ToJsonUtilS(EntityType, each_EntityType); output["EntityType"] = each_EntityType; + Json::Value each_LastResetTime; ToJsonUtilT(LastResetTime, each_LastResetTime); output["LastResetTime"] = each_LastResetTime; + Json::Value each_LinkedLeaderboardNames; ToJsonUtilS(LinkedLeaderboardNames, each_LinkedLeaderboardNames); output["LinkedLeaderboardNames"] = each_LinkedLeaderboardNames; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + Json::Value each_pfVersionConfiguration; ToJsonUtilO(pfVersionConfiguration, each_pfVersionConfiguration); output["VersionConfiguration"] = each_pfVersionConfiguration; + return output; + } + }; + + struct GetStatisticDefinitionsResponse : public PlayFabResultCommon + { + std::list StatisticDefinitions; + + GetStatisticDefinitionsResponse() : + PlayFabResultCommon(), + StatisticDefinitions() + {} + + GetStatisticDefinitionsResponse(const GetStatisticDefinitionsResponse& src) : + PlayFabResultCommon(), + StatisticDefinitions(src.StatisticDefinitions) + {} + + ~GetStatisticDefinitionsResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["StatisticDefinitions"], StatisticDefinitions); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_StatisticDefinitions; ToJsonUtilO(StatisticDefinitions, each_StatisticDefinitions); output["StatisticDefinitions"] = each_StatisticDefinitions; + return output; + } + }; + + struct GetStatisticsForEntitiesRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::list Entities; + + GetStatisticsForEntitiesRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entities() + {} + + GetStatisticsForEntitiesRequest(const GetStatisticsForEntitiesRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entities(src.Entities) + {} + + ~GetStatisticsForEntitiesRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entities"], Entities); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entities; ToJsonUtilO(Entities, each_Entities); output["Entities"] = each_Entities; + return output; + } + }; + + struct StatisticColumnCollection : public PlayFabBaseModel + { + std::list Columns; + + StatisticColumnCollection() : + PlayFabBaseModel(), + Columns() + {} + + StatisticColumnCollection(const StatisticColumnCollection& src) : + PlayFabBaseModel(), + Columns(src.Columns) + {} + + ~StatisticColumnCollection() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + return output; + } + }; + + struct GetStatisticsForEntitiesResponse : public PlayFabResultCommon + { + std::map ColumnDetails; + std::list EntitiesStatistics; + + GetStatisticsForEntitiesResponse() : + PlayFabResultCommon(), + ColumnDetails(), + EntitiesStatistics() + {} + + GetStatisticsForEntitiesResponse(const GetStatisticsForEntitiesResponse& src) : + PlayFabResultCommon(), + ColumnDetails(src.ColumnDetails), + EntitiesStatistics(src.EntitiesStatistics) + {} + + ~GetStatisticsForEntitiesResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["ColumnDetails"], ColumnDetails); + FromJsonUtilO(input["EntitiesStatistics"], EntitiesStatistics); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_ColumnDetails; ToJsonUtilO(ColumnDetails, each_ColumnDetails); output["ColumnDetails"] = each_ColumnDetails; + Json::Value each_EntitiesStatistics; ToJsonUtilO(EntitiesStatistics, each_EntitiesStatistics); output["EntitiesStatistics"] = each_EntitiesStatistics; + return output; + } + }; + + struct GetStatisticsRequest : public PlayFabRequestCommon + { + std::map CustomTags; + Boxed Entity; + + GetStatisticsRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entity() + {} + + GetStatisticsRequest(const GetStatisticsRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entity(src.Entity) + {} + + ~GetStatisticsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entity"], Entity); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + return output; + } + }; + + struct GetStatisticsResponse : public PlayFabResultCommon + { + std::map ColumnDetails; + Boxed Entity; + std::map Statistics; + + GetStatisticsResponse() : + PlayFabResultCommon(), + ColumnDetails(), + Entity(), + Statistics() + {} + + GetStatisticsResponse(const GetStatisticsResponse& src) : + PlayFabResultCommon(), + ColumnDetails(src.ColumnDetails), + Entity(src.Entity), + Statistics(src.Statistics) + {} + + ~GetStatisticsResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["ColumnDetails"], ColumnDetails); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilO(input["Statistics"], Statistics); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_ColumnDetails; ToJsonUtilO(ColumnDetails, each_ColumnDetails); output["ColumnDetails"] = each_ColumnDetails; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_Statistics; ToJsonUtilO(Statistics, each_Statistics); output["Statistics"] = each_Statistics; + return output; + } + }; + + struct IncrementLeaderboardVersionRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + + IncrementLeaderboardVersionRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name() + {} + + IncrementLeaderboardVersionRequest(const IncrementLeaderboardVersionRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name) + {} + + ~IncrementLeaderboardVersionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct IncrementLeaderboardVersionResponse : public PlayFabResultCommon + { + Uint32 Version; + + IncrementLeaderboardVersionResponse() : + PlayFabResultCommon(), + Version() + {} + + IncrementLeaderboardVersionResponse(const IncrementLeaderboardVersionResponse& src) : + PlayFabResultCommon(), + Version(src.Version) + {} + + ~IncrementLeaderboardVersionResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct IncrementStatisticVersionRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + + IncrementStatisticVersionRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name() + {} + + IncrementStatisticVersionRequest(const IncrementStatisticVersionRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name) + {} + + ~IncrementStatisticVersionRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + return output; + } + }; + + struct IncrementStatisticVersionResponse : public PlayFabResultCommon + { + Uint32 Version; + + IncrementStatisticVersionResponse() : + PlayFabResultCommon(), + Version() + {} + + IncrementStatisticVersionResponse(const IncrementStatisticVersionResponse& src) : + PlayFabResultCommon(), + Version(src.Version) + {} + + ~IncrementStatisticVersionResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct LeaderboardDefinition : public PlayFabBaseModel + { + std::list Columns; + time_t Created; + std::string EntityType; + Boxed LastResetTime; + std::string Name; + Int32 SizeLimit; + Uint32 Version; + VersionConfiguration pfVersionConfiguration; + + LeaderboardDefinition() : + PlayFabBaseModel(), + Columns(), + Created(), + EntityType(), + LastResetTime(), + Name(), + SizeLimit(), + Version(), + pfVersionConfiguration() + {} + + LeaderboardDefinition(const LeaderboardDefinition& src) : + PlayFabBaseModel(), + Columns(src.Columns), + Created(src.Created), + EntityType(src.EntityType), + LastResetTime(src.LastResetTime), + Name(src.Name), + SizeLimit(src.SizeLimit), + Version(src.Version), + pfVersionConfiguration(src.pfVersionConfiguration) + {} + + ~LeaderboardDefinition() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Columns"], Columns); + FromJsonUtilT(input["Created"], Created); + FromJsonUtilS(input["EntityType"], EntityType); + FromJsonUtilT(input["LastResetTime"], LastResetTime); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilP(input["SizeLimit"], SizeLimit); + FromJsonUtilP(input["Version"], Version); + FromJsonUtilO(input["VersionConfiguration"], pfVersionConfiguration); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Columns; ToJsonUtilO(Columns, each_Columns); output["Columns"] = each_Columns; + Json::Value each_Created; ToJsonUtilT(Created, each_Created); output["Created"] = each_Created; + Json::Value each_EntityType; ToJsonUtilS(EntityType, each_EntityType); output["EntityType"] = each_EntityType; + Json::Value each_LastResetTime; ToJsonUtilT(LastResetTime, each_LastResetTime); output["LastResetTime"] = each_LastResetTime; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_SizeLimit; ToJsonUtilP(SizeLimit, each_SizeLimit); output["SizeLimit"] = each_SizeLimit; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + Json::Value each_pfVersionConfiguration; ToJsonUtilO(pfVersionConfiguration, each_pfVersionConfiguration); output["VersionConfiguration"] = each_pfVersionConfiguration; + return output; + } + }; + + struct LeaderboardEntryUpdate : public PlayFabBaseModel + { + std::string EntityId; + std::string Metadata; + std::list Scores; + + LeaderboardEntryUpdate() : + PlayFabBaseModel(), + EntityId(), + Metadata(), + Scores() + {} + + LeaderboardEntryUpdate(const LeaderboardEntryUpdate& src) : + PlayFabBaseModel(), + EntityId(src.EntityId), + Metadata(src.Metadata), + Scores(src.Scores) + {} + + ~LeaderboardEntryUpdate() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["EntityId"], EntityId); + FromJsonUtilS(input["Metadata"], Metadata); + FromJsonUtilS(input["Scores"], Scores); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_EntityId; ToJsonUtilS(EntityId, each_EntityId); output["EntityId"] = each_EntityId; + Json::Value each_Metadata; ToJsonUtilS(Metadata, each_Metadata); output["Metadata"] = each_Metadata; + Json::Value each_Scores; ToJsonUtilS(Scores, each_Scores); output["Scores"] = each_Scores; + return output; + } + }; + + struct ListLeaderboardDefinitionsRequest : public PlayFabRequestCommon + { + std::map CustomTags; + + ListLeaderboardDefinitionsRequest() : + PlayFabRequestCommon(), + CustomTags() + {} + + ListLeaderboardDefinitionsRequest(const ListLeaderboardDefinitionsRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags) + {} + + ~ListLeaderboardDefinitionsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + return output; + } + }; + + struct ListLeaderboardDefinitionsResponse : public PlayFabResultCommon + { + std::list LeaderboardDefinitions; + + ListLeaderboardDefinitionsResponse() : + PlayFabResultCommon(), + LeaderboardDefinitions() + {} + + ListLeaderboardDefinitionsResponse(const ListLeaderboardDefinitionsResponse& src) : + PlayFabResultCommon(), + LeaderboardDefinitions(src.LeaderboardDefinitions) + {} + + ~ListLeaderboardDefinitionsResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["LeaderboardDefinitions"], LeaderboardDefinitions); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_LeaderboardDefinitions; ToJsonUtilO(LeaderboardDefinitions, each_LeaderboardDefinitions); output["LeaderboardDefinitions"] = each_LeaderboardDefinitions; + return output; + } + }; + + struct ListStatisticDefinitionsRequest : public PlayFabRequestCommon + { + std::map CustomTags; + + ListStatisticDefinitionsRequest() : + PlayFabRequestCommon(), + CustomTags() + {} + + ListStatisticDefinitionsRequest(const ListStatisticDefinitionsRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags) + {} + + ~ListStatisticDefinitionsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + return output; + } + }; + + struct ListStatisticDefinitionsResponse : public PlayFabResultCommon + { + std::map CustomTags; + std::list StatisticDefinitions; + + ListStatisticDefinitionsResponse() : + PlayFabResultCommon(), + CustomTags(), + StatisticDefinitions() + {} + + ListStatisticDefinitionsResponse(const ListStatisticDefinitionsResponse& src) : + PlayFabResultCommon(), + CustomTags(src.CustomTags), + StatisticDefinitions(src.StatisticDefinitions) + {} + + ~ListStatisticDefinitionsResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["StatisticDefinitions"], StatisticDefinitions); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_StatisticDefinitions; ToJsonUtilO(StatisticDefinitions, each_StatisticDefinitions); output["StatisticDefinitions"] = each_StatisticDefinitions; + return output; + } + }; + + struct StatisticUpdate : public PlayFabBaseModel + { + std::string Metadata; + std::string Name; + std::list Scores; + Boxed Version; + + StatisticUpdate() : + PlayFabBaseModel(), + Metadata(), + Name(), + Scores(), + Version() + {} + + StatisticUpdate(const StatisticUpdate& src) : + PlayFabBaseModel(), + Metadata(src.Metadata), + Name(src.Name), + Scores(src.Scores), + Version(src.Version) + {} + + ~StatisticUpdate() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["Metadata"], Metadata); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilS(input["Scores"], Scores); + FromJsonUtilP(input["Version"], Version); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Metadata; ToJsonUtilS(Metadata, each_Metadata); output["Metadata"] = each_Metadata; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_Scores; ToJsonUtilS(Scores, each_Scores); output["Scores"] = each_Scores; + Json::Value each_Version; ToJsonUtilP(Version, each_Version); output["Version"] = each_Version; + return output; + } + }; + + struct UnlinkLeaderboardFromStatisticRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::string Name; + std::string StatisticName; + + UnlinkLeaderboardFromStatisticRequest() : + PlayFabRequestCommon(), + CustomTags(), + Name(), + StatisticName() + {} + + UnlinkLeaderboardFromStatisticRequest(const UnlinkLeaderboardFromStatisticRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Name(src.Name), + StatisticName(src.StatisticName) + {} + + ~UnlinkLeaderboardFromStatisticRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilS(input["Name"], Name); + FromJsonUtilS(input["StatisticName"], StatisticName); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Name; ToJsonUtilS(Name, each_Name); output["Name"] = each_Name; + Json::Value each_StatisticName; ToJsonUtilS(StatisticName, each_StatisticName); output["StatisticName"] = each_StatisticName; + return output; + } + }; + + struct UpdateLeaderboardEntriesRequest : public PlayFabRequestCommon + { + std::map CustomTags; + std::list Entries; + std::string LeaderboardName; + + UpdateLeaderboardEntriesRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entries(), + LeaderboardName() + {} + + UpdateLeaderboardEntriesRequest(const UpdateLeaderboardEntriesRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entries(src.Entries), + LeaderboardName(src.LeaderboardName) + {} + + ~UpdateLeaderboardEntriesRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entries"], Entries); + FromJsonUtilS(input["LeaderboardName"], LeaderboardName); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entries; ToJsonUtilO(Entries, each_Entries); output["Entries"] = each_Entries; + Json::Value each_LeaderboardName; ToJsonUtilS(LeaderboardName, each_LeaderboardName); output["LeaderboardName"] = each_LeaderboardName; + return output; + } + }; + + struct UpdateStatisticsRequest : public PlayFabRequestCommon + { + std::map CustomTags; + Boxed Entity; + std::list Statistics; + + UpdateStatisticsRequest() : + PlayFabRequestCommon(), + CustomTags(), + Entity(), + Statistics() + {} + + UpdateStatisticsRequest(const UpdateStatisticsRequest& src) : + PlayFabRequestCommon(), + CustomTags(src.CustomTags), + Entity(src.Entity), + Statistics(src.Statistics) + {} + + ~UpdateStatisticsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CustomTags"], CustomTags); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilO(input["Statistics"], Statistics); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CustomTags; ToJsonUtilS(CustomTags, each_CustomTags); output["CustomTags"] = each_CustomTags; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_Statistics; ToJsonUtilO(Statistics, each_Statistics); output["Statistics"] = each_Statistics; + return output; + } + }; + + struct UpdateStatisticsResponse : public PlayFabResultCommon + { + std::map ColumnDetails; + Boxed Entity; + std::map Statistics; + + UpdateStatisticsResponse() : + PlayFabResultCommon(), + ColumnDetails(), + Entity(), + Statistics() + {} + + UpdateStatisticsResponse(const UpdateStatisticsResponse& src) : + PlayFabResultCommon(), + ColumnDetails(src.ColumnDetails), + Entity(src.Entity), + Statistics(src.Statistics) + {} + + ~UpdateStatisticsResponse() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["ColumnDetails"], ColumnDetails); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilO(input["Statistics"], Statistics); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_ColumnDetails; ToJsonUtilO(ColumnDetails, each_ColumnDetails); output["ColumnDetails"] = each_ColumnDetails; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_Statistics; ToJsonUtilO(Statistics, each_Statistics); output["Statistics"] = each_Statistics; + return output; + } + }; + + } +} + +#endif diff --git a/code/include/playfab/PlayFabLeaderboardsInstanceApi.h b/code/include/playfab/PlayFabLeaderboardsInstanceApi.h new file mode 100644 index 00000000..477330d2 --- /dev/null +++ b/code/include/playfab/PlayFabLeaderboardsInstanceApi.h @@ -0,0 +1,99 @@ +#pragma once + +#if !defined(DISABLE_PLAYFABENTITY_API) + +#include +#include + +namespace PlayFab +{ + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + + /// + /// Main interface for PlayFab Sdk, specifically all Leaderboards APIs + /// + class PlayFabLeaderboardsInstanceAPI + { + private: + std::shared_ptr m_settings; + std::shared_ptr m_context; + + public: + PlayFabLeaderboardsInstanceAPI(const std::shared_ptr& authenticationContext); + PlayFabLeaderboardsInstanceAPI(const std::shared_ptr& apiSettings, const std::shared_ptr& authenticationContext); + + ~PlayFabLeaderboardsInstanceAPI() = default; + PlayFabLeaderboardsInstanceAPI(const PlayFabLeaderboardsInstanceAPI& source) = delete; // disable copy + PlayFabLeaderboardsInstanceAPI(PlayFabLeaderboardsInstanceAPI&&) = delete; // disable move + PlayFabLeaderboardsInstanceAPI& operator=(const PlayFabLeaderboardsInstanceAPI& source) = delete; // disable assignment + PlayFabLeaderboardsInstanceAPI& operator=(PlayFabLeaderboardsInstanceAPI&& other) = delete; // disable move assignment + + std::shared_ptr GetSettings() const; + std::shared_ptr GetAuthenticationContext() const; + /// + /// Calls the Update function on your implementation of the IHttpPlugin to check for responses to HTTP requests. + /// All api's (Client, Server, Admin etc.) share the same IHttpPlugin. + /// This means that you only need to call Update() on one API to retrieve the responses for all APIs. + /// Additional calls to Update (on any API) during the same tick are unlikely to retrieve additional responses. + /// Call Update when your game ticks as follows: + /// Leaderboards.Update(); + /// + size_t Update(); + void ForgetAllCredentials(); + + // ------------ Generated API calls + void CreateLeaderboardDefinition(LeaderboardsModels::CreateLeaderboardDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void CreateStatisticDefinition(LeaderboardsModels::CreateStatisticDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void DeleteLeaderboardDefinition(LeaderboardsModels::DeleteLeaderboardDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void DeleteLeaderboardEntries(LeaderboardsModels::DeleteLeaderboardEntriesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void DeleteStatisticDefinition(LeaderboardsModels::DeleteStatisticDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void DeleteStatistics(LeaderboardsModels::DeleteStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetFriendLeaderboardForEntity(LeaderboardsModels::GetFriendLeaderboardForEntityRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetLeaderboard(LeaderboardsModels::GetEntityLeaderboardRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetLeaderboardAroundEntity(LeaderboardsModels::GetLeaderboardAroundEntityRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetLeaderboardDefinition(LeaderboardsModels::GetLeaderboardDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetLeaderboardForEntities(LeaderboardsModels::GetLeaderboardForEntitiesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetStatisticDefinition(LeaderboardsModels::GetStatisticDefinitionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetStatisticDefinitions(LeaderboardsModels::GetStatisticDefinitionsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetStatistics(LeaderboardsModels::GetStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetStatisticsForEntities(LeaderboardsModels::GetStatisticsForEntitiesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void IncrementLeaderboardVersion(LeaderboardsModels::IncrementLeaderboardVersionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void IncrementStatisticVersion(LeaderboardsModels::IncrementStatisticVersionRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void ListLeaderboardDefinitions(LeaderboardsModels::ListLeaderboardDefinitionsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void ListStatisticDefinitions(LeaderboardsModels::ListStatisticDefinitionsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void UnlinkLeaderboardFromStatistic(LeaderboardsModels::UnlinkLeaderboardFromStatisticRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void UpdateLeaderboardEntries(LeaderboardsModels::UpdateLeaderboardEntriesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void UpdateStatistics(LeaderboardsModels::UpdateStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + + // ------------ Generated result handlers + void OnCreateLeaderboardDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnCreateStatisticDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnDeleteLeaderboardDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnDeleteLeaderboardEntriesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnDeleteStatisticDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnDeleteStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetFriendLeaderboardForEntityResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetLeaderboardResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetLeaderboardAroundEntityResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetLeaderboardDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetLeaderboardForEntitiesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetStatisticDefinitionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetStatisticDefinitionsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetStatisticsForEntitiesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnIncrementLeaderboardVersionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnIncrementStatisticVersionResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnListLeaderboardDefinitionsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnListStatisticDefinitionsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnUnlinkLeaderboardFromStatisticResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnUpdateLeaderboardEntriesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnUpdateStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + + bool ValidateResult(PlayFabResultCommon& resultCommon, const CallRequestContainer& container); + }; +} + +#endif diff --git a/code/include/playfab/PlayFabMultiplayerDataModels.h b/code/include/playfab/PlayFabMultiplayerDataModels.h index dac7556c..5fe9c145 100644 --- a/code/include/playfab/PlayFabMultiplayerDataModels.h +++ b/code/include/playfab/PlayFabMultiplayerDataModels.h @@ -1589,7 +1589,8 @@ namespace PlayFab DirectPeerConnectivityOptionsSameEntityLoginProvider, DirectPeerConnectivityOptionsDifferentEntityLoginProvider, DirectPeerConnectivityOptionsAnyEntityLoginProvider, - DirectPeerConnectivityOptionsAnyPlatformTypeAndEntityLoginProvider + DirectPeerConnectivityOptionsAnyPlatformTypeAndEntityLoginProvider, + DirectPeerConnectivityOptionsOnlyServers }; inline void ToJsonEnum(const DirectPeerConnectivityOptions input, Json::Value& output) @@ -1634,6 +1635,11 @@ namespace PlayFab output = Json::Value("AnyPlatformTypeAndEntityLoginProvider"); return; } + if (input == DirectPeerConnectivityOptions::DirectPeerConnectivityOptionsOnlyServers) + { + output = Json::Value("OnlyServers"); + return; + } } inline void FromJsonEnum(const Json::Value& input, DirectPeerConnectivityOptions& output) { @@ -1682,6 +1688,11 @@ namespace PlayFab output = DirectPeerConnectivityOptions::DirectPeerConnectivityOptionsAnyPlatformTypeAndEntityLoginProvider; return; } + if (inputStr == "OnlyServers") + { + output = DirectPeerConnectivityOptions::DirectPeerConnectivityOptionsOnlyServers; + return; + } } enum class ExternalFriendSources @@ -4982,13 +4993,15 @@ namespace PlayFab std::string IPV4Address; std::list Ports; std::string Region; + std::string ServerId; ServerDetails() : PlayFabBaseModel(), Fqdn(), IPV4Address(), Ports(), - Region() + Region(), + ServerId() {} ServerDetails(const ServerDetails& src) : @@ -4996,7 +5009,8 @@ namespace PlayFab Fqdn(src.Fqdn), IPV4Address(src.IPV4Address), Ports(src.Ports), - Region(src.Region) + Region(src.Region), + ServerId(src.ServerId) {} ~ServerDetails() = default; @@ -5007,6 +5021,7 @@ namespace PlayFab FromJsonUtilS(input["IPV4Address"], IPV4Address); FromJsonUtilO(input["Ports"], Ports); FromJsonUtilS(input["Region"], Region); + FromJsonUtilS(input["ServerId"], ServerId); } Json::Value ToJson() const override @@ -5016,6 +5031,7 @@ namespace PlayFab Json::Value each_IPV4Address; ToJsonUtilS(IPV4Address, each_IPV4Address); output["IPV4Address"] = each_IPV4Address; Json::Value each_Ports; ToJsonUtilO(Ports, each_Ports); output["Ports"] = each_Ports; Json::Value each_Region; ToJsonUtilS(Region, each_Region); output["Region"] = each_Region; + Json::Value each_ServerId; ToJsonUtilS(ServerId, each_ServerId); output["ServerId"] = each_ServerId; return output; } }; diff --git a/code/include/playfab/PlayFabServerDataModels.h b/code/include/playfab/PlayFabServerDataModels.h index 4d153b66..2eef7153 100644 --- a/code/include/playfab/PlayFabServerDataModels.h +++ b/code/include/playfab/PlayFabServerDataModels.h @@ -5487,6 +5487,20 @@ namespace PlayFab GenericErrorCodesStatisticDefinitionModificationNotAllowedWhileLinked, GenericErrorCodesLeaderboardUpdateNotAllowedWhileLinked, GenericErrorCodesCloudScriptAzureFunctionsEventHubRequestError, + GenericErrorCodesExternalEntityNotAllowedForTier, + GenericErrorCodesInvalidBaseTimeForInterval, + GenericErrorCodesEntityTypeMismatchWithStatDefinition, + GenericErrorCodesSpecifiedVersionLeaderboardNotFound, + GenericErrorCodesLeaderboardColumnLengthMismatchWithStatDefinition, + GenericErrorCodesDuplicateColumnNameFound, + GenericErrorCodesLinkedStatisticColumnNotFound, + GenericErrorCodesLinkedStatisticColumnRequired, + GenericErrorCodesMultipleLinkedStatisticsNotAllowed, + GenericErrorCodesDuplicateLinkedStatisticColumnNameFound, + GenericErrorCodesAggregationTypeNotAllowedForMultiColumnStatistic, + GenericErrorCodesMaxQueryableVerionsValueNotAllowedForTier, + GenericErrorCodesStatisticDefinitionHasNullOrEmptyVersionConfiguration, + GenericErrorCodesStatisticColumnLengthMismatch, GenericErrorCodesMatchmakingEntityInvalid, GenericErrorCodesMatchmakingPlayerAttributesInvalid, GenericErrorCodesMatchmakingQueueNotFound, @@ -5664,6 +5678,7 @@ namespace PlayFab GenericErrorCodesEventSinkTitleUnauthorized, GenericErrorCodesEventSinkInsufficientRoleAssignment, GenericErrorCodesEventSinkContainerNotFound, + GenericErrorCodesEventSinkTenantIdInvalid, GenericErrorCodesOperationCanceled, GenericErrorCodesInvalidDisplayNameRandomSuffixLength, GenericErrorCodesAllowNonUniquePlayerDisplayNamesDisableNotAllowed, @@ -5733,9 +5748,36 @@ namespace PlayFab GenericErrorCodesTrueSkillJobAlreadyExists, GenericErrorCodesTrueSkillJobNotFound, GenericErrorCodesTrueSkillOperationCanceled, - GenericErrorCodesStateShareUnauthorized, + GenericErrorCodesTrueSkillActiveModelLimitExceeded, + GenericErrorCodesTrueSkillTotalModelLimitExceeded, + GenericErrorCodesTrueSkillUnknownInitialModelId, + GenericErrorCodesTrueSkillUnauthorizedForJob, + GenericErrorCodesTrueSkillInvalidScenarioName, + GenericErrorCodesTrueSkillConditionStateIsRequired, + GenericErrorCodesTrueSkillEventStateIsRequired, + GenericErrorCodesTrueSkillDuplicateEvent, + GenericErrorCodesTrueSkillDuplicateCondition, + GenericErrorCodesTrueSkillInvalidAnomalyThreshold, + GenericErrorCodesTrueSkillConditionKeyLimitExceeded, + GenericErrorCodesTrueSkillConditionValuePerKeyLimitExceeded, + GenericErrorCodesTrueSkillInvalidTimestamp, + GenericErrorCodesTrueSkillEventLimitExceeded, + GenericErrorCodesTrueSkillInvalidPlayers, + GenericErrorCodesTrueSkillTrueSkillPlayerNull, + GenericErrorCodesTrueSkillInvalidPlayerId, + GenericErrorCodesTrueSkillInvalidSquadSize, + GenericErrorCodesTrueSkillConditionSetNotInModel, + GenericErrorCodesGameSaveManifestNotFound, + GenericErrorCodesGameSaveManifestVersionAlreadyExists, + GenericErrorCodesGameSaveConflictUpdatingManifest, + GenericErrorCodesStateShareForbidden, + GenericErrorCodesStateShareTitleNotInFlight, GenericErrorCodesStateShareStateNotFound, - GenericErrorCodesStateShareLinkNotFound + GenericErrorCodesStateShareLinkNotFound, + GenericErrorCodesStateShareStateRedemptionLimitExceeded, + GenericErrorCodesStateShareStateRedemptionLimitNotUpdated, + GenericErrorCodesStateShareCreatedStatesLimitExceeded, + GenericErrorCodesStateShareIdMissingOrMalformed }; inline void ToJsonEnum(const GenericErrorCodes input, Json::Value& output) @@ -8575,6 +8617,76 @@ namespace PlayFab output = Json::Value("CloudScriptAzureFunctionsEventHubRequestError"); return; } + if (input == GenericErrorCodes::GenericErrorCodesExternalEntityNotAllowedForTier) + { + output = Json::Value("ExternalEntityNotAllowedForTier"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesInvalidBaseTimeForInterval) + { + output = Json::Value("InvalidBaseTimeForInterval"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesEntityTypeMismatchWithStatDefinition) + { + output = Json::Value("EntityTypeMismatchWithStatDefinition"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesSpecifiedVersionLeaderboardNotFound) + { + output = Json::Value("SpecifiedVersionLeaderboardNotFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesLeaderboardColumnLengthMismatchWithStatDefinition) + { + output = Json::Value("LeaderboardColumnLengthMismatchWithStatDefinition"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesDuplicateColumnNameFound) + { + output = Json::Value("DuplicateColumnNameFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnNotFound) + { + output = Json::Value("LinkedStatisticColumnNotFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnRequired) + { + output = Json::Value("LinkedStatisticColumnRequired"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesMultipleLinkedStatisticsNotAllowed) + { + output = Json::Value("MultipleLinkedStatisticsNotAllowed"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesDuplicateLinkedStatisticColumnNameFound) + { + output = Json::Value("DuplicateLinkedStatisticColumnNameFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesAggregationTypeNotAllowedForMultiColumnStatistic) + { + output = Json::Value("AggregationTypeNotAllowedForMultiColumnStatistic"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesMaxQueryableVerionsValueNotAllowedForTier) + { + output = Json::Value("MaxQueryableVerionsValueNotAllowedForTier"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStatisticDefinitionHasNullOrEmptyVersionConfiguration) + { + output = Json::Value("StatisticDefinitionHasNullOrEmptyVersionConfiguration"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStatisticColumnLengthMismatch) + { + output = Json::Value("StatisticColumnLengthMismatch"); + return; + } if (input == GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid) { output = Json::Value("MatchmakingEntityInvalid"); @@ -9460,6 +9572,11 @@ namespace PlayFab output = Json::Value("EventSinkContainerNotFound"); return; } + if (input == GenericErrorCodes::GenericErrorCodesEventSinkTenantIdInvalid) + { + output = Json::Value("EventSinkTenantIdInvalid"); + return; + } if (input == GenericErrorCodes::GenericErrorCodesOperationCanceled) { output = Json::Value("OperationCanceled"); @@ -9805,9 +9922,124 @@ namespace PlayFab output = Json::Value("TrueSkillOperationCanceled"); return; } - if (input == GenericErrorCodes::GenericErrorCodesStateShareUnauthorized) + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillActiveModelLimitExceeded) + { + output = Json::Value("TrueSkillActiveModelLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillTotalModelLimitExceeded) + { + output = Json::Value("TrueSkillTotalModelLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillUnknownInitialModelId) + { + output = Json::Value("TrueSkillUnknownInitialModelId"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillUnauthorizedForJob) + { + output = Json::Value("TrueSkillUnauthorizedForJob"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidScenarioName) + { + output = Json::Value("TrueSkillInvalidScenarioName"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionStateIsRequired) + { + output = Json::Value("TrueSkillConditionStateIsRequired"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillEventStateIsRequired) + { + output = Json::Value("TrueSkillEventStateIsRequired"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateEvent) { - output = Json::Value("StateShareUnauthorized"); + output = Json::Value("TrueSkillDuplicateEvent"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateCondition) + { + output = Json::Value("TrueSkillDuplicateCondition"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidAnomalyThreshold) + { + output = Json::Value("TrueSkillInvalidAnomalyThreshold"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionKeyLimitExceeded) + { + output = Json::Value("TrueSkillConditionKeyLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionValuePerKeyLimitExceeded) + { + output = Json::Value("TrueSkillConditionValuePerKeyLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidTimestamp) + { + output = Json::Value("TrueSkillInvalidTimestamp"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillEventLimitExceeded) + { + output = Json::Value("TrueSkillEventLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayers) + { + output = Json::Value("TrueSkillInvalidPlayers"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillTrueSkillPlayerNull) + { + output = Json::Value("TrueSkillTrueSkillPlayerNull"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayerId) + { + output = Json::Value("TrueSkillInvalidPlayerId"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillInvalidSquadSize) + { + output = Json::Value("TrueSkillInvalidSquadSize"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesTrueSkillConditionSetNotInModel) + { + output = Json::Value("TrueSkillConditionSetNotInModel"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesGameSaveManifestNotFound) + { + output = Json::Value("GameSaveManifestNotFound"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesGameSaveManifestVersionAlreadyExists) + { + output = Json::Value("GameSaveManifestVersionAlreadyExists"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesGameSaveConflictUpdatingManifest) + { + output = Json::Value("GameSaveConflictUpdatingManifest"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareForbidden) + { + output = Json::Value("StateShareForbidden"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareTitleNotInFlight) + { + output = Json::Value("StateShareTitleNotInFlight"); return; } if (input == GenericErrorCodes::GenericErrorCodesStateShareStateNotFound) @@ -9820,6 +10052,26 @@ namespace PlayFab output = Json::Value("StateShareLinkNotFound"); return; } + if (input == GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitExceeded) + { + output = Json::Value("StateShareStateRedemptionLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitNotUpdated) + { + output = Json::Value("StateShareStateRedemptionLimitNotUpdated"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareCreatedStatesLimitExceeded) + { + output = Json::Value("StateShareCreatedStatesLimitExceeded"); + return; + } + if (input == GenericErrorCodes::GenericErrorCodesStateShareIdMissingOrMalformed) + { + output = Json::Value("StateShareIdMissingOrMalformed"); + return; + } } inline void FromJsonEnum(const Json::Value& input, GenericErrorCodes& output) { @@ -12663,6 +12915,76 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesCloudScriptAzureFunctionsEventHubRequestError; return; } + if (inputStr == "ExternalEntityNotAllowedForTier") + { + output = GenericErrorCodes::GenericErrorCodesExternalEntityNotAllowedForTier; + return; + } + if (inputStr == "InvalidBaseTimeForInterval") + { + output = GenericErrorCodes::GenericErrorCodesInvalidBaseTimeForInterval; + return; + } + if (inputStr == "EntityTypeMismatchWithStatDefinition") + { + output = GenericErrorCodes::GenericErrorCodesEntityTypeMismatchWithStatDefinition; + return; + } + if (inputStr == "SpecifiedVersionLeaderboardNotFound") + { + output = GenericErrorCodes::GenericErrorCodesSpecifiedVersionLeaderboardNotFound; + return; + } + if (inputStr == "LeaderboardColumnLengthMismatchWithStatDefinition") + { + output = GenericErrorCodes::GenericErrorCodesLeaderboardColumnLengthMismatchWithStatDefinition; + return; + } + if (inputStr == "DuplicateColumnNameFound") + { + output = GenericErrorCodes::GenericErrorCodesDuplicateColumnNameFound; + return; + } + if (inputStr == "LinkedStatisticColumnNotFound") + { + output = GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnNotFound; + return; + } + if (inputStr == "LinkedStatisticColumnRequired") + { + output = GenericErrorCodes::GenericErrorCodesLinkedStatisticColumnRequired; + return; + } + if (inputStr == "MultipleLinkedStatisticsNotAllowed") + { + output = GenericErrorCodes::GenericErrorCodesMultipleLinkedStatisticsNotAllowed; + return; + } + if (inputStr == "DuplicateLinkedStatisticColumnNameFound") + { + output = GenericErrorCodes::GenericErrorCodesDuplicateLinkedStatisticColumnNameFound; + return; + } + if (inputStr == "AggregationTypeNotAllowedForMultiColumnStatistic") + { + output = GenericErrorCodes::GenericErrorCodesAggregationTypeNotAllowedForMultiColumnStatistic; + return; + } + if (inputStr == "MaxQueryableVerionsValueNotAllowedForTier") + { + output = GenericErrorCodes::GenericErrorCodesMaxQueryableVerionsValueNotAllowedForTier; + return; + } + if (inputStr == "StatisticDefinitionHasNullOrEmptyVersionConfiguration") + { + output = GenericErrorCodes::GenericErrorCodesStatisticDefinitionHasNullOrEmptyVersionConfiguration; + return; + } + if (inputStr == "StatisticColumnLengthMismatch") + { + output = GenericErrorCodes::GenericErrorCodesStatisticColumnLengthMismatch; + return; + } if (inputStr == "MatchmakingEntityInvalid") { output = GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid; @@ -13548,6 +13870,11 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesEventSinkContainerNotFound; return; } + if (inputStr == "EventSinkTenantIdInvalid") + { + output = GenericErrorCodes::GenericErrorCodesEventSinkTenantIdInvalid; + return; + } if (inputStr == "OperationCanceled") { output = GenericErrorCodes::GenericErrorCodesOperationCanceled; @@ -13893,9 +14220,124 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesTrueSkillOperationCanceled; return; } - if (inputStr == "StateShareUnauthorized") + if (inputStr == "TrueSkillActiveModelLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillActiveModelLimitExceeded; + return; + } + if (inputStr == "TrueSkillTotalModelLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillTotalModelLimitExceeded; + return; + } + if (inputStr == "TrueSkillUnknownInitialModelId") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillUnknownInitialModelId; + return; + } + if (inputStr == "TrueSkillUnauthorizedForJob") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillUnauthorizedForJob; + return; + } + if (inputStr == "TrueSkillInvalidScenarioName") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidScenarioName; + return; + } + if (inputStr == "TrueSkillConditionStateIsRequired") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionStateIsRequired; + return; + } + if (inputStr == "TrueSkillEventStateIsRequired") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillEventStateIsRequired; + return; + } + if (inputStr == "TrueSkillDuplicateEvent") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateEvent; + return; + } + if (inputStr == "TrueSkillDuplicateCondition") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillDuplicateCondition; + return; + } + if (inputStr == "TrueSkillInvalidAnomalyThreshold") { - output = GenericErrorCodes::GenericErrorCodesStateShareUnauthorized; + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidAnomalyThreshold; + return; + } + if (inputStr == "TrueSkillConditionKeyLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionKeyLimitExceeded; + return; + } + if (inputStr == "TrueSkillConditionValuePerKeyLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionValuePerKeyLimitExceeded; + return; + } + if (inputStr == "TrueSkillInvalidTimestamp") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidTimestamp; + return; + } + if (inputStr == "TrueSkillEventLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillEventLimitExceeded; + return; + } + if (inputStr == "TrueSkillInvalidPlayers") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayers; + return; + } + if (inputStr == "TrueSkillTrueSkillPlayerNull") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillTrueSkillPlayerNull; + return; + } + if (inputStr == "TrueSkillInvalidPlayerId") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidPlayerId; + return; + } + if (inputStr == "TrueSkillInvalidSquadSize") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillInvalidSquadSize; + return; + } + if (inputStr == "TrueSkillConditionSetNotInModel") + { + output = GenericErrorCodes::GenericErrorCodesTrueSkillConditionSetNotInModel; + return; + } + if (inputStr == "GameSaveManifestNotFound") + { + output = GenericErrorCodes::GenericErrorCodesGameSaveManifestNotFound; + return; + } + if (inputStr == "GameSaveManifestVersionAlreadyExists") + { + output = GenericErrorCodes::GenericErrorCodesGameSaveManifestVersionAlreadyExists; + return; + } + if (inputStr == "GameSaveConflictUpdatingManifest") + { + output = GenericErrorCodes::GenericErrorCodesGameSaveConflictUpdatingManifest; + return; + } + if (inputStr == "StateShareForbidden") + { + output = GenericErrorCodes::GenericErrorCodesStateShareForbidden; + return; + } + if (inputStr == "StateShareTitleNotInFlight") + { + output = GenericErrorCodes::GenericErrorCodesStateShareTitleNotInFlight; return; } if (inputStr == "StateShareStateNotFound") @@ -13908,6 +14350,26 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesStateShareLinkNotFound; return; } + if (inputStr == "StateShareStateRedemptionLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitExceeded; + return; + } + if (inputStr == "StateShareStateRedemptionLimitNotUpdated") + { + output = GenericErrorCodes::GenericErrorCodesStateShareStateRedemptionLimitNotUpdated; + return; + } + if (inputStr == "StateShareCreatedStatesLimitExceeded") + { + output = GenericErrorCodes::GenericErrorCodesStateShareCreatedStatesLimitExceeded; + return; + } + if (inputStr == "StateShareIdMissingOrMalformed") + { + output = GenericErrorCodes::GenericErrorCodesStateShareIdMissingOrMalformed; + return; + } } enum class LoginIdentityProvider @@ -13933,7 +14395,8 @@ namespace PlayFab LoginIdentityProviderOpenIdConnect, LoginIdentityProviderApple, LoginIdentityProviderNintendoSwitchAccount, - LoginIdentityProviderGooglePlayGames + LoginIdentityProviderGooglePlayGames, + LoginIdentityProviderXboxMobileStore }; inline void ToJsonEnum(const LoginIdentityProvider input, Json::Value& output) @@ -14048,6 +14511,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == LoginIdentityProvider::LoginIdentityProviderXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, LoginIdentityProvider& output) { @@ -14166,6 +14634,11 @@ namespace PlayFab output = LoginIdentityProvider::LoginIdentityProviderGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = LoginIdentityProvider::LoginIdentityProviderXboxMobileStore; + return; + } } enum class PushNotificationPlatform @@ -14624,7 +15097,8 @@ namespace PlayFab UserOriginationOpenIdConnect, UserOriginationApple, UserOriginationNintendoSwitchAccount, - UserOriginationGooglePlayGames + UserOriginationGooglePlayGames, + UserOriginationXboxMobileStore }; inline void ToJsonEnum(const UserOrigination input, Json::Value& output) @@ -14749,6 +15223,11 @@ namespace PlayFab output = Json::Value("GooglePlayGames"); return; } + if (input == UserOrigination::UserOriginationXboxMobileStore) + { + output = Json::Value("XboxMobileStore"); + return; + } } inline void FromJsonEnum(const Json::Value& input, UserOrigination& output) { @@ -14877,6 +15356,11 @@ namespace PlayFab output = UserOrigination::UserOriginationGooglePlayGames; return; } + if (inputStr == "XboxMobileStore") + { + output = UserOrigination::UserOriginationXboxMobileStore; + return; + } } // Server Classes diff --git a/code/source/playfab/PlayFabCurlHttpPlugin.cpp b/code/source/playfab/PlayFabCurlHttpPlugin.cpp index 10518c9c..77706a99 100644 --- a/code/source/playfab/PlayFabCurlHttpPlugin.cpp +++ b/code/source/playfab/PlayFabCurlHttpPlugin.cpp @@ -12,9 +12,7 @@ char(*__countof_helper(_CountofType(&_Array)[_SizeOfArray]))[_SizeOfArray]; #define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0) #endif -#ifdef _WIN32 - #define strncasecmp(x,y,z) _strnicmp(x,y,z) -#endif +#define strncasecmp(x,y,z) _strnicmp(x,y,z) namespace PlayFab { diff --git a/code/source/playfab/PlayFabLeaderboardsApi.cpp b/code/source/playfab/PlayFabLeaderboardsApi.cpp new file mode 100644 index 00000000..c2ec9997 --- /dev/null +++ b/code/source/playfab/PlayFabLeaderboardsApi.cpp @@ -0,0 +1,1137 @@ +#include + +#if !defined(DISABLE_PLAYFABENTITY_API) + +#include +#include +#include +#include +#include + +#if defined(PLAYFAB_PLATFORM_WINDOWS) +#pragma warning (disable: 4100) // formal parameters are part of a public interface +#endif // defined(PLAYFAB_PLATFORM_WINDOWS) + +namespace PlayFab +{ + using namespace LeaderboardsModels; + + size_t PlayFabLeaderboardsAPI::Update() + { + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + return http.Update(); + } + + void PlayFabLeaderboardsAPI::ForgetAllCredentials() + { + return PlayFabSettings::ForgetAllCredentials(); + } + + // PlayFabLeaderboards APIs + + void PlayFabLeaderboardsAPI::CreateLeaderboardDefinition( + CreateLeaderboardDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/CreateLeaderboardDefinition", + headers, + jsonAsString, + OnCreateLeaderboardDefinitionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnCreateLeaderboardDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::CreateStatisticDefinition( + CreateStatisticDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/CreateStatisticDefinition", + headers, + jsonAsString, + OnCreateStatisticDefinitionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnCreateStatisticDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::DeleteLeaderboardDefinition( + DeleteLeaderboardDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/DeleteLeaderboardDefinition", + headers, + jsonAsString, + OnDeleteLeaderboardDefinitionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnDeleteLeaderboardDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::DeleteLeaderboardEntries( + DeleteLeaderboardEntriesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/DeleteLeaderboardEntries", + headers, + jsonAsString, + OnDeleteLeaderboardEntriesResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnDeleteLeaderboardEntriesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::DeleteStatisticDefinition( + DeleteStatisticDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/DeleteStatisticDefinition", + headers, + jsonAsString, + OnDeleteStatisticDefinitionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnDeleteStatisticDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::DeleteStatistics( + DeleteStatisticsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/DeleteStatistics", + headers, + jsonAsString, + OnDeleteStatisticsResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnDeleteStatisticsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + DeleteStatisticsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetFriendLeaderboardForEntity( + GetFriendLeaderboardForEntityRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetFriendLeaderboardForEntity", + headers, + jsonAsString, + OnGetFriendLeaderboardForEntityResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetFriendLeaderboardForEntityResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetLeaderboard( + GetEntityLeaderboardRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboard", + headers, + jsonAsString, + OnGetLeaderboardResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetLeaderboardResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetLeaderboardAroundEntity( + GetLeaderboardAroundEntityRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboardAroundEntity", + headers, + jsonAsString, + OnGetLeaderboardAroundEntityResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetLeaderboardAroundEntityResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetLeaderboardDefinition( + GetLeaderboardDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboardDefinition", + headers, + jsonAsString, + OnGetLeaderboardDefinitionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetLeaderboardDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetLeaderboardDefinitionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetLeaderboardForEntities( + GetLeaderboardForEntitiesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboardForEntities", + headers, + jsonAsString, + OnGetLeaderboardForEntitiesResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetLeaderboardForEntitiesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetStatisticDefinition( + GetStatisticDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatisticDefinition", + headers, + jsonAsString, + OnGetStatisticDefinitionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetStatisticDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticDefinitionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetStatisticDefinitions( + GetStatisticDefinitionsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatisticDefinitions", + headers, + jsonAsString, + OnGetStatisticDefinitionsResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetStatisticDefinitionsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticDefinitionsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetStatistics( + GetStatisticsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatistics", + headers, + jsonAsString, + OnGetStatisticsResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetStatisticsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::GetStatisticsForEntities( + GetStatisticsForEntitiesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatisticsForEntities", + headers, + jsonAsString, + OnGetStatisticsForEntitiesResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnGetStatisticsForEntitiesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticsForEntitiesResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::IncrementLeaderboardVersion( + IncrementLeaderboardVersionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/IncrementLeaderboardVersion", + headers, + jsonAsString, + OnIncrementLeaderboardVersionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnIncrementLeaderboardVersionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + IncrementLeaderboardVersionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::IncrementStatisticVersion( + IncrementStatisticVersionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/IncrementStatisticVersion", + headers, + jsonAsString, + OnIncrementStatisticVersionResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnIncrementStatisticVersionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + IncrementStatisticVersionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::ListLeaderboardDefinitions( + ListLeaderboardDefinitionsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/ListLeaderboardDefinitions", + headers, + jsonAsString, + OnListLeaderboardDefinitionsResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnListLeaderboardDefinitionsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + ListLeaderboardDefinitionsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::ListStatisticDefinitions( + ListStatisticDefinitionsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/ListStatisticDefinitions", + headers, + jsonAsString, + OnListStatisticDefinitionsResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnListStatisticDefinitionsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + ListStatisticDefinitionsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::UnlinkLeaderboardFromStatistic( + UnlinkLeaderboardFromStatisticRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/UnlinkLeaderboardFromStatistic", + headers, + jsonAsString, + OnUnlinkLeaderboardFromStatisticResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnUnlinkLeaderboardFromStatisticResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::UpdateLeaderboardEntries( + UpdateLeaderboardEntriesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/UpdateLeaderboardEntries", + headers, + jsonAsString, + OnUpdateLeaderboardEntriesResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnUpdateLeaderboardEntriesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsAPI::UpdateStatistics( + UpdateStatisticsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : PlayFabSettings::staticPlayer; + std::shared_ptr settings = PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/UpdateStatistics", + headers, + jsonAsString, + OnUpdateStatisticsResult, + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsAPI::OnUpdateStatisticsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + UpdateStatisticsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = (*static_cast *>(internalPtr.get())); + callback(outResult, container.GetCustomData()); + } + } + } + + bool PlayFabLeaderboardsAPI::ValidateResult(PlayFabResultCommon& resultCommon, const CallRequestContainer& container) + { + if (container.errorWrapper.HttpCode == 200) + { + resultCommon.FromJson(container.errorWrapper.Data); + resultCommon.Request = container.errorWrapper.Request; + return true; + } + else // Process the error case + { + if (PlayFabSettings::globalErrorHandler != nullptr) + { + PlayFabSettings::globalErrorHandler(container.errorWrapper, container.GetCustomData()); + } + if (container.errorCallback != nullptr) + { + container.errorCallback(container.errorWrapper, container.GetCustomData()); + } + return false; + } + } +} + +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) + +#if defined(PLAYFAB_PLATFORM_WINDOWS) +#pragma warning (default: 4100) // formal parameters are part of a public interface +#endif // defined(PLAYFAB_PLATFORM_WINDOWS) diff --git a/code/source/playfab/PlayFabLeaderboardsInstanceApi.cpp b/code/source/playfab/PlayFabLeaderboardsInstanceApi.cpp new file mode 100644 index 00000000..2e42f325 --- /dev/null +++ b/code/source/playfab/PlayFabLeaderboardsInstanceApi.cpp @@ -0,0 +1,1190 @@ +#include + +#if !defined(DISABLE_PLAYFABENTITY_API) + +#include +#include +#include + +#if defined(PLAYFAB_PLATFORM_WINDOWS) +#pragma warning (disable: 4100) // formal parameters are part of a public interface +#endif // defined(PLAYFAB_PLATFORM_WINDOWS) + +namespace PlayFab +{ + using namespace LeaderboardsModels; + + PlayFabLeaderboardsInstanceAPI::PlayFabLeaderboardsInstanceAPI(const std::shared_ptr& authenticationContext) + { + if (authenticationContext == nullptr) + { + throw PlayFabException(PlayFabExceptionCode::AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext"); + } + this->m_context = authenticationContext; + } + + PlayFabLeaderboardsInstanceAPI::PlayFabLeaderboardsInstanceAPI(const std::shared_ptr& apiSettings, const std::shared_ptr& authenticationContext) + { + if (authenticationContext == nullptr) + { + throw PlayFabException(PlayFabExceptionCode::AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext"); + } + this->m_settings = apiSettings; + this->m_context = authenticationContext; + } + + std::shared_ptr PlayFabLeaderboardsInstanceAPI::GetSettings() const + { + return this->m_settings; + } + + std::shared_ptr PlayFabLeaderboardsInstanceAPI::GetAuthenticationContext() const + { + return this->m_context; + } + + size_t PlayFabLeaderboardsInstanceAPI::Update() + { + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + return http.Update(); + } + + void PlayFabLeaderboardsInstanceAPI::ForgetAllCredentials() + { + if (this->m_context != nullptr) + { + this->m_context->ForgetAllCredentials(); + } + } + + // PlayFabLeaderboards instance APIs + + void PlayFabLeaderboardsInstanceAPI::CreateLeaderboardDefinition( + CreateLeaderboardDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/CreateLeaderboardDefinition", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnCreateLeaderboardDefinitionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnCreateLeaderboardDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::CreateStatisticDefinition( + CreateStatisticDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/CreateStatisticDefinition", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnCreateStatisticDefinitionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnCreateStatisticDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::DeleteLeaderboardDefinition( + DeleteLeaderboardDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/DeleteLeaderboardDefinition", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnDeleteLeaderboardDefinitionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnDeleteLeaderboardDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::DeleteLeaderboardEntries( + DeleteLeaderboardEntriesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/DeleteLeaderboardEntries", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnDeleteLeaderboardEntriesResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnDeleteLeaderboardEntriesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::DeleteStatisticDefinition( + DeleteStatisticDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/DeleteStatisticDefinition", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnDeleteStatisticDefinitionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnDeleteStatisticDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::DeleteStatistics( + DeleteStatisticsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/DeleteStatistics", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnDeleteStatisticsResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnDeleteStatisticsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + DeleteStatisticsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetFriendLeaderboardForEntity( + GetFriendLeaderboardForEntityRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetFriendLeaderboardForEntity", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetFriendLeaderboardForEntityResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetFriendLeaderboardForEntityResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetLeaderboard( + GetEntityLeaderboardRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboard", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetLeaderboardAroundEntity( + GetLeaderboardAroundEntityRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboardAroundEntity", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardAroundEntityResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardAroundEntityResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetLeaderboardDefinition( + GetLeaderboardDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboardDefinition", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardDefinitionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetLeaderboardDefinitionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetLeaderboardForEntities( + GetLeaderboardForEntitiesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/GetLeaderboardForEntities", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardForEntitiesResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetLeaderboardForEntitiesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetEntityLeaderboardResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetStatisticDefinition( + GetStatisticDefinitionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatisticDefinition", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetStatisticDefinitionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetStatisticDefinitionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticDefinitionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetStatisticDefinitions( + GetStatisticDefinitionsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatisticDefinitions", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetStatisticDefinitionsResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetStatisticDefinitionsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticDefinitionsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetStatistics( + GetStatisticsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatistics", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetStatisticsResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetStatisticsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::GetStatisticsForEntities( + GetStatisticsForEntitiesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/GetStatisticsForEntities", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnGetStatisticsForEntitiesResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnGetStatisticsForEntitiesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetStatisticsForEntitiesResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::IncrementLeaderboardVersion( + IncrementLeaderboardVersionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/IncrementLeaderboardVersion", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnIncrementLeaderboardVersionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnIncrementLeaderboardVersionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + IncrementLeaderboardVersionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::IncrementStatisticVersion( + IncrementStatisticVersionRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/IncrementStatisticVersion", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnIncrementStatisticVersionResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnIncrementStatisticVersionResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + IncrementStatisticVersionResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::ListLeaderboardDefinitions( + ListLeaderboardDefinitionsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/ListLeaderboardDefinitions", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnListLeaderboardDefinitionsResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnListLeaderboardDefinitionsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + ListLeaderboardDefinitionsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::ListStatisticDefinitions( + ListStatisticDefinitionsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/ListStatisticDefinitions", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnListStatisticDefinitionsResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnListStatisticDefinitionsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + ListStatisticDefinitionsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::UnlinkLeaderboardFromStatistic( + UnlinkLeaderboardFromStatisticRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/UnlinkLeaderboardFromStatistic", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnUnlinkLeaderboardFromStatisticResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnUnlinkLeaderboardFromStatisticResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::UpdateLeaderboardEntries( + UpdateLeaderboardEntriesRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Leaderboard/UpdateLeaderboardEntries", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnUpdateLeaderboardEntriesResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnUpdateLeaderboardEntriesResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + EmptyResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + void PlayFabLeaderboardsInstanceAPI::UpdateStatistics( + UpdateStatisticsRequest& request, + const ProcessApiCallback callback, + const ErrorCallback errorCallback, + void* customData + ) + { + std::shared_ptr context = request.authenticationContext != nullptr ? request.authenticationContext : this->m_context; + std::shared_ptr settings = this->m_settings != nullptr ? this->m_settings : PlayFabSettings::staticSettings; + + IPlayFabHttpPlugin& http = *PlayFabPluginManager::GetPlugin(PlayFabPluginContract::PlayFab_Transport); + const Json::Value requestJson = request.ToJson(); + std::string jsonAsString = requestJson.toStyledString(); + + std::shared_ptr authenticationContext = request.authenticationContext == nullptr ? this->m_context : request.authenticationContext; + std::unordered_map headers; + headers.emplace("X-EntityToken", context->entityToken); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Statistic/UpdateStatistics", + headers, + jsonAsString, + std::bind(&PlayFabLeaderboardsInstanceAPI::OnUpdateStatisticsResult, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + settings, + context, + customData)); + + reqContainer->successCallback = std::shared_ptr((callback == nullptr) ? nullptr : new ProcessApiCallback(callback)); + reqContainer->errorCallback = errorCallback; + + http.MakePostRequest(std::unique_ptr(static_cast(reqContainer.release()))); + } + + void PlayFabLeaderboardsInstanceAPI::OnUpdateStatisticsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + UpdateStatisticsResponse outResult; + if (ValidateResult(outResult, container)) + { + std::shared_ptr internalPtr = container.successCallback; + if (internalPtr.get() != nullptr) + { + const auto& callback = *static_cast *>(internalPtr.get()); + callback(outResult, container.GetCustomData()); + } + } + } + + bool PlayFabLeaderboardsInstanceAPI::ValidateResult(PlayFabResultCommon& resultCommon, const CallRequestContainer& container) + { + if (container.errorWrapper.HttpCode == 200) + { + resultCommon.FromJson(container.errorWrapper.Data); + resultCommon.Request = container.errorWrapper.Request; + return true; + } + else // Process the error case + { + if (PlayFabSettings::globalErrorHandler != nullptr) + { + PlayFabSettings::globalErrorHandler(container.errorWrapper, container.GetCustomData()); + } + + if (container.errorCallback != nullptr) + { + container.errorCallback(container.errorWrapper, container.GetCustomData()); + } + return false; + } + } +} + +#endif + +#if defined(PLAYFAB_PLATFORM_WINDOWS) +#pragma warning (default: 4100) // formal parameters are part of a public interface +#endif // defined(PLAYFAB_PLATFORM_WINDOWS) diff --git a/code/source/playfab/PlayFabSettings.cpp b/code/source/playfab/PlayFabSettings.cpp index 41cccfc8..2b0b7df7 100644 --- a/code/source/playfab/PlayFabSettings.cpp +++ b/code/source/playfab/PlayFabSettings.cpp @@ -7,9 +7,9 @@ namespace PlayFab // Control whether all callbacks are threaded or whether the user manually controls callback timing from their main-thread // Note ANY api call may synchronously throw an exception if the title id is not set bool PlayFabSettings::threadedCallbacks = false; - const std::string PlayFabSettings::sdkVersion = "3.137.240514"; - const std::string PlayFabSettings::buildIdentifier = "adobuild_xplatcppsdk_114"; - const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.137.240514"; + const std::string PlayFabSettings::sdkVersion = "3.141.240802"; + const std::string PlayFabSettings::buildIdentifier = "adobuild_xplatcppsdk_166"; + const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.141.240802"; std::string PlayFabSettings::productionEnvironmentURL = ".playfabapi.com"; ErrorCallback PlayFabSettings::globalErrorHandler = nullptr; diff --git a/com.playfab.xplatcppsdk.v141.autopkg b/com.playfab.xplatcppsdk.v141.autopkg index 34868837..4aa613d3 100644 --- a/com.playfab.xplatcppsdk.v141.autopkg +++ b/com.playfab.xplatcppsdk.v141.autopkg @@ -8,7 +8,7 @@ configurations { nuget { nuspec { id = "com.playfab.xplatcppsdk.v141"; - version : 3.137.240514; + version : 3.141.240802; title: "PlayFab Cross Platform C++ Sdk for Visual Studio 2017"; summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience."; authors: "PlayFab"; @@ -18,7 +18,7 @@ nuget { iconUrl: "https://playfab.com/assets/img/playfab-mark.png"; requireLicenseAcceptance: false; description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services."; - releaseNotes: "https://api.playfab.com/releaseNotes/#240514"; + releaseNotes: "https://api.playfab.com/releaseNotes/#240802"; copyright: "Copyright 2024"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native }; diff --git a/com.playfab.xplatcppsdk.v141.nuspec b/com.playfab.xplatcppsdk.v141.nuspec index b3441a71..aa0bb4b1 100644 --- a/com.playfab.xplatcppsdk.v141.nuspec +++ b/com.playfab.xplatcppsdk.v141.nuspec @@ -2,14 +2,14 @@ com.playfab.xplatcppsdk.v141 - 3.137.240514 + 3.141.240802 Microsoft Microsoft http://github.com/PlayFab/XPlatCppSdk Apache-2.0 ./images/icon.png false - https://api.playfab.com/releaseNotes/#3.137.240514 + https://api.playfab.com/releaseNotes/#3.141.240802 Microsoft Azure PlayFab XPlatCppSdk © Microsoft Corporation. All rights reserved. Microsoft Azure PlayFab Baas Paas JSON REST HTTP SSL API cloud liveops game gamedev native nativepackage diff --git a/com.playfab.xplatcppsdk.v142.autopkg b/com.playfab.xplatcppsdk.v142.autopkg index a38859a5..c3e79efe 100644 --- a/com.playfab.xplatcppsdk.v142.autopkg +++ b/com.playfab.xplatcppsdk.v142.autopkg @@ -8,7 +8,7 @@ configurations { nuget { nuspec { id = "com.playfab.xplatcppsdk.v142"; - version : 3.137.240514; + version : 3.141.240802; title: "PlayFab Cross Platform C++ Sdk for Visual Studio 2019+"; summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience."; authors: "PlayFab"; @@ -18,7 +18,7 @@ nuget { iconUrl: "https://playfab.com/assets/img/playfab-mark.png"; requireLicenseAcceptance: false; description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services."; - releaseNotes: "https://api.playfab.com/releaseNotes/#240514"; + releaseNotes: "https://api.playfab.com/releaseNotes/#240802"; copyright: "Copyright 2024"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native }; diff --git a/com.playfab.xplatcppsdk.v142.nuspec b/com.playfab.xplatcppsdk.v142.nuspec index 9821b7b6..6797b0f6 100644 --- a/com.playfab.xplatcppsdk.v142.nuspec +++ b/com.playfab.xplatcppsdk.v142.nuspec @@ -2,14 +2,14 @@ com.playfab.xplatcppsdk.v142 - 3.137.240514 + 3.141.240802 Microsoft Microsoft http://github.com/PlayFab/XPlatCppSdk Apache-2.0 ./images/icon.png false - https://api.playfab.com/releaseNotes/#3.137.240514 + https://api.playfab.com/releaseNotes/#3.141.240802 Microsoft Azure PlayFab XPlatCppSdk © Microsoft Corporation. All rights reserved. Microsoft Azure PlayFab Baas Paas JSON REST HTTP SSL API cloud liveops game gamedev native nativepackage diff --git a/com.playfab.xplatxboxsdk.v141.autopkg b/com.playfab.xplatxboxsdk.v141.autopkg index 976dd3b9..7df91420 100644 --- a/com.playfab.xplatxboxsdk.v141.autopkg +++ b/com.playfab.xplatxboxsdk.v141.autopkg @@ -18,7 +18,7 @@ configurations { nuget { nuspec { id = "com.playfab.xplatxboxsdk.v141"; - version : 3.137.240514; + version : 3.141.240802; title: "PlayFab Xbox Platform C++ Sdk for Visual Studio 2017"; summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience."; authors: "PlayFab"; @@ -28,7 +28,7 @@ nuget { iconUrl: "https://playfab.com/assets/img/playfab-mark.png"; requireLicenseAcceptance: false; description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services."; - releaseNotes: "https://api.playfab.com/releaseNotes/#240514"; + releaseNotes: "https://api.playfab.com/releaseNotes/#240802"; copyright: "Copyright 2024"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native, xbox };