From fe6dee338c4a2c2d8fe4a10694fc5778f593d968 Mon Sep 17 00:00:00 2001 From: PlayFab Jenkins Bot Date: Tue, 21 Jan 2020 21:20:26 +0000 Subject: [PATCH] https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#200121 --- build/Windows/TestClientApp.vcxproj.filters | 4 - build/Windows/TestServerApp.vcxproj.filters | 4 - code/include/playfab/PlayFabAdminApi.h | 9 +- code/include/playfab/PlayFabAdminDataModels.h | 13 +- .../include/playfab/PlayFabAdminInstanceApi.h | 11 +- .../playfab/PlayFabAuthenticationApi.h | 9 +- .../playfab/PlayFabAuthenticationContext.h | 4 +- .../playfab/PlayFabAuthenticationDataModels.h | 2 +- .../PlayFabAuthenticationInstanceApi.h | 11 +- code/include/playfab/PlayFabBaseModel.h | 10 +- .../playfab/PlayFabCallRequestContainer.h | 3 +- .../playfab/PlayFabCallRequestContainerBase.h | 3 - code/include/playfab/PlayFabClientApi.h | 9 +- .../include/playfab/PlayFabClientDataModels.h | 17 +- .../playfab/PlayFabClientInstanceApi.h | 11 +- code/include/playfab/PlayFabCloudScriptApi.h | 9 +- .../playfab/PlayFabCloudScriptDataModels.h | 2 +- .../playfab/PlayFabCloudScriptInstanceApi.h | 11 +- code/include/playfab/PlayFabDataApi.h | 9 +- code/include/playfab/PlayFabDataDataModels.h | 2 +- code/include/playfab/PlayFabDataInstanceApi.h | 11 +- code/include/playfab/PlayFabError.h | 1 + code/include/playfab/PlayFabEventPipeline.h | 8 +- code/include/playfab/PlayFabEventRouter.h | 5 +- code/include/playfab/PlayFabEventsApi.h | 9 +- .../include/playfab/PlayFabEventsDataModels.h | 2 +- .../playfab/PlayFabEventsInstanceApi.h | 11 +- code/include/playfab/PlayFabGroupsApi.h | 9 +- .../include/playfab/PlayFabGroupsDataModels.h | 2 +- .../playfab/PlayFabGroupsInstanceApi.h | 11 +- code/include/playfab/PlayFabLocalizationApi.h | 9 +- .../playfab/PlayFabLocalizationDataModels.h | 2 +- .../playfab/PlayFabLocalizationInstanceApi.h | 11 +- code/include/playfab/PlayFabMatchmakerApi.h | 9 +- .../playfab/PlayFabMatchmakerDataModels.h | 2 +- .../playfab/PlayFabMatchmakerInstanceApi.h | 11 +- code/include/playfab/PlayFabMultiplayerApi.h | 19 +- .../playfab/PlayFabMultiplayerDataModels.h | 523 +++++++++++++++--- .../playfab/PlayFabMultiplayerInstanceApi.h | 21 +- code/include/playfab/PlayFabProfilesApi.h | 9 +- .../playfab/PlayFabProfilesDataModels.h | 2 +- .../playfab/PlayFabProfilesInstanceApi.h | 11 +- code/include/playfab/PlayFabServerApi.h | 13 +- .../include/playfab/PlayFabServerDataModels.h | 154 +++++- .../playfab/PlayFabServerInstanceApi.h | 15 +- code/include/playfab/PlayFabSettings.h | 7 +- code/include/playfab/QoS/PlayFabQoSApi.h | 17 +- code/source/playfab/PlayFabAdminApi.cpp | 4 +- .../playfab/PlayFabAdminInstanceApi.cpp | 4 +- .../playfab/PlayFabAuthenticationApi.cpp | 4 +- .../playfab/PlayFabAuthenticationContext.cpp | 13 +- .../PlayFabAuthenticationInstanceApi.cpp | 4 +- code/source/playfab/PlayFabClientApi.cpp | 4 +- .../playfab/PlayFabClientInstanceApi.cpp | 4 +- code/source/playfab/PlayFabCloudScriptApi.cpp | 4 +- .../playfab/PlayFabCloudScriptInstanceApi.cpp | 4 +- code/source/playfab/PlayFabDataApi.cpp | 4 +- .../source/playfab/PlayFabDataInstanceApi.cpp | 4 +- code/source/playfab/PlayFabEventPipeline.cpp | 12 +- code/source/playfab/PlayFabEventsApi.cpp | 4 +- .../playfab/PlayFabEventsInstanceApi.cpp | 4 +- code/source/playfab/PlayFabGroupsApi.cpp | 4 +- .../playfab/PlayFabGroupsInstanceApi.cpp | 4 +- .../source/playfab/PlayFabLocalizationApi.cpp | 4 +- .../PlayFabLocalizationInstanceApi.cpp | 4 +- code/source/playfab/PlayFabMatchmakerApi.cpp | 4 +- .../playfab/PlayFabMatchmakerInstanceApi.cpp | 4 +- code/source/playfab/PlayFabMultiplayerApi.cpp | 249 ++++++++- .../playfab/PlayFabMultiplayerInstanceApi.cpp | 254 ++++++++- code/source/playfab/PlayFabProfilesApi.cpp | 4 +- .../playfab/PlayFabProfilesInstanceApi.cpp | 4 +- code/source/playfab/PlayFabServerApi.cpp | 102 +++- .../playfab/PlayFabServerInstanceApi.cpp | 104 +++- code/source/playfab/PlayFabSettings.cpp | 6 +- code/source/playfab/QoS/PlayFabQoSApi.cpp | 20 +- code/stdafx.h | 1 + com.playfab.xplatcppsdk.v141.autopkg | 6 +- com.playfab.xplatxboxsdk.v141.autopkg | 6 +- test/TestApp/PlayFabApiTest.cpp | 119 ++-- test/TestApp/PlayFabApiTest.h | 15 +- test/TestApp/PlayFabEventTest.cpp | 17 +- test/TestApp/PlayFabEventTest.h | 5 +- test/TestApp/PlayFabTestAlloc.cpp | 6 +- test/TestApp/PlayFabTestMultiUserInstance.cpp | 2 +- test/TestApp/PlayFabTestMultiUserInstance.h | 2 +- test/TestApp/PlayFabTestMultiUserStatic.cpp | 14 +- test/TestApp/PlayFabTestMultiUserStatic.h | 3 +- test/TestApp/TestApp.cpp | 55 +- test/TestApp/TestApp.h | 6 +- 89 files changed, 1722 insertions(+), 432 deletions(-) diff --git a/build/Windows/TestClientApp.vcxproj.filters b/build/Windows/TestClientApp.vcxproj.filters index 5b483a8f..563e6e81 100644 --- a/build/Windows/TestClientApp.vcxproj.filters +++ b/build/Windows/TestClientApp.vcxproj.filters @@ -9,10 +9,6 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - diff --git a/build/Windows/TestServerApp.vcxproj.filters b/build/Windows/TestServerApp.vcxproj.filters index 5b483a8f..563e6e81 100644 --- a/build/Windows/TestServerApp.vcxproj.filters +++ b/build/Windows/TestServerApp.vcxproj.filters @@ -9,10 +9,6 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - diff --git a/code/include/playfab/PlayFabAdminApi.h b/code/include/playfab/PlayFabAdminApi.h index 907f8d17..3c0af7d0 100644 --- a/code/include/playfab/PlayFabAdminApi.h +++ b/code/include/playfab/PlayFabAdminApi.h @@ -1,12 +1,15 @@ #pragma once -#ifdef ENABLE_PLAYFABADMIN_API +#if defined(ENABLE_PLAYFABADMIN_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Admin APIs /// @@ -249,4 +252,4 @@ namespace PlayFab }; } -#endif // #ifdef ENABLE_PLAYFABADMIN_API +#endif // #if defined(ENABLE_PLAYFABADMIN_API) diff --git a/code/include/playfab/PlayFabAdminDataModels.h b/code/include/playfab/PlayFabAdminDataModels.h index bac55ad4..b0d8d1bc 100644 --- a/code/include/playfab/PlayFabAdminDataModels.h +++ b/code/include/playfab/PlayFabAdminDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifdef ENABLE_PLAYFABADMIN_API +#if defined(ENABLE_PLAYFABADMIN_API) #include #include @@ -5377,6 +5377,7 @@ namespace PlayFab GenericErrorCodesInsightsManagementTitleInEvaluationMode, GenericErrorCodesCloudScriptAzureFunctionsQueueRequestError, GenericErrorCodesEvaluationModeTitleCountExceeded, + GenericErrorCodesInsightsManagementTitleNotInFlight, GenericErrorCodesMatchmakingEntityInvalid, GenericErrorCodesMatchmakingPlayerAttributesInvalid, GenericErrorCodesMatchmakingQueueNotFound, @@ -7879,6 +7880,11 @@ namespace PlayFab output = Json::Value("EvaluationModeTitleCountExceeded"); return; } + if (input == GenericErrorCodes::GenericErrorCodesInsightsManagementTitleNotInFlight) + { + output = Json::Value("InsightsManagementTitleNotInFlight"); + return; + } if (input == GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid) { output = Json::Value("MatchmakingEntityInvalid"); @@ -10677,6 +10683,11 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesEvaluationModeTitleCountExceeded; return; } + if (inputStr == "InsightsManagementTitleNotInFlight") + { + output = GenericErrorCodes::GenericErrorCodesInsightsManagementTitleNotInFlight; + return; + } if (inputStr == "MatchmakingEntityInvalid") { output = GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid; diff --git a/code/include/playfab/PlayFabAdminInstanceApi.h b/code/include/playfab/PlayFabAdminInstanceApi.h index 87d6c83e..6a91f730 100644 --- a/code/include/playfab/PlayFabAdminInstanceApi.h +++ b/code/include/playfab/PlayFabAdminInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifdef ENABLE_PLAYFABADMIN_API +#if defined(ENABLE_PLAYFABADMIN_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Admin APIs /// diff --git a/code/include/playfab/PlayFabAuthenticationApi.h b/code/include/playfab/PlayFabAuthenticationApi.h index 6c680a2d..723080c3 100644 --- a/code/include/playfab/PlayFabAuthenticationApi.h +++ b/code/include/playfab/PlayFabAuthenticationApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Authentication APIs /// @@ -33,4 +36,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabAuthenticationContext.h b/code/include/playfab/PlayFabAuthenticationContext.h index c246c32f..b9b3666e 100644 --- a/code/include/playfab/PlayFabAuthenticationContext.h +++ b/code/include/playfab/PlayFabAuthenticationContext.h @@ -9,7 +9,7 @@ namespace PlayFab /// class PlayFabAuthenticationContext { -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) public: // Client-only variables should only be visible when appropriate #else private: // But, static library memory size and alloc issues mean it always needs to exist @@ -36,5 +36,7 @@ namespace PlayFab void HandlePlayFabLogin(const std::string& _playFabId, const std::string& _clientSessionTicket, const std::string& _entityId, const std::string& _entityType, const std::string& _entityToken); void ForgetAllCredentials(); + bool IsClientLoggedIn(); + bool IsEntityLoggedIn(); }; } diff --git a/code/include/playfab/PlayFabAuthenticationDataModels.h b/code/include/playfab/PlayFabAuthenticationDataModels.h index b28717f1..42df940b 100644 --- a/code/include/playfab/PlayFabAuthenticationDataModels.h +++ b/code/include/playfab/PlayFabAuthenticationDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabAuthenticationInstanceApi.h b/code/include/playfab/PlayFabAuthenticationInstanceApi.h index 03e03d52..600fec53 100644 --- a/code/include/playfab/PlayFabAuthenticationInstanceApi.h +++ b/code/include/playfab/PlayFabAuthenticationInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Authentication APIs /// diff --git a/code/include/playfab/PlayFabBaseModel.h b/code/include/playfab/PlayFabBaseModel.h index c01259d9..2e6049ec 100644 --- a/code/include/playfab/PlayFabBaseModel.h +++ b/code/include/playfab/PlayFabBaseModel.h @@ -1,17 +1,15 @@ #pragma once -#include -#include -#include -#include -#include - #include #include #include #include #include +#include +#include +#include + namespace PlayFab { class PlayFabAuthenticationContext; diff --git a/code/include/playfab/PlayFabCallRequestContainer.h b/code/include/playfab/PlayFabCallRequestContainer.h index b96881e4..d92e8069 100644 --- a/code/include/playfab/PlayFabCallRequestContainer.h +++ b/code/include/playfab/PlayFabCallRequestContainer.h @@ -1,11 +1,12 @@ #pragma once -#include #include #include namespace PlayFab { + class PlayFabApiSettings; + /// /// Internal PlayFabHttp container for each API call /// diff --git a/code/include/playfab/PlayFabCallRequestContainerBase.h b/code/include/playfab/PlayFabCallRequestContainerBase.h index 2224bc63..c4306003 100644 --- a/code/include/playfab/PlayFabCallRequestContainerBase.h +++ b/code/include/playfab/PlayFabCallRequestContainerBase.h @@ -1,8 +1,5 @@ #pragma once -#include -#include - namespace PlayFab { class CallRequestContainerBase; diff --git a/code/include/playfab/PlayFabClientApi.h b/code/include/playfab/PlayFabClientApi.h index 3d80c7d3..09de4312 100644 --- a/code/include/playfab/PlayFabClientApi.h +++ b/code/include/playfab/PlayFabClientApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Client APIs /// @@ -347,4 +350,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABCLIENT_API +#endif // #if !defined(DISABLE_PLAYFABCLIENT_API) diff --git a/code/include/playfab/PlayFabClientDataModels.h b/code/include/playfab/PlayFabClientDataModels.h index e80b2166..bf3177ec 100644 --- a/code/include/playfab/PlayFabClientDataModels.h +++ b/code/include/playfab/PlayFabClientDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include @@ -19383,7 +19383,6 @@ namespace PlayFab { Json::Value Body; // Not truly arbitrary. See documentation for restrictions on format std::string CharacterId; - std::map EventCustomTags; std::string EventName; Boxed Timestamp; @@ -19391,7 +19390,6 @@ namespace PlayFab PlayFabRequestCommon(), Body(), CharacterId(), - EventCustomTags(), EventName(), Timestamp() {} @@ -19400,7 +19398,6 @@ namespace PlayFab PlayFabRequestCommon(), Body(src.Body), CharacterId(src.CharacterId), - EventCustomTags(src.EventCustomTags), EventName(src.EventName), Timestamp(src.Timestamp) {} @@ -19411,7 +19408,6 @@ namespace PlayFab { Body = input["Body"]; FromJsonUtilS(input["CharacterId"], CharacterId); - FromJsonUtilS(input["EventCustomTags"], EventCustomTags); FromJsonUtilS(input["EventName"], EventName); FromJsonUtilT(input["Timestamp"], Timestamp); } @@ -19421,7 +19417,6 @@ namespace PlayFab Json::Value output; output["Body"] = Body; Json::Value each_CharacterId; ToJsonUtilS(CharacterId, each_CharacterId); output["CharacterId"] = each_CharacterId; - Json::Value each_EventCustomTags; ToJsonUtilS(EventCustomTags, each_EventCustomTags); output["EventCustomTags"] = each_EventCustomTags; Json::Value each_EventName; ToJsonUtilS(EventName, each_EventName); output["EventName"] = each_EventName; Json::Value each_Timestamp; ToJsonUtilT(Timestamp, each_Timestamp); output["Timestamp"] = each_Timestamp; return output; @@ -19431,14 +19426,12 @@ namespace PlayFab struct WriteClientPlayerEventRequest : public PlayFabRequestCommon { Json::Value Body; // Not truly arbitrary. See documentation for restrictions on format - std::map EventCustomTags; std::string EventName; Boxed Timestamp; WriteClientPlayerEventRequest() : PlayFabRequestCommon(), Body(), - EventCustomTags(), EventName(), Timestamp() {} @@ -19446,7 +19439,6 @@ namespace PlayFab WriteClientPlayerEventRequest(const WriteClientPlayerEventRequest& src) : PlayFabRequestCommon(), Body(src.Body), - EventCustomTags(src.EventCustomTags), EventName(src.EventName), Timestamp(src.Timestamp) {} @@ -19456,7 +19448,6 @@ namespace PlayFab void FromJson(const Json::Value& input) override { Body = input["Body"]; - FromJsonUtilS(input["EventCustomTags"], EventCustomTags); FromJsonUtilS(input["EventName"], EventName); FromJsonUtilT(input["Timestamp"], Timestamp); } @@ -19465,7 +19456,6 @@ namespace PlayFab { Json::Value output; output["Body"] = Body; - Json::Value each_EventCustomTags; ToJsonUtilS(EventCustomTags, each_EventCustomTags); output["EventCustomTags"] = each_EventCustomTags; Json::Value each_EventName; ToJsonUtilS(EventName, each_EventName); output["EventName"] = each_EventName; Json::Value each_Timestamp; ToJsonUtilT(Timestamp, each_Timestamp); output["Timestamp"] = each_Timestamp; return output; @@ -19504,14 +19494,12 @@ namespace PlayFab struct WriteTitleEventRequest : public PlayFabRequestCommon { Json::Value Body; // Not truly arbitrary. See documentation for restrictions on format - std::map EventCustomTags; std::string EventName; Boxed Timestamp; WriteTitleEventRequest() : PlayFabRequestCommon(), Body(), - EventCustomTags(), EventName(), Timestamp() {} @@ -19519,7 +19507,6 @@ namespace PlayFab WriteTitleEventRequest(const WriteTitleEventRequest& src) : PlayFabRequestCommon(), Body(src.Body), - EventCustomTags(src.EventCustomTags), EventName(src.EventName), Timestamp(src.Timestamp) {} @@ -19529,7 +19516,6 @@ namespace PlayFab void FromJson(const Json::Value& input) override { Body = input["Body"]; - FromJsonUtilS(input["EventCustomTags"], EventCustomTags); FromJsonUtilS(input["EventName"], EventName); FromJsonUtilT(input["Timestamp"], Timestamp); } @@ -19538,7 +19524,6 @@ namespace PlayFab { Json::Value output; output["Body"] = Body; - Json::Value each_EventCustomTags; ToJsonUtilS(EventCustomTags, each_EventCustomTags); output["EventCustomTags"] = each_EventCustomTags; Json::Value each_EventName; ToJsonUtilS(EventName, each_EventName); output["EventName"] = each_EventName; Json::Value each_Timestamp; ToJsonUtilT(Timestamp, each_Timestamp); output["Timestamp"] = each_Timestamp; return output; diff --git a/code/include/playfab/PlayFabClientInstanceApi.h b/code/include/playfab/PlayFabClientInstanceApi.h index cd89a669..f080ec8f 100644 --- a/code/include/playfab/PlayFabClientInstanceApi.h +++ b/code/include/playfab/PlayFabClientInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Client APIs /// diff --git a/code/include/playfab/PlayFabCloudScriptApi.h b/code/include/playfab/PlayFabCloudScriptApi.h index 6c421c16..ed3da54c 100644 --- a/code/include/playfab/PlayFabCloudScriptApi.h +++ b/code/include/playfab/PlayFabCloudScriptApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all CloudScript APIs /// @@ -31,4 +34,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabCloudScriptDataModels.h b/code/include/playfab/PlayFabCloudScriptDataModels.h index 5dfc2721..5fb4ca08 100644 --- a/code/include/playfab/PlayFabCloudScriptDataModels.h +++ b/code/include/playfab/PlayFabCloudScriptDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabCloudScriptInstanceApi.h b/code/include/playfab/PlayFabCloudScriptInstanceApi.h index e8f0b691..e675bcb0 100644 --- a/code/include/playfab/PlayFabCloudScriptInstanceApi.h +++ b/code/include/playfab/PlayFabCloudScriptInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all CloudScript APIs /// diff --git a/code/include/playfab/PlayFabDataApi.h b/code/include/playfab/PlayFabDataApi.h index 8f8ac8ca..d1cfa44f 100644 --- a/code/include/playfab/PlayFabDataApi.h +++ b/code/include/playfab/PlayFabDataApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Data APIs /// @@ -43,4 +46,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabDataDataModels.h b/code/include/playfab/PlayFabDataDataModels.h index 1a5df7d1..c9ee2693 100644 --- a/code/include/playfab/PlayFabDataDataModels.h +++ b/code/include/playfab/PlayFabDataDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabDataInstanceApi.h b/code/include/playfab/PlayFabDataInstanceApi.h index f6c0f251..68249786 100644 --- a/code/include/playfab/PlayFabDataInstanceApi.h +++ b/code/include/playfab/PlayFabDataInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Data APIs /// diff --git a/code/include/playfab/PlayFabError.h b/code/include/playfab/PlayFabError.h index 5cbc27db..9fcaf88b 100644 --- a/code/include/playfab/PlayFabError.h +++ b/code/include/playfab/PlayFabError.h @@ -496,6 +496,7 @@ namespace PlayFab PlayFabErrorInsightsManagementTitleInEvaluationMode = 1493, PlayFabErrorCloudScriptAzureFunctionsQueueRequestError = 1494, PlayFabErrorEvaluationModeTitleCountExceeded = 1495, + PlayFabErrorInsightsManagementTitleNotInFlight = 1496, PlayFabErrorMatchmakingEntityInvalid = 2001, PlayFabErrorMatchmakingPlayerAttributesInvalid = 2002, PlayFabErrorMatchmakingQueueNotFound = 2016, diff --git a/code/include/playfab/PlayFabEventPipeline.h b/code/include/playfab/PlayFabEventPipeline.h index b4b83915..d3c39f5a 100644 --- a/code/include/playfab/PlayFabEventPipeline.h +++ b/code/include/playfab/PlayFabEventPipeline.h @@ -7,10 +7,14 @@ #include #include + #include +#include namespace PlayFab { + class PlayFabEventsInstanceAPI; + enum class PlayFabEventPipelineType { PlayFabPlayStream, @@ -51,7 +55,7 @@ namespace PlayFab /// /// Implementation of PlayFab-specific event pipeline /// - class PlayFabEventPipeline: public IPlayFabEventPipeline + class PlayFabEventPipeline : public IPlayFabEventPipeline { public: explicit PlayFabEventPipeline(const std::shared_ptr& settings); @@ -87,6 +91,8 @@ namespace PlayFab std::vector> batch; private: + std::shared_ptr eventsApi; + std::shared_ptr settings; PlayFabEventBuffer buffer; std::thread workerThread; diff --git a/code/include/playfab/PlayFabEventRouter.h b/code/include/playfab/PlayFabEventRouter.h index e60ae975..d0282708 100644 --- a/code/include/playfab/PlayFabEventRouter.h +++ b/code/include/playfab/PlayFabEventRouter.h @@ -2,9 +2,10 @@ #ifndef DISABLE_PLAYFABENTITY_API -#include #include +#include + namespace PlayFab { /// @@ -33,7 +34,7 @@ namespace PlayFab /// /// Default implementation of event router /// - class PlayFabEventRouter: public IPlayFabEventRouter + class PlayFabEventRouter : public IPlayFabEventRouter { public: PlayFabEventRouter(); diff --git a/code/include/playfab/PlayFabEventsApi.h b/code/include/playfab/PlayFabEventsApi.h index fd5543c1..fecd1433 100644 --- a/code/include/playfab/PlayFabEventsApi.h +++ b/code/include/playfab/PlayFabEventsApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Events APIs /// @@ -33,4 +36,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabEventsDataModels.h b/code/include/playfab/PlayFabEventsDataModels.h index 114538ae..d202355a 100644 --- a/code/include/playfab/PlayFabEventsDataModels.h +++ b/code/include/playfab/PlayFabEventsDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabEventsInstanceApi.h b/code/include/playfab/PlayFabEventsInstanceApi.h index 632c6f6c..8a36af45 100644 --- a/code/include/playfab/PlayFabEventsInstanceApi.h +++ b/code/include/playfab/PlayFabEventsInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Events APIs /// diff --git a/code/include/playfab/PlayFabGroupsApi.h b/code/include/playfab/PlayFabGroupsApi.h index 538760f8..1e934f9f 100644 --- a/code/include/playfab/PlayFabGroupsApi.h +++ b/code/include/playfab/PlayFabGroupsApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Groups APIs /// @@ -79,4 +82,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabGroupsDataModels.h b/code/include/playfab/PlayFabGroupsDataModels.h index ea5115a5..ab988cb6 100644 --- a/code/include/playfab/PlayFabGroupsDataModels.h +++ b/code/include/playfab/PlayFabGroupsDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabGroupsInstanceApi.h b/code/include/playfab/PlayFabGroupsInstanceApi.h index c36e214f..1babbae0 100644 --- a/code/include/playfab/PlayFabGroupsInstanceApi.h +++ b/code/include/playfab/PlayFabGroupsInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Groups APIs /// diff --git a/code/include/playfab/PlayFabLocalizationApi.h b/code/include/playfab/PlayFabLocalizationApi.h index 313c35c5..1670286e 100644 --- a/code/include/playfab/PlayFabLocalizationApi.h +++ b/code/include/playfab/PlayFabLocalizationApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Localization APIs /// @@ -31,4 +34,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabLocalizationDataModels.h b/code/include/playfab/PlayFabLocalizationDataModels.h index 68cc120e..4493e838 100644 --- a/code/include/playfab/PlayFabLocalizationDataModels.h +++ b/code/include/playfab/PlayFabLocalizationDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabLocalizationInstanceApi.h b/code/include/playfab/PlayFabLocalizationInstanceApi.h index 0b48814d..9a340656 100644 --- a/code/include/playfab/PlayFabLocalizationInstanceApi.h +++ b/code/include/playfab/PlayFabLocalizationInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Localization APIs /// diff --git a/code/include/playfab/PlayFabMatchmakerApi.h b/code/include/playfab/PlayFabMatchmakerApi.h index 3fe31489..28609ce4 100644 --- a/code/include/playfab/PlayFabMatchmakerApi.h +++ b/code/include/playfab/PlayFabMatchmakerApi.h @@ -1,12 +1,15 @@ #pragma once -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Matchmaker APIs /// @@ -39,4 +42,4 @@ namespace PlayFab }; } -#endif // #ifdef ENABLE_PLAYFABSERVER_API +#endif // #if defined(ENABLE_PLAYFABSERVER_API) diff --git a/code/include/playfab/PlayFabMatchmakerDataModels.h b/code/include/playfab/PlayFabMatchmakerDataModels.h index 35e2b2bc..1ad95440 100644 --- a/code/include/playfab/PlayFabMatchmakerDataModels.h +++ b/code/include/playfab/PlayFabMatchmakerDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) #include #include diff --git a/code/include/playfab/PlayFabMatchmakerInstanceApi.h b/code/include/playfab/PlayFabMatchmakerInstanceApi.h index 35d5321d..3dcf84aa 100644 --- a/code/include/playfab/PlayFabMatchmakerInstanceApi.h +++ b/code/include/playfab/PlayFabMatchmakerInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Matchmaker APIs /// diff --git a/code/include/playfab/PlayFabMultiplayerApi.h b/code/include/playfab/PlayFabMultiplayerApi.h index 8b290090..7a63e11e 100644 --- a/code/include/playfab/PlayFabMultiplayerApi.h +++ b/code/include/playfab/PlayFabMultiplayerApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Multiplayer APIs /// @@ -19,12 +22,15 @@ namespace PlayFab // ------------ Generated API calls static void CancelAllMatchmakingTicketsForPlayer(MultiplayerModels::CancelAllMatchmakingTicketsForPlayerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void CancelAllServerBackfillTicketsForPlayer(MultiplayerModels::CancelAllServerBackfillTicketsForPlayerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CancelMatchmakingTicket(MultiplayerModels::CancelMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void CancelServerBackfillTicket(MultiplayerModels::CancelServerBackfillTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CreateBuildAlias(MultiplayerModels::CreateBuildAliasRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CreateBuildWithCustomContainer(MultiplayerModels::CreateBuildWithCustomContainerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CreateBuildWithManagedContainer(MultiplayerModels::CreateBuildWithManagedContainerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CreateMatchmakingTicket(MultiplayerModels::CreateMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CreateRemoteUser(MultiplayerModels::CreateRemoteUserRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void CreateServerBackfillTicket(MultiplayerModels::CreateServerBackfillTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void CreateServerMatchmakingTicket(MultiplayerModels::CreateServerMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void DeleteAsset(MultiplayerModels::DeleteAssetRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void DeleteBuild(MultiplayerModels::DeleteBuildRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -42,6 +48,7 @@ namespace PlayFab static void GetMultiplayerServerLogs(MultiplayerModels::GetMultiplayerServerLogsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetQueueStatistics(MultiplayerModels::GetQueueStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetRemoteLoginEndpoint(MultiplayerModels::GetRemoteLoginEndpointRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetServerBackfillTicket(MultiplayerModels::GetServerBackfillTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetTitleEnabledForMultiplayerServersStatus(MultiplayerModels::GetTitleEnabledForMultiplayerServersStatusRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetTitleMultiplayerServersQuotas(MultiplayerModels::GetTitleMultiplayerServersQuotasRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void JoinMatchmakingTicket(MultiplayerModels::JoinMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -57,6 +64,7 @@ namespace PlayFab static void ListPartyQosServers(MultiplayerModels::ListPartyQosServersRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void ListQosServers(MultiplayerModels::ListQosServersRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void ListQosServersForTitle(MultiplayerModels::ListQosServersForTitleRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void ListServerBackfillTicketsForPlayer(MultiplayerModels::ListServerBackfillTicketsForPlayerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void ListVirtualMachineSummaries(MultiplayerModels::ListVirtualMachineSummariesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void RequestMultiplayerServer(MultiplayerModels::RequestMultiplayerServerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void RolloverContainerRegistryCredentials(MultiplayerModels::RolloverContainerRegistryCredentialsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -72,12 +80,15 @@ namespace PlayFab // ------------ Generated result handlers static void OnCancelAllMatchmakingTicketsForPlayerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnCancelAllServerBackfillTicketsForPlayerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCancelMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnCancelServerBackfillTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCreateBuildAliasResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCreateBuildWithCustomContainerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCreateBuildWithManagedContainerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCreateMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCreateRemoteUserResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnCreateServerBackfillTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnCreateServerMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnDeleteAssetResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnDeleteBuildResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -95,6 +106,7 @@ namespace PlayFab static void OnGetMultiplayerServerLogsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetQueueStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetRemoteLoginEndpointResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetServerBackfillTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetTitleEnabledForMultiplayerServersStatusResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetTitleMultiplayerServersQuotasResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnJoinMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -110,6 +122,7 @@ namespace PlayFab static void OnListPartyQosServersResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnListQosServersResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnListQosServersForTitleResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnListServerBackfillTicketsForPlayerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnListVirtualMachineSummariesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnRequestMultiplayerServerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnRolloverContainerRegistryCredentialsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -123,4 +136,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabMultiplayerDataModels.h b/code/include/playfab/PlayFabMultiplayerDataModels.h index 454038b6..4189f8f7 100644 --- a/code/include/playfab/PlayFabMultiplayerDataModels.h +++ b/code/include/playfab/PlayFabMultiplayerDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -1304,6 +1304,64 @@ namespace PlayFab } }; + struct CancelAllServerBackfillTicketsForPlayerRequest : public PlayFabRequestCommon + { + EntityKey Entity; + std::string QueueName; + + CancelAllServerBackfillTicketsForPlayerRequest() : + PlayFabRequestCommon(), + Entity(), + QueueName() + {} + + CancelAllServerBackfillTicketsForPlayerRequest(const CancelAllServerBackfillTicketsForPlayerRequest& src) : + PlayFabRequestCommon(), + Entity(src.Entity), + QueueName(src.QueueName) + {} + + ~CancelAllServerBackfillTicketsForPlayerRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilS(input["QueueName"], QueueName); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_QueueName; ToJsonUtilS(QueueName, each_QueueName); output["QueueName"] = each_QueueName; + return output; + } + }; + + struct CancelAllServerBackfillTicketsForPlayerResult : public PlayFabResultCommon + { + + CancelAllServerBackfillTicketsForPlayerResult() : + PlayFabResultCommon() + {} + + CancelAllServerBackfillTicketsForPlayerResult(const CancelAllServerBackfillTicketsForPlayerResult&) : + PlayFabResultCommon() + {} + + ~CancelAllServerBackfillTicketsForPlayerResult() = default; + + void FromJson(const Json::Value&) override + { + } + + Json::Value ToJson() const override + { + Json::Value output; + return output; + } + }; + struct CancelMatchmakingTicketRequest : public PlayFabRequestCommon { std::string QueueName; @@ -1362,6 +1420,64 @@ namespace PlayFab } }; + struct CancelServerBackfillTicketRequest : public PlayFabRequestCommon + { + std::string QueueName; + std::string TicketId; + + CancelServerBackfillTicketRequest() : + PlayFabRequestCommon(), + QueueName(), + TicketId() + {} + + CancelServerBackfillTicketRequest(const CancelServerBackfillTicketRequest& src) : + PlayFabRequestCommon(), + QueueName(src.QueueName), + TicketId(src.TicketId) + {} + + ~CancelServerBackfillTicketRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["QueueName"], QueueName); + FromJsonUtilS(input["TicketId"], TicketId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_QueueName; ToJsonUtilS(QueueName, each_QueueName); output["QueueName"] = each_QueueName; + Json::Value each_TicketId; ToJsonUtilS(TicketId, each_TicketId); output["TicketId"] = each_TicketId; + return output; + } + }; + + struct CancelServerBackfillTicketResult : public PlayFabResultCommon + { + + CancelServerBackfillTicketResult() : + PlayFabResultCommon() + {} + + CancelServerBackfillTicketResult(const CancelServerBackfillTicketResult&) : + PlayFabResultCommon() + {} + + ~CancelServerBackfillTicketResult() = default; + + void FromJson(const Json::Value&) override + { + } + + Json::Value ToJson() const override + { + Json::Value output; + return output; + } + }; + struct Certificate : public PlayFabBaseModel { std::string Base64EncodedValue; @@ -2277,6 +2393,157 @@ namespace PlayFab } }; + struct MatchmakingPlayerWithTeamAssignment : public PlayFabBaseModel + { + Boxed Attributes; + EntityKey Entity; + std::string TeamId; + + MatchmakingPlayerWithTeamAssignment() : + PlayFabBaseModel(), + Attributes(), + Entity(), + TeamId() + {} + + MatchmakingPlayerWithTeamAssignment(const MatchmakingPlayerWithTeamAssignment& src) : + PlayFabBaseModel(), + Attributes(src.Attributes), + Entity(src.Entity), + TeamId(src.TeamId) + {} + + ~MatchmakingPlayerWithTeamAssignment() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Attributes"], Attributes); + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilS(input["TeamId"], TeamId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Attributes; ToJsonUtilO(Attributes, each_Attributes); output["Attributes"] = each_Attributes; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_TeamId; ToJsonUtilS(TeamId, each_TeamId); output["TeamId"] = each_TeamId; + return output; + } + }; + + struct ServerDetails : public PlayFabBaseModel + { + std::string IPV4Address; + std::list Ports; + std::string Region; + + ServerDetails() : + PlayFabBaseModel(), + IPV4Address(), + Ports(), + Region() + {} + + ServerDetails(const ServerDetails& src) : + PlayFabBaseModel(), + IPV4Address(src.IPV4Address), + Ports(src.Ports), + Region(src.Region) + {} + + ~ServerDetails() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["IPV4Address"], IPV4Address); + FromJsonUtilO(input["Ports"], Ports); + FromJsonUtilS(input["Region"], Region); + } + + Json::Value ToJson() const override + { + Json::Value output; + 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; + return output; + } + }; + + struct CreateServerBackfillTicketRequest : public PlayFabRequestCommon + { + Int32 GiveUpAfterSeconds; + std::list Members; + std::string QueueName; + Boxed pfServerDetails; + + CreateServerBackfillTicketRequest() : + PlayFabRequestCommon(), + GiveUpAfterSeconds(), + Members(), + QueueName(), + pfServerDetails() + {} + + CreateServerBackfillTicketRequest(const CreateServerBackfillTicketRequest& src) : + PlayFabRequestCommon(), + GiveUpAfterSeconds(src.GiveUpAfterSeconds), + Members(src.Members), + QueueName(src.QueueName), + pfServerDetails(src.pfServerDetails) + {} + + ~CreateServerBackfillTicketRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["GiveUpAfterSeconds"], GiveUpAfterSeconds); + FromJsonUtilO(input["Members"], Members); + FromJsonUtilS(input["QueueName"], QueueName); + FromJsonUtilO(input["ServerDetails"], pfServerDetails); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_GiveUpAfterSeconds; ToJsonUtilP(GiveUpAfterSeconds, each_GiveUpAfterSeconds); output["GiveUpAfterSeconds"] = each_GiveUpAfterSeconds; + Json::Value each_Members; ToJsonUtilO(Members, each_Members); output["Members"] = each_Members; + Json::Value each_QueueName; ToJsonUtilS(QueueName, each_QueueName); output["QueueName"] = each_QueueName; + Json::Value each_pfServerDetails; ToJsonUtilO(pfServerDetails, each_pfServerDetails); output["ServerDetails"] = each_pfServerDetails; + return output; + } + }; + + struct CreateServerBackfillTicketResult : public PlayFabResultCommon + { + std::string TicketId; + + CreateServerBackfillTicketResult() : + PlayFabResultCommon(), + TicketId() + {} + + CreateServerBackfillTicketResult(const CreateServerBackfillTicketResult& src) : + PlayFabResultCommon(), + TicketId(src.TicketId) + {} + + ~CreateServerBackfillTicketResult() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["TicketId"], TicketId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_TicketId; ToJsonUtilS(TicketId, each_TicketId); output["TicketId"] = each_TicketId; + return output; + } + }; + struct CreateServerMatchmakingTicketRequest : public PlayFabRequestCommon { Int32 GiveUpAfterSeconds; @@ -2882,7 +3149,6 @@ namespace PlayFab struct GetMatchmakingTicketResult : public PlayFabResultCommon { - Boxed pfCancellationReason; std::string CancellationReasonString; time_t Created; EntityKey Creator; @@ -2896,7 +3162,6 @@ namespace PlayFab GetMatchmakingTicketResult() : PlayFabResultCommon(), - pfCancellationReason(), CancellationReasonString(), Created(), Creator(), @@ -2911,7 +3176,6 @@ namespace PlayFab GetMatchmakingTicketResult(const GetMatchmakingTicketResult& src) : PlayFabResultCommon(), - pfCancellationReason(src.pfCancellationReason), CancellationReasonString(src.CancellationReasonString), Created(src.Created), Creator(src.Creator), @@ -2928,7 +3192,6 @@ namespace PlayFab void FromJson(const Json::Value& input) override { - FromJsonUtilE(input["CancellationReason"], pfCancellationReason); FromJsonUtilS(input["CancellationReasonString"], CancellationReasonString); FromJsonUtilT(input["Created"], Created); FromJsonUtilO(input["Creator"], Creator); @@ -2944,7 +3207,6 @@ namespace PlayFab Json::Value ToJson() const override { Json::Value output; - Json::Value each_pfCancellationReason; ToJsonUtilE(pfCancellationReason, each_pfCancellationReason); output["CancellationReason"] = each_pfCancellationReason; Json::Value each_CancellationReasonString; ToJsonUtilS(CancellationReasonString, each_CancellationReasonString); output["CancellationReasonString"] = each_CancellationReasonString; Json::Value each_Created; ToJsonUtilT(Created, each_Created); output["Created"] = each_Created; Json::Value each_Creator; ToJsonUtilO(Creator, each_Creator); output["Creator"] = each_Creator; @@ -3003,84 +3265,6 @@ namespace PlayFab } }; - struct MatchmakingPlayerWithTeamAssignment : public PlayFabBaseModel - { - Boxed Attributes; - EntityKey Entity; - std::string TeamId; - - MatchmakingPlayerWithTeamAssignment() : - PlayFabBaseModel(), - Attributes(), - Entity(), - TeamId() - {} - - MatchmakingPlayerWithTeamAssignment(const MatchmakingPlayerWithTeamAssignment& src) : - PlayFabBaseModel(), - Attributes(src.Attributes), - Entity(src.Entity), - TeamId(src.TeamId) - {} - - ~MatchmakingPlayerWithTeamAssignment() = default; - - void FromJson(const Json::Value& input) override - { - FromJsonUtilO(input["Attributes"], Attributes); - FromJsonUtilO(input["Entity"], Entity); - FromJsonUtilS(input["TeamId"], TeamId); - } - - Json::Value ToJson() const override - { - Json::Value output; - Json::Value each_Attributes; ToJsonUtilO(Attributes, each_Attributes); output["Attributes"] = each_Attributes; - Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; - Json::Value each_TeamId; ToJsonUtilS(TeamId, each_TeamId); output["TeamId"] = each_TeamId; - return output; - } - }; - - struct ServerDetails : public PlayFabBaseModel - { - std::string IPV4Address; - std::list Ports; - std::string Region; - - ServerDetails() : - PlayFabBaseModel(), - IPV4Address(), - Ports(), - Region() - {} - - ServerDetails(const ServerDetails& src) : - PlayFabBaseModel(), - IPV4Address(src.IPV4Address), - Ports(src.Ports), - Region(src.Region) - {} - - ~ServerDetails() = default; - - void FromJson(const Json::Value& input) override - { - FromJsonUtilS(input["IPV4Address"], IPV4Address); - FromJsonUtilO(input["Ports"], Ports); - FromJsonUtilS(input["Region"], Region); - } - - Json::Value ToJson() const override - { - Json::Value output; - 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; - return output; - } - }; - struct GetMatchResult : public PlayFabResultCommon { std::string MatchId; @@ -3481,6 +3665,114 @@ namespace PlayFab } }; + struct GetServerBackfillTicketRequest : public PlayFabRequestCommon + { + bool EscapeObject; + std::string QueueName; + std::string TicketId; + + GetServerBackfillTicketRequest() : + PlayFabRequestCommon(), + EscapeObject(), + QueueName(), + TicketId() + {} + + GetServerBackfillTicketRequest(const GetServerBackfillTicketRequest& src) : + PlayFabRequestCommon(), + EscapeObject(src.EscapeObject), + QueueName(src.QueueName), + TicketId(src.TicketId) + {} + + ~GetServerBackfillTicketRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["EscapeObject"], EscapeObject); + FromJsonUtilS(input["QueueName"], QueueName); + FromJsonUtilS(input["TicketId"], TicketId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_EscapeObject; ToJsonUtilP(EscapeObject, each_EscapeObject); output["EscapeObject"] = each_EscapeObject; + Json::Value each_QueueName; ToJsonUtilS(QueueName, each_QueueName); output["QueueName"] = each_QueueName; + Json::Value each_TicketId; ToJsonUtilS(TicketId, each_TicketId); output["TicketId"] = each_TicketId; + return output; + } + }; + + struct GetServerBackfillTicketResult : public PlayFabResultCommon + { + std::string CancellationReasonString; + time_t Created; + Int32 GiveUpAfterSeconds; + std::string MatchId; + std::list Members; + std::string QueueName; + ServerDetails pfServerDetails; + std::string Status; + std::string TicketId; + + GetServerBackfillTicketResult() : + PlayFabResultCommon(), + CancellationReasonString(), + Created(), + GiveUpAfterSeconds(), + MatchId(), + Members(), + QueueName(), + pfServerDetails(), + Status(), + TicketId() + {} + + GetServerBackfillTicketResult(const GetServerBackfillTicketResult& src) : + PlayFabResultCommon(), + CancellationReasonString(src.CancellationReasonString), + Created(src.Created), + GiveUpAfterSeconds(src.GiveUpAfterSeconds), + MatchId(src.MatchId), + Members(src.Members), + QueueName(src.QueueName), + pfServerDetails(src.pfServerDetails), + Status(src.Status), + TicketId(src.TicketId) + {} + + ~GetServerBackfillTicketResult() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["CancellationReasonString"], CancellationReasonString); + FromJsonUtilT(input["Created"], Created); + FromJsonUtilP(input["GiveUpAfterSeconds"], GiveUpAfterSeconds); + FromJsonUtilS(input["MatchId"], MatchId); + FromJsonUtilO(input["Members"], Members); + FromJsonUtilS(input["QueueName"], QueueName); + FromJsonUtilO(input["ServerDetails"], pfServerDetails); + FromJsonUtilS(input["Status"], Status); + FromJsonUtilS(input["TicketId"], TicketId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_CancellationReasonString; ToJsonUtilS(CancellationReasonString, each_CancellationReasonString); output["CancellationReasonString"] = each_CancellationReasonString; + Json::Value each_Created; ToJsonUtilT(Created, each_Created); output["Created"] = each_Created; + Json::Value each_GiveUpAfterSeconds; ToJsonUtilP(GiveUpAfterSeconds, each_GiveUpAfterSeconds); output["GiveUpAfterSeconds"] = each_GiveUpAfterSeconds; + Json::Value each_MatchId; ToJsonUtilS(MatchId, each_MatchId); output["MatchId"] = each_MatchId; + Json::Value each_Members; ToJsonUtilO(Members, each_Members); output["Members"] = each_Members; + Json::Value each_QueueName; ToJsonUtilS(QueueName, each_QueueName); output["QueueName"] = each_QueueName; + Json::Value each_pfServerDetails; ToJsonUtilO(pfServerDetails, each_pfServerDetails); output["ServerDetails"] = each_pfServerDetails; + Json::Value each_Status; ToJsonUtilS(Status, each_Status); output["Status"] = each_Status; + Json::Value each_TicketId; ToJsonUtilS(TicketId, each_TicketId); output["TicketId"] = each_TicketId; + return output; + } + }; + struct GetTitleEnabledForMultiplayerServersStatusRequest : public PlayFabRequestCommon { @@ -4491,6 +4783,69 @@ namespace PlayFab } }; + struct ListServerBackfillTicketsForPlayerRequest : public PlayFabRequestCommon + { + EntityKey Entity; + std::string QueueName; + + ListServerBackfillTicketsForPlayerRequest() : + PlayFabRequestCommon(), + Entity(), + QueueName() + {} + + ListServerBackfillTicketsForPlayerRequest(const ListServerBackfillTicketsForPlayerRequest& src) : + PlayFabRequestCommon(), + Entity(src.Entity), + QueueName(src.QueueName) + {} + + ~ListServerBackfillTicketsForPlayerRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Entity"], Entity); + FromJsonUtilS(input["QueueName"], QueueName); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Entity; ToJsonUtilO(Entity, each_Entity); output["Entity"] = each_Entity; + Json::Value each_QueueName; ToJsonUtilS(QueueName, each_QueueName); output["QueueName"] = each_QueueName; + return output; + } + }; + + struct ListServerBackfillTicketsForPlayerResult : public PlayFabResultCommon + { + std::list TicketIds; + + ListServerBackfillTicketsForPlayerResult() : + PlayFabResultCommon(), + TicketIds() + {} + + ListServerBackfillTicketsForPlayerResult(const ListServerBackfillTicketsForPlayerResult& src) : + PlayFabResultCommon(), + TicketIds(src.TicketIds) + {} + + ~ListServerBackfillTicketsForPlayerResult() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["TicketIds"], TicketIds); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_TicketIds; ToJsonUtilS(TicketIds, each_TicketIds); output["TicketIds"] = each_TicketIds; + return output; + } + }; + struct ListVirtualMachineSummariesRequest : public PlayFabRequestCommon { std::string BuildId; diff --git a/code/include/playfab/PlayFabMultiplayerInstanceApi.h b/code/include/playfab/PlayFabMultiplayerInstanceApi.h index 3ccfa67c..36aec841 100644 --- a/code/include/playfab/PlayFabMultiplayerInstanceApi.h +++ b/code/include/playfab/PlayFabMultiplayerInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Multiplayer APIs /// @@ -35,12 +38,15 @@ namespace PlayFab // ------------ Generated API calls void CancelAllMatchmakingTicketsForPlayer(MultiplayerModels::CancelAllMatchmakingTicketsForPlayerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void CancelAllServerBackfillTicketsForPlayer(MultiplayerModels::CancelAllServerBackfillTicketsForPlayerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CancelMatchmakingTicket(MultiplayerModels::CancelMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void CancelServerBackfillTicket(MultiplayerModels::CancelServerBackfillTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CreateBuildAlias(MultiplayerModels::CreateBuildAliasRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CreateBuildWithCustomContainer(MultiplayerModels::CreateBuildWithCustomContainerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CreateBuildWithManagedContainer(MultiplayerModels::CreateBuildWithManagedContainerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CreateMatchmakingTicket(MultiplayerModels::CreateMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CreateRemoteUser(MultiplayerModels::CreateRemoteUserRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void CreateServerBackfillTicket(MultiplayerModels::CreateServerBackfillTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void CreateServerMatchmakingTicket(MultiplayerModels::CreateServerMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void DeleteAsset(MultiplayerModels::DeleteAssetRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void DeleteBuild(MultiplayerModels::DeleteBuildRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -58,6 +64,7 @@ namespace PlayFab void GetMultiplayerServerLogs(MultiplayerModels::GetMultiplayerServerLogsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetQueueStatistics(MultiplayerModels::GetQueueStatisticsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetRemoteLoginEndpoint(MultiplayerModels::GetRemoteLoginEndpointRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetServerBackfillTicket(MultiplayerModels::GetServerBackfillTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetTitleEnabledForMultiplayerServersStatus(MultiplayerModels::GetTitleEnabledForMultiplayerServersStatusRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetTitleMultiplayerServersQuotas(MultiplayerModels::GetTitleMultiplayerServersQuotasRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void JoinMatchmakingTicket(MultiplayerModels::JoinMatchmakingTicketRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -73,6 +80,7 @@ namespace PlayFab void ListPartyQosServers(MultiplayerModels::ListPartyQosServersRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void ListQosServers(MultiplayerModels::ListQosServersRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void ListQosServersForTitle(MultiplayerModels::ListQosServersForTitleRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void ListServerBackfillTicketsForPlayer(MultiplayerModels::ListServerBackfillTicketsForPlayerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void ListVirtualMachineSummaries(MultiplayerModels::ListVirtualMachineSummariesRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void RequestMultiplayerServer(MultiplayerModels::RequestMultiplayerServerRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void RolloverContainerRegistryCredentials(MultiplayerModels::RolloverContainerRegistryCredentialsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -84,12 +92,15 @@ namespace PlayFab // ------------ Generated result handlers void OnCancelAllMatchmakingTicketsForPlayerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnCancelAllServerBackfillTicketsForPlayerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCancelMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnCancelServerBackfillTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCreateBuildAliasResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCreateBuildWithCustomContainerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCreateBuildWithManagedContainerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCreateMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCreateRemoteUserResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnCreateServerBackfillTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnCreateServerMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnDeleteAssetResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnDeleteBuildResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -107,6 +118,7 @@ namespace PlayFab void OnGetMultiplayerServerLogsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetQueueStatisticsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetRemoteLoginEndpointResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetServerBackfillTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetTitleEnabledForMultiplayerServersStatusResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetTitleMultiplayerServersQuotasResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnJoinMatchmakingTicketResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -122,6 +134,7 @@ namespace PlayFab void OnListPartyQosServersResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnListQosServersResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnListQosServersForTitleResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnListServerBackfillTicketsForPlayerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnListVirtualMachineSummariesResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnRequestMultiplayerServerResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnRolloverContainerRegistryCredentialsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); diff --git a/code/include/playfab/PlayFabProfilesApi.h b/code/include/playfab/PlayFabProfilesApi.h index 21ab0bdc..a2141e0c 100644 --- a/code/include/playfab/PlayFabProfilesApi.h +++ b/code/include/playfab/PlayFabProfilesApi.h @@ -1,12 +1,15 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Profiles APIs /// @@ -43,4 +46,4 @@ namespace PlayFab }; } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) diff --git a/code/include/playfab/PlayFabProfilesDataModels.h b/code/include/playfab/PlayFabProfilesDataModels.h index 5ca6a7d2..809481b0 100644 --- a/code/include/playfab/PlayFabProfilesDataModels.h +++ b/code/include/playfab/PlayFabProfilesDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include diff --git a/code/include/playfab/PlayFabProfilesInstanceApi.h b/code/include/playfab/PlayFabProfilesInstanceApi.h index 4d59aab2..96eb554c 100644 --- a/code/include/playfab/PlayFabProfilesInstanceApi.h +++ b/code/include/playfab/PlayFabProfilesInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Profiles APIs /// diff --git a/code/include/playfab/PlayFabServerApi.h b/code/include/playfab/PlayFabServerApi.h index fdb02f4b..7af4e372 100644 --- a/code/include/playfab/PlayFabServerApi.h +++ b/code/include/playfab/PlayFabServerApi.h @@ -1,12 +1,15 @@ #pragma once -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) -#include #include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + /// /// Main interface for PlayFab Sdk, specifically all Server APIs /// @@ -88,6 +91,7 @@ namespace PlayFab static void GrantItemsToCharacter(ServerModels::GrantItemsToCharacterRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GrantItemsToUser(ServerModels::GrantItemsToUserRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GrantItemsToUsers(ServerModels::GrantItemsToUsersRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void LinkPSNAccount(ServerModels::LinkPSNAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void LinkServerCustomId(ServerModels::LinkServerCustomIdRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void LinkXboxAccount(ServerModels::LinkXboxAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void LoginWithServerCustomId(ServerModels::LoginWithServerCustomIdRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -126,6 +130,7 @@ namespace PlayFab static void SetTitleInternalData(ServerModels::SetTitleDataRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void SubtractCharacterVirtualCurrency(ServerModels::SubtractCharacterVirtualCurrencyRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void SubtractUserVirtualCurrency(ServerModels::SubtractUserVirtualCurrencyRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void UnlinkPSNAccount(ServerModels::UnlinkPSNAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void UnlinkServerCustomId(ServerModels::UnlinkServerCustomIdRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void UnlinkXboxAccount(ServerModels::UnlinkXboxAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void UnlockContainerInstance(ServerModels::UnlockContainerInstanceRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -224,6 +229,7 @@ namespace PlayFab static void OnGrantItemsToCharacterResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGrantItemsToUserResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGrantItemsToUsersResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnLinkPSNAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnLinkServerCustomIdResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnLinkXboxAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnLoginWithServerCustomIdResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -262,6 +268,7 @@ namespace PlayFab static void OnSetTitleInternalDataResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnSubtractCharacterVirtualCurrencyResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnSubtractUserVirtualCurrencyResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnUnlinkPSNAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnUnlinkServerCustomIdResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnUnlinkXboxAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnUnlockContainerInstanceResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -289,4 +296,4 @@ namespace PlayFab }; } -#endif // #ifdef ENABLE_PLAYFABSERVER_API +#endif // #if defined(ENABLE_PLAYFABSERVER_API) diff --git a/code/include/playfab/PlayFabServerDataModels.h b/code/include/playfab/PlayFabServerDataModels.h index 6baa22bc..d9afa654 100644 --- a/code/include/playfab/PlayFabServerDataModels.h +++ b/code/include/playfab/PlayFabServerDataModels.h @@ -1,6 +1,6 @@ #pragma once -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) #include #include @@ -5279,6 +5279,7 @@ namespace PlayFab GenericErrorCodesInsightsManagementTitleInEvaluationMode, GenericErrorCodesCloudScriptAzureFunctionsQueueRequestError, GenericErrorCodesEvaluationModeTitleCountExceeded, + GenericErrorCodesInsightsManagementTitleNotInFlight, GenericErrorCodesMatchmakingEntityInvalid, GenericErrorCodesMatchmakingPlayerAttributesInvalid, GenericErrorCodesMatchmakingQueueNotFound, @@ -7781,6 +7782,11 @@ namespace PlayFab output = Json::Value("EvaluationModeTitleCountExceeded"); return; } + if (input == GenericErrorCodes::GenericErrorCodesInsightsManagementTitleNotInFlight) + { + output = Json::Value("InsightsManagementTitleNotInFlight"); + return; + } if (input == GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid) { output = Json::Value("MatchmakingEntityInvalid"); @@ -10579,6 +10585,11 @@ namespace PlayFab output = GenericErrorCodes::GenericErrorCodesEvaluationModeTitleCountExceeded; return; } + if (inputStr == "InsightsManagementTitleNotInFlight") + { + output = GenericErrorCodes::GenericErrorCodesInsightsManagementTitleNotInFlight; + return; + } if (inputStr == "MatchmakingEntityInvalid") { output = GenericErrorCodes::GenericErrorCodesMatchmakingEntityInvalid; @@ -19817,6 +19828,79 @@ namespace PlayFab } }; + struct LinkPSNAccountRequest : public PlayFabRequestCommon + { + std::string AuthCode; + Boxed ForceLink; + Boxed IssuerId; + std::string PlayFabId; + std::string RedirectUri; + + LinkPSNAccountRequest() : + PlayFabRequestCommon(), + AuthCode(), + ForceLink(), + IssuerId(), + PlayFabId(), + RedirectUri() + {} + + LinkPSNAccountRequest(const LinkPSNAccountRequest& src) : + PlayFabRequestCommon(), + AuthCode(src.AuthCode), + ForceLink(src.ForceLink), + IssuerId(src.IssuerId), + PlayFabId(src.PlayFabId), + RedirectUri(src.RedirectUri) + {} + + ~LinkPSNAccountRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["AuthCode"], AuthCode); + FromJsonUtilP(input["ForceLink"], ForceLink); + FromJsonUtilP(input["IssuerId"], IssuerId); + FromJsonUtilS(input["PlayFabId"], PlayFabId); + FromJsonUtilS(input["RedirectUri"], RedirectUri); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_AuthCode; ToJsonUtilS(AuthCode, each_AuthCode); output["AuthCode"] = each_AuthCode; + Json::Value each_ForceLink; ToJsonUtilP(ForceLink, each_ForceLink); output["ForceLink"] = each_ForceLink; + Json::Value each_IssuerId; ToJsonUtilP(IssuerId, each_IssuerId); output["IssuerId"] = each_IssuerId; + Json::Value each_PlayFabId; ToJsonUtilS(PlayFabId, each_PlayFabId); output["PlayFabId"] = each_PlayFabId; + Json::Value each_RedirectUri; ToJsonUtilS(RedirectUri, each_RedirectUri); output["RedirectUri"] = each_RedirectUri; + return output; + } + }; + + struct LinkPSNAccountResult : public PlayFabResultCommon + { + + LinkPSNAccountResult() : + PlayFabResultCommon() + {} + + LinkPSNAccountResult(const LinkPSNAccountResult&) : + PlayFabResultCommon() + {} + + ~LinkPSNAccountResult() = default; + + void FromJson(const Json::Value&) override + { + } + + Json::Value ToJson() const override + { + Json::Value output; + return output; + } + }; + struct LinkServerCustomIdRequest : public PlayFabRequestCommon { Boxed ForceLink; @@ -22474,6 +22558,59 @@ namespace PlayFab } }; + struct UnlinkPSNAccountRequest : public PlayFabRequestCommon + { + std::string PlayFabId; + + UnlinkPSNAccountRequest() : + PlayFabRequestCommon(), + PlayFabId() + {} + + UnlinkPSNAccountRequest(const UnlinkPSNAccountRequest& src) : + PlayFabRequestCommon(), + PlayFabId(src.PlayFabId) + {} + + ~UnlinkPSNAccountRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["PlayFabId"], PlayFabId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_PlayFabId; ToJsonUtilS(PlayFabId, each_PlayFabId); output["PlayFabId"] = each_PlayFabId; + return output; + } + }; + + struct UnlinkPSNAccountResult : public PlayFabResultCommon + { + + UnlinkPSNAccountResult() : + PlayFabResultCommon() + {} + + UnlinkPSNAccountResult(const UnlinkPSNAccountResult&) : + PlayFabResultCommon() + {} + + ~UnlinkPSNAccountResult() = default; + + void FromJson(const Json::Value&) override + { + } + + Json::Value ToJson() const override + { + Json::Value output; + return output; + } + }; + struct UnlinkServerCustomIdRequest : public PlayFabRequestCommon { std::string PlayFabId; @@ -23344,7 +23481,6 @@ namespace PlayFab { Json::Value Body; // Not truly arbitrary. See documentation for restrictions on format std::string CharacterId; - std::map EventCustomTags; std::string EventName; std::string PlayFabId; Boxed Timestamp; @@ -23353,7 +23489,6 @@ namespace PlayFab PlayFabRequestCommon(), Body(), CharacterId(), - EventCustomTags(), EventName(), PlayFabId(), Timestamp() @@ -23363,7 +23498,6 @@ namespace PlayFab PlayFabRequestCommon(), Body(src.Body), CharacterId(src.CharacterId), - EventCustomTags(src.EventCustomTags), EventName(src.EventName), PlayFabId(src.PlayFabId), Timestamp(src.Timestamp) @@ -23375,7 +23509,6 @@ namespace PlayFab { Body = input["Body"]; FromJsonUtilS(input["CharacterId"], CharacterId); - FromJsonUtilS(input["EventCustomTags"], EventCustomTags); FromJsonUtilS(input["EventName"], EventName); FromJsonUtilS(input["PlayFabId"], PlayFabId); FromJsonUtilT(input["Timestamp"], Timestamp); @@ -23386,7 +23519,6 @@ namespace PlayFab Json::Value output; output["Body"] = Body; Json::Value each_CharacterId; ToJsonUtilS(CharacterId, each_CharacterId); output["CharacterId"] = each_CharacterId; - Json::Value each_EventCustomTags; ToJsonUtilS(EventCustomTags, each_EventCustomTags); output["EventCustomTags"] = each_EventCustomTags; Json::Value each_EventName; ToJsonUtilS(EventName, each_EventName); output["EventName"] = each_EventName; Json::Value each_PlayFabId; ToJsonUtilS(PlayFabId, each_PlayFabId); output["PlayFabId"] = each_PlayFabId; Json::Value each_Timestamp; ToJsonUtilT(Timestamp, each_Timestamp); output["Timestamp"] = each_Timestamp; @@ -23397,7 +23529,6 @@ namespace PlayFab struct WriteServerPlayerEventRequest : public PlayFabRequestCommon { Json::Value Body; // Not truly arbitrary. See documentation for restrictions on format - std::map EventCustomTags; std::string EventName; std::string PlayFabId; Boxed Timestamp; @@ -23405,7 +23536,6 @@ namespace PlayFab WriteServerPlayerEventRequest() : PlayFabRequestCommon(), Body(), - EventCustomTags(), EventName(), PlayFabId(), Timestamp() @@ -23414,7 +23544,6 @@ namespace PlayFab WriteServerPlayerEventRequest(const WriteServerPlayerEventRequest& src) : PlayFabRequestCommon(), Body(src.Body), - EventCustomTags(src.EventCustomTags), EventName(src.EventName), PlayFabId(src.PlayFabId), Timestamp(src.Timestamp) @@ -23425,7 +23554,6 @@ namespace PlayFab void FromJson(const Json::Value& input) override { Body = input["Body"]; - FromJsonUtilS(input["EventCustomTags"], EventCustomTags); FromJsonUtilS(input["EventName"], EventName); FromJsonUtilS(input["PlayFabId"], PlayFabId); FromJsonUtilT(input["Timestamp"], Timestamp); @@ -23435,7 +23563,6 @@ namespace PlayFab { Json::Value output; output["Body"] = Body; - Json::Value each_EventCustomTags; ToJsonUtilS(EventCustomTags, each_EventCustomTags); output["EventCustomTags"] = each_EventCustomTags; Json::Value each_EventName; ToJsonUtilS(EventName, each_EventName); output["EventName"] = each_EventName; Json::Value each_PlayFabId; ToJsonUtilS(PlayFabId, each_PlayFabId); output["PlayFabId"] = each_PlayFabId; Json::Value each_Timestamp; ToJsonUtilT(Timestamp, each_Timestamp); output["Timestamp"] = each_Timestamp; @@ -23446,14 +23573,12 @@ namespace PlayFab struct WriteTitleEventRequest : public PlayFabRequestCommon { Json::Value Body; // Not truly arbitrary. See documentation for restrictions on format - std::map EventCustomTags; std::string EventName; Boxed Timestamp; WriteTitleEventRequest() : PlayFabRequestCommon(), Body(), - EventCustomTags(), EventName(), Timestamp() {} @@ -23461,7 +23586,6 @@ namespace PlayFab WriteTitleEventRequest(const WriteTitleEventRequest& src) : PlayFabRequestCommon(), Body(src.Body), - EventCustomTags(src.EventCustomTags), EventName(src.EventName), Timestamp(src.Timestamp) {} @@ -23471,7 +23595,6 @@ namespace PlayFab void FromJson(const Json::Value& input) override { Body = input["Body"]; - FromJsonUtilS(input["EventCustomTags"], EventCustomTags); FromJsonUtilS(input["EventName"], EventName); FromJsonUtilT(input["Timestamp"], Timestamp); } @@ -23480,7 +23603,6 @@ namespace PlayFab { Json::Value output; output["Body"] = Body; - Json::Value each_EventCustomTags; ToJsonUtilS(EventCustomTags, each_EventCustomTags); output["EventCustomTags"] = each_EventCustomTags; Json::Value each_EventName; ToJsonUtilS(EventName, each_EventName); output["EventName"] = each_EventName; Json::Value each_Timestamp; ToJsonUtilT(Timestamp, each_Timestamp); output["Timestamp"] = each_Timestamp; return output; diff --git a/code/include/playfab/PlayFabServerInstanceApi.h b/code/include/playfab/PlayFabServerInstanceApi.h index 7f3caa08..9d8b283e 100644 --- a/code/include/playfab/PlayFabServerInstanceApi.h +++ b/code/include/playfab/PlayFabServerInstanceApi.h @@ -1,14 +1,17 @@ #pragma once -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) -#include -#include #include -#include +#include namespace PlayFab { + class CallRequestContainerBase; + class CallRequestContainer; + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// Main interface for PlayFab Sdk, specifically all Server APIs /// @@ -106,6 +109,7 @@ namespace PlayFab void GrantItemsToCharacter(ServerModels::GrantItemsToCharacterRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GrantItemsToUser(ServerModels::GrantItemsToUserRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GrantItemsToUsers(ServerModels::GrantItemsToUsersRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void LinkPSNAccount(ServerModels::LinkPSNAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void LinkServerCustomId(ServerModels::LinkServerCustomIdRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void LinkXboxAccount(ServerModels::LinkXboxAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void LoginWithServerCustomId(ServerModels::LoginWithServerCustomIdRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -144,6 +148,7 @@ namespace PlayFab void SetTitleInternalData(ServerModels::SetTitleDataRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void SubtractCharacterVirtualCurrency(ServerModels::SubtractCharacterVirtualCurrencyRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void SubtractUserVirtualCurrency(ServerModels::SubtractUserVirtualCurrencyRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void UnlinkPSNAccount(ServerModels::UnlinkPSNAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void UnlinkServerCustomId(ServerModels::UnlinkServerCustomIdRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void UnlinkXboxAccount(ServerModels::UnlinkXboxAccountRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void UnlockContainerInstance(ServerModels::UnlockContainerInstanceRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -238,6 +243,7 @@ namespace PlayFab void OnGrantItemsToCharacterResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGrantItemsToUserResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGrantItemsToUsersResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnLinkPSNAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnLinkServerCustomIdResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnLinkXboxAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnLoginWithServerCustomIdResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); @@ -276,6 +282,7 @@ namespace PlayFab void OnSetTitleInternalDataResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnSubtractCharacterVirtualCurrencyResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnSubtractUserVirtualCurrencyResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnUnlinkPSNAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnUnlinkServerCustomIdResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnUnlinkXboxAccountResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnUnlockContainerInstanceResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); diff --git a/code/include/playfab/PlayFabSettings.h b/code/include/playfab/PlayFabSettings.h index c3a33a73..9a2ebe69 100644 --- a/code/include/playfab/PlayFabSettings.h +++ b/code/include/playfab/PlayFabSettings.h @@ -1,11 +1,12 @@ #pragma once #include -#include -#include namespace PlayFab { + class PlayFabApiSettings; + class PlayFabAuthenticationContext; + /// /// All settings and global variables for PlayFab /// @@ -27,7 +28,7 @@ namespace PlayFab static const std::shared_ptr staticSettings; static const std::shared_ptr staticPlayer; -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) static const std::string AD_TYPE_IDFA; static const std::string AD_TYPE_ANDROID_ID; #endif diff --git a/code/include/playfab/QoS/PlayFabQoSApi.h b/code/include/playfab/QoS/PlayFabQoSApi.h index f17acbc7..71e318df 100644 --- a/code/include/playfab/QoS/PlayFabQoSApi.h +++ b/code/include/playfab/QoS/PlayFabQoSApi.h @@ -1,22 +1,28 @@ #pragma once -#include -#include #include #include #include -#include #include #include +#include +#include +#include + namespace PlayFab { + class PlayFabEventsInstanceAPI; + class PlayFabMultiplayerInstanceAPI; + namespace QoS { class PlayFabQoSApi { public: + PlayFabQoSApi(); + // Runs a QoS operation asynchronously. The operation pings a set of regions and returns a result with average response times. std::future GetQoSResultAsync(unsigned int numThreads, unsigned int timeoutMs = DEFAULT_TIMEOUT_MS); @@ -24,6 +30,9 @@ namespace PlayFab QoSResult GetQoSResult(unsigned int numThreads, unsigned int timeoutMs = DEFAULT_TIMEOUT_MS); private: + std::shared_ptr eventsApi; + std::shared_ptr multiplayerApi; + std::vector GetPingList(unsigned int serverCount); void InitializeAccumulatedPingResults(std::unordered_map& accumulatedPingResults); int SetupSockets(std::vector>& sockets, unsigned int numThreads, unsigned int timeoutMs); @@ -50,4 +59,4 @@ namespace PlayFab bool listQosServersCompleted; }; } -} \ No newline at end of file +} diff --git a/code/source/playfab/PlayFabAdminApi.cpp b/code/source/playfab/PlayFabAdminApi.cpp index 8d6acc0c..ccd524e6 100644 --- a/code/source/playfab/PlayFabAdminApi.cpp +++ b/code/source/playfab/PlayFabAdminApi.cpp @@ -1,6 +1,6 @@ #include -#ifdef ENABLE_PLAYFABADMIN_API +#if defined(ENABLE_PLAYFABADMIN_API) #include #include @@ -5442,7 +5442,7 @@ namespace PlayFab } } -#endif // #ifdef ENABLE_PLAYFABADMIN_API +#endif // #if defined(ENABLE_PLAYFABADMIN_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabAdminInstanceApi.cpp b/code/source/playfab/PlayFabAdminInstanceApi.cpp index 59524e86..f0387109 100644 --- a/code/source/playfab/PlayFabAdminInstanceApi.cpp +++ b/code/source/playfab/PlayFabAdminInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifdef ENABLE_PLAYFABADMIN_API +#if defined(ENABLE_PLAYFABADMIN_API) #include #include #include -#include -#include #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (disable: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabAuthenticationApi.cpp b/code/source/playfab/PlayFabAuthenticationApi.cpp index e97213a3..6232e72f 100644 --- a/code/source/playfab/PlayFabAuthenticationApi.cpp +++ b/code/source/playfab/PlayFabAuthenticationApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -166,7 +166,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabAuthenticationContext.cpp b/code/source/playfab/PlayFabAuthenticationContext.cpp index e73d7f09..7a9d372a 100644 --- a/code/source/playfab/PlayFabAuthenticationContext.cpp +++ b/code/source/playfab/PlayFabAuthenticationContext.cpp @@ -1,7 +1,6 @@ #include #include -#include namespace PlayFab { @@ -12,7 +11,7 @@ namespace PlayFab void PlayFabAuthenticationContext::ForgetAllCredentials() { -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) playFabId.clear(); clientSessionTicket.clear(); advertisingIdType.clear(); @@ -45,4 +44,14 @@ namespace PlayFab SetIfNotNull(_entityType, entityType); SetIfNotNull(_entityToken, entityToken); } + + bool PlayFabAuthenticationContext::IsClientLoggedIn() + { + return !clientSessionTicket.empty(); + } + + bool PlayFabAuthenticationContext::IsEntityLoggedIn() + { + return !entityToken.empty(); + } } diff --git a/code/source/playfab/PlayFabAuthenticationInstanceApi.cpp b/code/source/playfab/PlayFabAuthenticationInstanceApi.cpp index d1ff536d..2bfc8929 100644 --- a/code/source/playfab/PlayFabAuthenticationInstanceApi.cpp +++ b/code/source/playfab/PlayFabAuthenticationInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabClientApi.cpp b/code/source/playfab/PlayFabClientApi.cpp index aa87b949..f7b5ef13 100644 --- a/code/source/playfab/PlayFabClientApi.cpp +++ b/code/source/playfab/PlayFabClientApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include @@ -7849,7 +7849,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABCLIENT_API +#endif // #if !defined(DISABLE_PLAYFABCLIENT_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabClientInstanceApi.cpp b/code/source/playfab/PlayFabClientInstanceApi.cpp index 7406b94b..5c917242 100644 --- a/code/source/playfab/PlayFabClientInstanceApi.cpp +++ b/code/source/playfab/PlayFabClientInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include #include -#include -#include #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (disable: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabCloudScriptApi.cpp b/code/source/playfab/PlayFabCloudScriptApi.cpp index 4640ac94..2705a7c0 100644 --- a/code/source/playfab/PlayFabCloudScriptApi.cpp +++ b/code/source/playfab/PlayFabCloudScriptApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -101,7 +101,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabCloudScriptInstanceApi.cpp b/code/source/playfab/PlayFabCloudScriptInstanceApi.cpp index 7091c3e2..10931920 100644 --- a/code/source/playfab/PlayFabCloudScriptInstanceApi.cpp +++ b/code/source/playfab/PlayFabCloudScriptInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabDataApi.cpp b/code/source/playfab/PlayFabDataApi.cpp index df760e62..fadb7412 100644 --- a/code/source/playfab/PlayFabDataApi.cpp +++ b/code/source/playfab/PlayFabDataApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -395,7 +395,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabDataInstanceApi.cpp b/code/source/playfab/PlayFabDataInstanceApi.cpp index 4ea3d412..e1e8690b 100644 --- a/code/source/playfab/PlayFabDataInstanceApi.cpp +++ b/code/source/playfab/PlayFabDataInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabEventPipeline.cpp b/code/source/playfab/PlayFabEventPipeline.cpp index b8ee0cea..8de9dc04 100644 --- a/code/source/playfab/PlayFabEventPipeline.cpp +++ b/code/source/playfab/PlayFabEventPipeline.cpp @@ -2,9 +2,11 @@ #ifndef DISABLE_PLAYFABENTITY_API -#include #include -#include +#include +#include + +#include namespace PlayFab { @@ -40,6 +42,8 @@ namespace PlayFab buffer(settings->bufferSize), isWorkerThreadRunning(false) { + eventsApi = std::make_shared(PlayFabSettings::staticPlayer); + this->settings = settings; this->batch.reserve(this->settings->maximalNumberOfItemsInBatch); this->batchesInFlight.reserve(this->settings->maximalNumberOfBatchesInFlight); @@ -261,7 +265,7 @@ namespace PlayFab if (this->settings->emitType == PlayFabEventPipelineType::PlayFabPlayStream) { // call Events API to send the batch - PlayFabEventsAPI::WriteEvents( + eventsApi->WriteEvents( batchReq, std::bind(&PlayFabEventPipeline::WriteEventsApiCallback, this, std::placeholders::_1, std::placeholders::_2), std::bind(&PlayFabEventPipeline::WriteEventsApiErrorCallback, this, std::placeholders::_1, std::placeholders::_2), @@ -270,7 +274,7 @@ namespace PlayFab else { // call Events API to send the batch, bypassing Playstream - PlayFabEventsAPI::WriteTelemetryEvents( + eventsApi->WriteTelemetryEvents( batchReq, std::bind(&PlayFabEventPipeline::WriteEventsApiCallback, this, std::placeholders::_1, std::placeholders::_2), std::bind(&PlayFabEventPipeline::WriteEventsApiErrorCallback, this, std::placeholders::_1, std::placeholders::_2), diff --git a/code/source/playfab/PlayFabEventsApi.cpp b/code/source/playfab/PlayFabEventsApi.cpp index bf9fe2f6..5f7d6aa7 100644 --- a/code/source/playfab/PlayFabEventsApi.cpp +++ b/code/source/playfab/PlayFabEventsApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -150,7 +150,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabEventsInstanceApi.cpp b/code/source/playfab/PlayFabEventsInstanceApi.cpp index e7dec261..3de1412e 100644 --- a/code/source/playfab/PlayFabEventsInstanceApi.cpp +++ b/code/source/playfab/PlayFabEventsInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabGroupsApi.cpp b/code/source/playfab/PlayFabGroupsApi.cpp index 2f66b2a8..a0d48995 100644 --- a/code/source/playfab/PlayFabGroupsApi.cpp +++ b/code/source/playfab/PlayFabGroupsApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -1277,7 +1277,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabGroupsInstanceApi.cpp b/code/source/playfab/PlayFabGroupsInstanceApi.cpp index 71abbde0..3b31bbb9 100644 --- a/code/source/playfab/PlayFabGroupsInstanceApi.cpp +++ b/code/source/playfab/PlayFabGroupsInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabLocalizationApi.cpp b/code/source/playfab/PlayFabLocalizationApi.cpp index b7bfe731..660a71e1 100644 --- a/code/source/playfab/PlayFabLocalizationApi.cpp +++ b/code/source/playfab/PlayFabLocalizationApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -101,7 +101,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabLocalizationInstanceApi.cpp b/code/source/playfab/PlayFabLocalizationInstanceApi.cpp index 76949f88..ab5d31df 100644 --- a/code/source/playfab/PlayFabLocalizationInstanceApi.cpp +++ b/code/source/playfab/PlayFabLocalizationInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabMatchmakerApi.cpp b/code/source/playfab/PlayFabMatchmakerApi.cpp index f5c96f85..9bdc5361 100644 --- a/code/source/playfab/PlayFabMatchmakerApi.cpp +++ b/code/source/playfab/PlayFabMatchmakerApi.cpp @@ -1,6 +1,6 @@ #include -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) #include #include @@ -297,7 +297,7 @@ namespace PlayFab } } -#endif // #ifdef ENABLE_PLAYFABSERVER_API +#endif // #if defined(ENABLE_PLAYFABSERVER_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabMatchmakerInstanceApi.cpp b/code/source/playfab/PlayFabMatchmakerInstanceApi.cpp index 69c23749..e37ed6be 100644 --- a/code/source/playfab/PlayFabMatchmakerInstanceApi.cpp +++ b/code/source/playfab/PlayFabMatchmakerInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) #include #include #include -#include -#include #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (disable: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabMultiplayerApi.cpp b/code/source/playfab/PlayFabMultiplayerApi.cpp index 9e9f3c28..bb18095c 100644 --- a/code/source/playfab/PlayFabMultiplayerApi.cpp +++ b/code/source/playfab/PlayFabMultiplayerApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -78,6 +78,55 @@ namespace PlayFab } } + void PlayFabMultiplayerAPI::CancelAllServerBackfillTicketsForPlayer( + CancelAllServerBackfillTicketsForPlayerRequest& 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( + "/Match/CancelAllServerBackfillTicketsForPlayer", + headers, + jsonAsString, + OnCancelAllServerBackfillTicketsForPlayerResult, + 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 PlayFabMultiplayerAPI::OnCancelAllServerBackfillTicketsForPlayerResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + CancelAllServerBackfillTicketsForPlayerResult 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 PlayFabMultiplayerAPI::CancelMatchmakingTicket( CancelMatchmakingTicketRequest& request, const ProcessApiCallback callback, @@ -127,6 +176,55 @@ namespace PlayFab } } + void PlayFabMultiplayerAPI::CancelServerBackfillTicket( + CancelServerBackfillTicketRequest& 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( + "/Match/CancelServerBackfillTicket", + headers, + jsonAsString, + OnCancelServerBackfillTicketResult, + 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 PlayFabMultiplayerAPI::OnCancelServerBackfillTicketResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + CancelServerBackfillTicketResult 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 PlayFabMultiplayerAPI::CreateBuildAlias( CreateBuildAliasRequest& request, const ProcessApiCallback callback, @@ -372,6 +470,55 @@ namespace PlayFab } } + void PlayFabMultiplayerAPI::CreateServerBackfillTicket( + CreateServerBackfillTicketRequest& 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( + "/Match/CreateServerBackfillTicket", + headers, + jsonAsString, + OnCreateServerBackfillTicketResult, + 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 PlayFabMultiplayerAPI::OnCreateServerBackfillTicketResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + CreateServerBackfillTicketResult 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 PlayFabMultiplayerAPI::CreateServerMatchmakingTicket( CreateServerMatchmakingTicketRequest& request, const ProcessApiCallback callback, @@ -1205,6 +1352,55 @@ namespace PlayFab } } + void PlayFabMultiplayerAPI::GetServerBackfillTicket( + GetServerBackfillTicketRequest& 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( + "/Match/GetServerBackfillTicket", + headers, + jsonAsString, + OnGetServerBackfillTicketResult, + 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 PlayFabMultiplayerAPI::OnGetServerBackfillTicketResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetServerBackfillTicketResult 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 PlayFabMultiplayerAPI::GetTitleEnabledForMultiplayerServersStatus( GetTitleEnabledForMultiplayerServersStatusRequest& request, const ProcessApiCallback callback, @@ -1939,6 +2135,55 @@ namespace PlayFab } } + void PlayFabMultiplayerAPI::ListServerBackfillTicketsForPlayer( + ListServerBackfillTicketsForPlayerRequest& 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( + "/Match/ListServerBackfillTicketsForPlayer", + headers, + jsonAsString, + OnListServerBackfillTicketsForPlayerResult, + 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 PlayFabMultiplayerAPI::OnListServerBackfillTicketsForPlayerResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + ListServerBackfillTicketsForPlayerResult 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 PlayFabMultiplayerAPI::ListVirtualMachineSummaries( ListVirtualMachineSummariesRequest& request, const ProcessApiCallback callback, @@ -2354,7 +2599,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabMultiplayerInstanceApi.cpp b/code/source/playfab/PlayFabMultiplayerInstanceApi.cpp index a0b00f20..f3811d25 100644 --- a/code/source/playfab/PlayFabMultiplayerInstanceApi.cpp +++ b/code/source/playfab/PlayFabMultiplayerInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 @@ -111,6 +109,56 @@ namespace PlayFab } } + void PlayFabMultiplayerInstanceAPI::CancelAllServerBackfillTicketsForPlayer( + CancelAllServerBackfillTicketsForPlayerRequest& 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( + "/Match/CancelAllServerBackfillTicketsForPlayer", + headers, + jsonAsString, + std::bind(&PlayFabMultiplayerInstanceAPI::OnCancelAllServerBackfillTicketsForPlayerResult, 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 PlayFabMultiplayerInstanceAPI::OnCancelAllServerBackfillTicketsForPlayerResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + CancelAllServerBackfillTicketsForPlayerResult 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 PlayFabMultiplayerInstanceAPI::CancelMatchmakingTicket( CancelMatchmakingTicketRequest& request, const ProcessApiCallback callback, @@ -161,6 +209,56 @@ namespace PlayFab } } + void PlayFabMultiplayerInstanceAPI::CancelServerBackfillTicket( + CancelServerBackfillTicketRequest& 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( + "/Match/CancelServerBackfillTicket", + headers, + jsonAsString, + std::bind(&PlayFabMultiplayerInstanceAPI::OnCancelServerBackfillTicketResult, 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 PlayFabMultiplayerInstanceAPI::OnCancelServerBackfillTicketResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + CancelServerBackfillTicketResult 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 PlayFabMultiplayerInstanceAPI::CreateBuildAlias( CreateBuildAliasRequest& request, const ProcessApiCallback callback, @@ -411,6 +509,56 @@ namespace PlayFab } } + void PlayFabMultiplayerInstanceAPI::CreateServerBackfillTicket( + CreateServerBackfillTicketRequest& 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( + "/Match/CreateServerBackfillTicket", + headers, + jsonAsString, + std::bind(&PlayFabMultiplayerInstanceAPI::OnCreateServerBackfillTicketResult, 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 PlayFabMultiplayerInstanceAPI::OnCreateServerBackfillTicketResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + CreateServerBackfillTicketResult 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 PlayFabMultiplayerInstanceAPI::CreateServerMatchmakingTicket( CreateServerMatchmakingTicketRequest& request, const ProcessApiCallback callback, @@ -1261,6 +1409,56 @@ namespace PlayFab } } + void PlayFabMultiplayerInstanceAPI::GetServerBackfillTicket( + GetServerBackfillTicketRequest& 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( + "/Match/GetServerBackfillTicket", + headers, + jsonAsString, + std::bind(&PlayFabMultiplayerInstanceAPI::OnGetServerBackfillTicketResult, 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 PlayFabMultiplayerInstanceAPI::OnGetServerBackfillTicketResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetServerBackfillTicketResult 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 PlayFabMultiplayerInstanceAPI::GetTitleEnabledForMultiplayerServersStatus( GetTitleEnabledForMultiplayerServersStatusRequest& request, const ProcessApiCallback callback, @@ -2010,6 +2208,56 @@ namespace PlayFab } } + void PlayFabMultiplayerInstanceAPI::ListServerBackfillTicketsForPlayer( + ListServerBackfillTicketsForPlayerRequest& 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( + "/Match/ListServerBackfillTicketsForPlayer", + headers, + jsonAsString, + std::bind(&PlayFabMultiplayerInstanceAPI::OnListServerBackfillTicketsForPlayerResult, 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 PlayFabMultiplayerInstanceAPI::OnListServerBackfillTicketsForPlayerResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + ListServerBackfillTicketsForPlayerResult 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 PlayFabMultiplayerInstanceAPI::ListVirtualMachineSummaries( ListVirtualMachineSummariesRequest& request, const ProcessApiCallback callback, diff --git a/code/source/playfab/PlayFabProfilesApi.cpp b/code/source/playfab/PlayFabProfilesApi.cpp index 2248432d..345293ab 100644 --- a/code/source/playfab/PlayFabProfilesApi.cpp +++ b/code/source/playfab/PlayFabProfilesApi.cpp @@ -1,6 +1,6 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#if !defined(DISABLE_PLAYFABENTITY_API) #include #include @@ -395,7 +395,7 @@ namespace PlayFab } } -#endif // #ifndef DISABLE_PLAYFABENTITY_API +#endif // #if !defined(DISABLE_PLAYFABENTITY_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabProfilesInstanceApi.cpp b/code/source/playfab/PlayFabProfilesInstanceApi.cpp index 84ec4f2f..3b006a9a 100644 --- a/code/source/playfab/PlayFabProfilesInstanceApi.cpp +++ b/code/source/playfab/PlayFabProfilesInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifndef DISABLE_PLAYFABENTITY_API +#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 diff --git a/code/source/playfab/PlayFabServerApi.cpp b/code/source/playfab/PlayFabServerApi.cpp index a6016a90..1cd733f5 100644 --- a/code/source/playfab/PlayFabServerApi.cpp +++ b/code/source/playfab/PlayFabServerApi.cpp @@ -1,6 +1,6 @@ #include -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) #include #include @@ -3459,6 +3459,55 @@ namespace PlayFab } } + void PlayFabServerAPI::LinkPSNAccount( + LinkPSNAccountRequest& 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-SecretKey", settings->developerSecretKey); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Server/LinkPSNAccount", + headers, + jsonAsString, + OnLinkPSNAccountResult, + 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 PlayFabServerAPI::OnLinkPSNAccountResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + LinkPSNAccountResult 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 PlayFabServerAPI::LinkServerCustomId( LinkServerCustomIdRequest& request, const ProcessApiCallback callback, @@ -5321,6 +5370,55 @@ namespace PlayFab } } + void PlayFabServerAPI::UnlinkPSNAccount( + UnlinkPSNAccountRequest& 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-SecretKey", settings->developerSecretKey); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Server/UnlinkPSNAccount", + headers, + jsonAsString, + OnUnlinkPSNAccountResult, + 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 PlayFabServerAPI::OnUnlinkPSNAccountResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + UnlinkPSNAccountResult 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 PlayFabServerAPI::UnlinkServerCustomId( UnlinkServerCustomIdRequest& request, const ProcessApiCallback callback, @@ -6422,7 +6520,7 @@ namespace PlayFab } } -#endif // #ifdef ENABLE_PLAYFABSERVER_API +#endif // #if defined(ENABLE_PLAYFABSERVER_API) #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (default: 4100) // formal parameters are part of a public interface diff --git a/code/source/playfab/PlayFabServerInstanceApi.cpp b/code/source/playfab/PlayFabServerInstanceApi.cpp index 4ad998b7..f5390193 100644 --- a/code/source/playfab/PlayFabServerInstanceApi.cpp +++ b/code/source/playfab/PlayFabServerInstanceApi.cpp @@ -1,12 +1,10 @@ #include -#ifdef ENABLE_PLAYFABSERVER_API +#if defined(ENABLE_PLAYFABSERVER_API) #include #include #include -#include -#include #if defined(PLAYFAB_PLATFORM_WINDOWS) #pragma warning (disable: 4100) // formal parameters are part of a public interface @@ -3562,6 +3560,56 @@ namespace PlayFab } } + void PlayFabServerInstanceAPI::LinkPSNAccount( + LinkPSNAccountRequest& 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-SecretKey", settings->developerSecretKey); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Server/LinkPSNAccount", + headers, + jsonAsString, + std::bind(&PlayFabServerInstanceAPI::OnLinkPSNAccountResult, 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 PlayFabServerInstanceAPI::OnLinkPSNAccountResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + LinkPSNAccountResult 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 PlayFabServerInstanceAPI::LinkServerCustomId( LinkServerCustomIdRequest& request, const ProcessApiCallback callback, @@ -5462,6 +5510,56 @@ namespace PlayFab } } + void PlayFabServerInstanceAPI::UnlinkPSNAccount( + UnlinkPSNAccountRequest& 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-SecretKey", settings->developerSecretKey); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Server/UnlinkPSNAccount", + headers, + jsonAsString, + std::bind(&PlayFabServerInstanceAPI::OnUnlinkPSNAccountResult, 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 PlayFabServerInstanceAPI::OnUnlinkPSNAccountResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + UnlinkPSNAccountResult 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 PlayFabServerInstanceAPI::UnlinkServerCustomId( UnlinkServerCustomIdRequest& request, const ProcessApiCallback callback, diff --git a/code/source/playfab/PlayFabSettings.cpp b/code/source/playfab/PlayFabSettings.cpp index 8998b7b3..c19d0f22 100644 --- a/code/source/playfab/PlayFabSettings.cpp +++ b/code/source/playfab/PlayFabSettings.cpp @@ -6,16 +6,16 @@ namespace PlayFab { // Control whether all callbacks are threaded or whether the user manually controls callback timing from their main-thread bool PlayFabSettings::threadedCallbacks = false; - const std::string PlayFabSettings::sdkVersion = "3.22.191218"; + const std::string PlayFabSettings::sdkVersion = "3.23.200121"; const std::string PlayFabSettings::buildIdentifier = "jbuild_xplatcppsdk__sdk-genericslave-3_0"; - const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.22.191218"; + const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.23.200121"; std::string PlayFabSettings::productionEnvironmentURL = ".playfabapi.com"; ErrorCallback PlayFabSettings::globalErrorHandler = nullptr; const std::shared_ptr PlayFabSettings::staticSettings = std::make_shared(); const std::shared_ptr PlayFabSettings::staticPlayer = std::make_shared(); -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) const std::string PlayFabSettings::AD_TYPE_IDFA = "Idfa"; const std::string PlayFabSettings::AD_TYPE_ANDROID_ID = "Adid"; #endif diff --git a/code/source/playfab/QoS/PlayFabQoSApi.cpp b/code/source/playfab/QoS/PlayFabQoSApi.cpp index b5dcb98a..2274eb45 100644 --- a/code/source/playfab/QoS/PlayFabQoSApi.cpp +++ b/code/source/playfab/QoS/PlayFabQoSApi.cpp @@ -6,11 +6,9 @@ #include #include -#include -#include -#include +#include #include -#include +#include #include #include #include @@ -23,6 +21,12 @@ namespace PlayFab { namespace QoS { + PlayFabQoSApi::PlayFabQoSApi() + { + eventsApi = std::make_shared(PlayFabSettings::staticPlayer); + multiplayerApi = std::make_shared(PlayFabSettings::staticPlayer); + } + bool ValidateResult(PlayFabResultCommon& resultCommon, const CallRequestContainer& container) { if (container.errorWrapper.HttpCode == 200) @@ -68,7 +72,7 @@ namespace PlayFab { QoSResult result; - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!PlayFabSettings::staticPlayer->IsClientLoggedIn()) { LOG_QOS("Client is not logged in" << endl); result.errorCode = static_cast(QoSErrorCode::NotLoggedIn); @@ -160,7 +164,7 @@ namespace PlayFab eventContents.Payload = value; request.Events.push_back(eventContents); - PlayFabEventsAPI::WriteTelemetryEvents(request, WriteEventsSuccessCallBack, WriteEventsFailureCallBack); + eventsApi->WriteTelemetryEvents(request, WriteEventsSuccessCallBack, WriteEventsFailureCallBack); } void PlayFabQoSApi::WriteEventsSuccessCallBack(const WriteEventsResponse&, void*) @@ -183,7 +187,7 @@ namespace PlayFab } ListQosServersRequest request; - PlayFabMultiplayerAPI::ListQosServers(request, ListQosServersSuccessCallBack, ListQosServersFailureCallBack, reinterpret_cast(this)); + multiplayerApi->ListQosServers(request, ListQosServersSuccessCallBack, ListQosServersFailureCallBack, reinterpret_cast(this)); } void PlayFabQoSApi::ListQosServersSuccessCallBack(const ListQosServersResponse& result, void* customData) @@ -191,7 +195,7 @@ namespace PlayFab // Custom data received is a pointer to our api object PlayFabQoSApi* api = reinterpret_cast(customData); - for(const QosServer& server :result.QosServers) + for (const QosServer& server : result.QosServers) { api->regionMap[server.Region] = server.ServerUrl; } diff --git a/code/stdafx.h b/code/stdafx.h index b456e1f6..f8bb34b3 100644 --- a/code/stdafx.h +++ b/code/stdafx.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/com.playfab.xplatcppsdk.v141.autopkg b/com.playfab.xplatcppsdk.v141.autopkg index 459915ee..b71bd85e 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.22.191218; + version : 3.23.200121; 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,8 +18,8 @@ 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/#191218"; - copyright: "Copyright 2019"; + releaseNotes: "https://api.playfab.com/releaseNotes/#200121"; + copyright: "Copyright 2020"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native }; }; diff --git a/com.playfab.xplatxboxsdk.v141.autopkg b/com.playfab.xplatxboxsdk.v141.autopkg index 9dbaadb4..c3a9c618 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.22.191218; + version : 3.23.200121; 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,8 +28,8 @@ 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/#191218"; - copyright: "Copyright 2019"; + releaseNotes: "https://api.playfab.com/releaseNotes/#200121"; + copyright: "Copyright 2020"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native, xbox }; }; diff --git a/test/TestApp/PlayFabApiTest.cpp b/test/TestApp/PlayFabApiTest.cpp index c5ef0089..8b146504 100644 --- a/test/TestApp/PlayFabApiTest.cpp +++ b/test/TestApp/PlayFabApiTest.cpp @@ -2,19 +2,16 @@ #include "TestAppPch.h" -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include "PlayFabApiTest.h" #include "TestContext.h" @@ -32,7 +29,7 @@ namespace PlayFabUnit void PlayFabApiTest::OnErrorSharedCallback(const PlayFabError& error, void* customData) { TestContext* testContext = static_cast(customData); - testContext->Fail("Unexpected error: " + error.ErrorMessage); + testContext->Fail("Unexpected error: " + error.GenerateErrorReport()); } // CLIENT API @@ -50,7 +47,7 @@ namespace PlayFabUnit // // set invalid title id // PlayFabSettings::staticSettings->titleId = ""; - // PlayFabClientAPI::LoginWithCustomID(request, + // clientApi->LoginWithCustomID(request, // [&validTitleId](const LoginResult&, void* customData) // { // PlayFabSettings::staticSettings->titleId = validTitleId; @@ -81,7 +78,7 @@ namespace PlayFabUnit request.Email = USER_EMAIL; request.Password = "INVALID"; - PlayFabClientAPI::LoginWithEmailAddress(request, + clientApi->LoginWithEmailAddress(request, Callback(&PlayFabApiTest::LoginCallback), Callback(&PlayFabApiTest::LoginFailedCallback), &testContext); @@ -104,7 +101,7 @@ namespace PlayFabUnit } else { - testContext->Fail("Password error message not found: " + error.ErrorMessage); + testContext->Fail("Password error message not found: " + error.GenerateErrorReport()); } } @@ -116,7 +113,7 @@ namespace PlayFabUnit request.Email = USER_EMAIL; request.Password = "INVALID"; - PlayFabClientAPI::LoginWithEmailAddress(request, + clientApi->LoginWithEmailAddress(request, nullptr, [](const PlayFabError& error, void* customData) { TestContext* testContext = static_cast(customData); if (error.ErrorMessage.find("password") != -1) testContext->Pass(); }, &testContext); @@ -132,7 +129,7 @@ namespace PlayFabUnit request.Email = "x"; request.Password = "x"; - PlayFabClientAPI::RegisterPlayFabUser(request, + clientApi->RegisterPlayFabUser(request, Callback(&PlayFabApiTest::InvalidRegistrationSuccess), Callback(&PlayFabApiTest::InvalidRegistrationFail), &testContext); @@ -171,14 +168,13 @@ namespace PlayFabUnit request.CustomId = PlayFabSettings::buildIdentifier; request.CreateAccount = true; - PlayFabClientAPI::LoginWithCustomID(request, + clientApi->LoginWithCustomID(request, Callback(&PlayFabApiTest::OnLoginOrRegister), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); } - void PlayFabApiTest::OnLoginOrRegister(const LoginResult& result, void* customData) + void PlayFabApiTest::OnLoginOrRegister(const LoginResult& /*result*/, void* customData) { - playFabId = result.PlayFabId; TestContext* testContext = static_cast(customData); testContext->Pass(); } @@ -194,7 +190,7 @@ namespace PlayFabUnit request.CustomId = PlayFabSettings::buildIdentifier; request.CreateAccount = true; - PlayFabClientAPI::LoginWithCustomID(request, + clientApi->LoginWithCustomID(request, Callback(&PlayFabApiTest::OnLoginWithAdvertisingId), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -214,14 +210,14 @@ namespace PlayFabUnit // Parameter types tested: string, Dictionary void PlayFabApiTest::UserDataApi(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } GetUserDataRequest request; - PlayFabClientAPI::GetUserData(request, + clientApi->GetUserData(request, Callback(&PlayFabApiTest::OnUserDataApiGet1), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -238,7 +234,7 @@ namespace PlayFabUnit std::string temp = std::to_string(testMessageInt); updateRequest.Data[TEST_DATA_KEY] = temp; - PlayFabClientAPI::UpdateUserData(updateRequest, + clientApi->UpdateUserData(updateRequest, Callback(&PlayFabApiTest::OnUserDataApiUpdate), Callback(&PlayFabApiTest::OnErrorSharedCallback), customData); @@ -246,7 +242,7 @@ namespace PlayFabUnit void PlayFabApiTest::OnUserDataApiUpdate(const UpdateUserDataResult&, void* customData) { GetUserDataRequest request; - PlayFabClientAPI::GetUserData(request, + clientApi->GetUserData(request, Callback(&PlayFabApiTest::OnUserDataApiGet2), Callback(&PlayFabApiTest::OnErrorSharedCallback), customData); @@ -294,14 +290,14 @@ namespace PlayFabUnit return; } - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } GetTimeRequest request; - PlayFabClientAPI::GetTime(request, + clientApi->GetTime(request, Callback(&PlayFabApiTest::OnGetServerTime), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -330,14 +326,14 @@ namespace PlayFabUnit // Parameter types tested: Dictionary void PlayFabApiTest::PlayerStatisticsApi(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } GetPlayerStatisticsRequest request; - PlayFabClientAPI::GetPlayerStatistics(request, + clientApi->GetPlayerStatistics(request, Callback(&PlayFabApiTest::OnPlayerStatisticsApiGet1), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -362,7 +358,7 @@ namespace PlayFabUnit updateStat.Value = testMessageInt; updateRequest.Statistics.insert(updateRequest.Statistics.end(), updateStat); - PlayFabClientAPI::UpdatePlayerStatistics(updateRequest, + clientApi->UpdatePlayerStatistics(updateRequest, Callback(&PlayFabApiTest::OnPlayerStatisticsApiUpdate), Callback(&PlayFabApiTest::OnErrorSharedCallback), customData); @@ -371,7 +367,7 @@ namespace PlayFabUnit void PlayFabApiTest::OnPlayerStatisticsApiUpdate(const UpdatePlayerStatisticsResult&, void* customData) { GetPlayerStatisticsRequest request; - PlayFabClientAPI::GetPlayerStatistics(request, + clientApi->GetPlayerStatistics(request, Callback(&PlayFabApiTest::OnPlayerStatisticsApiGet2), Callback(&PlayFabApiTest::OnErrorSharedCallback), customData); @@ -408,14 +404,14 @@ namespace PlayFabUnit // Parameter types tested: Contained-Classes, string void PlayFabApiTest::UserCharacter(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } ListUsersCharactersRequest request; - PlayFabClientAPI::GetAllUsersCharacters(request, + clientApi->GetAllUsersCharacters(request, Callback(&PlayFabApiTest::OnUserCharacter), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -432,7 +428,7 @@ namespace PlayFabUnit // Parameter types tested: List of contained-classes void PlayFabApiTest::LeaderBoard(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; @@ -443,7 +439,7 @@ namespace PlayFabUnit clientRequest.MaxResultsCount = 3; clientRequest.StatisticName = TEST_STAT_NAME; - PlayFabClientAPI::GetLeaderboard(clientRequest, + clientApi->GetLeaderboard(clientRequest, Callback(&PlayFabApiTest::OnClientLeaderBoard), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -466,14 +462,14 @@ namespace PlayFabUnit // Parameter types tested: List of enum-as-strings converted to list of enums void PlayFabApiTest::AccountInfo(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } GetAccountInfoRequest request; - PlayFabClientAPI::GetAccountInfo(request, + clientApi->GetAccountInfo(request, Callback(&PlayFabApiTest::OnAccountInfo), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -496,7 +492,7 @@ namespace PlayFabUnit // Test that CloudScript can be properly set up and invoked void PlayFabApiTest::CloudScript(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!PlayFabSettings::staticPlayer->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; @@ -505,7 +501,7 @@ namespace PlayFabUnit ExecuteCloudScriptRequest request; request.FunctionName = "helloWorld"; - PlayFabClientAPI::ExecuteCloudScript(request, + clientApi->ExecuteCloudScript(request, Callback(&PlayFabApiTest::OnHelloWorldCloudScript), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -524,7 +520,7 @@ namespace PlayFabUnit cloudScriptLogReport += "\n" + (*it).Message; } - bool success = (cloudScriptLogReport.find("Hello " + playFabId + "!") != -1); + bool success = (cloudScriptLogReport.find("Hello " + PlayFabSettings::staticPlayer->playFabId + "!") != -1); if (!success) { testContext->Fail(cloudScriptLogReport); @@ -542,7 +538,7 @@ namespace PlayFabUnit ExecuteCloudScriptRequest hwRequest; hwRequest.FunctionName = "helloWorld"; - PlayFabClientAPI::ExecuteCloudScript(hwRequest, + clientApi->ExecuteCloudScript(hwRequest, [&](const ExecuteCloudScriptResult& constResult, void* customData) { OnHelloWorldCloudScript(constResult, customData); }, Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -552,7 +548,7 @@ namespace PlayFabUnit // Test that CloudScript errors can be deciphered void PlayFabApiTest::CloudScriptError(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; @@ -561,7 +557,7 @@ namespace PlayFabUnit ExecuteCloudScriptRequest request; request.FunctionName = "throwError"; - PlayFabClientAPI::ExecuteCloudScript(request, + clientApi->ExecuteCloudScript(request, Callback(&PlayFabApiTest::OnCloudScriptError), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -587,7 +583,7 @@ namespace PlayFabUnit // Test that the client can publish custom PlayStream events void PlayFabApiTest::WriteEvent(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; @@ -595,11 +591,10 @@ namespace PlayFabUnit WriteClientPlayerEventRequest request; request.EventName = "ForumPostEvent"; - request.Timestamp = time(nullptr); request.Body["Subject"] = "My First Post"; request.Body["Body"] = "My mega-sweet body text for my first post!"; - PlayFabClientAPI::WritePlayerEvent(request, + clientApi->WritePlayerEvent(request, Callback(&PlayFabApiTest::OnWritePlayerEvent), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -614,14 +609,14 @@ namespace PlayFabUnit // Verify that a client login can be converted into an entity token void PlayFabApiTest::GetEntityToken(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } GetEntityTokenRequest request; - PlayFabAuthenticationAPI::GetEntityToken(request, + authApi->GetEntityToken(request, Callback(&PlayFabApiTest::OnGetEntityToken), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -630,14 +625,11 @@ namespace PlayFabUnit { TestContext* testContext = static_cast(customData); - entityId = result.Entity->Id; - entityType = result.Entity->Type; - - if (entityType != "title_player_account") + if (result.Entity->Type != "title_player_account") { - testContext->Fail("entityType unexpected: " + entityType); + testContext->Fail("entityType unexpected: " + result.Entity->Type); } - else if (entityId.length() == 0) + else if (result.Entity->Id.length() == 0) { testContext->Fail("EntityID was empty"); } @@ -653,17 +645,17 @@ namespace PlayFabUnit // Verify that the object is correctly modified on the next call. void PlayFabApiTest::ObjectApi(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!clientApi->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; } GetObjectsRequest request; - request.Entity.Id = entityId; - request.Entity.Type = entityType; + request.Entity.Id = PlayFabSettings::staticPlayer->entityId; + request.Entity.Type = PlayFabSettings::staticPlayer->entityType; request.EscapeObject = true; - PlayFabDataAPI::GetObjects(request, + dataApi->GetObjects(request, Callback(&PlayFabApiTest::OnGetObjects1), Callback(&PlayFabApiTest::OnErrorSharedCallback), &testContext); @@ -680,15 +672,15 @@ namespace PlayFabUnit testMessageInt = (testMessageInt + 1) % 100; SetObjectsRequest request; - request.Entity.Id = entityId; - request.Entity.Type = entityType; + request.Entity.Id = PlayFabSettings::staticPlayer->entityId; + request.Entity.Type = PlayFabSettings::staticPlayer->entityType; SetObject updateObj; updateObj.ObjectName = TEST_DATA_KEY; updateObj.DataObject = testMessageInt; request.Objects.push_back(updateObj); - PlayFabDataAPI::SetObjects(request, + dataApi->SetObjects(request, Callback(&PlayFabApiTest::OnSetObjects), Callback(&PlayFabApiTest::OnErrorSharedCallback), customData); @@ -696,11 +688,11 @@ namespace PlayFabUnit void PlayFabApiTest::OnSetObjects(const SetObjectsResponse&, void* customData) { GetObjectsRequest request; - request.Entity.Id = entityId; - request.Entity.Type = entityType; + request.Entity.Id = PlayFabSettings::staticPlayer->entityId; + request.Entity.Type = PlayFabSettings::staticPlayer->entityType; request.EscapeObject = true; - PlayFabDataAPI::GetObjects(request, + dataApi->GetObjects(request, Callback(&PlayFabApiTest::OnGetObjects2), Callback(&PlayFabApiTest::OnErrorSharedCallback), customData); @@ -759,6 +751,10 @@ namespace PlayFabUnit void PlayFabApiTest::ClassSetUp() { + authApi = std::make_shared(PlayFabSettings::staticPlayer); + clientApi = std::make_shared(PlayFabSettings::staticPlayer); + dataApi = std::make_shared(PlayFabSettings::staticPlayer); + PlayFabSettings::staticSettings->titleId = testTitleData.titleId; USER_EMAIL = testTitleData.userEmail; @@ -768,9 +764,6 @@ namespace PlayFabUnit // Make sure PlayFab state is clean. PlayFabSettings::ForgetAllCredentials(); - playFabId = ""; - entityId = ""; - entityType = ""; testMessageInt = 0; testMessageTime = PlayFab::GetTimePointNow(); } diff --git a/test/TestApp/PlayFabApiTest.h b/test/TestApp/PlayFabApiTest.h index 927c7acd..a5928d72 100644 --- a/test/TestApp/PlayFabApiTest.h +++ b/test/TestApp/PlayFabApiTest.h @@ -2,9 +2,14 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) + +#include #include +#include +#include +#include #include "TestCase.h" @@ -45,6 +50,11 @@ namespace PlayFabUnit class PlayFabApiTest : public PlayFabApiTestCase { private: + // Api instances + std::shared_ptr authApi; + std::shared_ptr clientApi; + std::shared_ptr dataApi; + // Fixed values provided from testInputs bool TITLE_INFO_SET; std::string USER_EMAIL; @@ -52,9 +62,6 @@ namespace PlayFabUnit // Information fetched by appropriate API calls const static std::string TEST_DATA_KEY; const static std::string TEST_STAT_NAME; - std::string playFabId; - std::string entityId; - std::string entityType; int testMessageInt; PlayFab::TimePoint testMessageTime; diff --git a/test/TestApp/PlayFabEventTest.cpp b/test/TestApp/PlayFabEventTest.cpp index 6be816cb..74b1c740 100644 --- a/test/TestApp/PlayFabEventTest.cpp +++ b/test/TestApp/PlayFabEventTest.cpp @@ -2,12 +2,14 @@ #include "TestAppPch.h" -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include -#include -#include +#include +#include +#include +#include #include #include #include "PlayFabEventTest.h" @@ -50,7 +52,7 @@ namespace PlayFabUnit request.CustomId = PlayFabSettings::buildIdentifier; request.CreateAccount = true; - PlayFabClientAPI::LoginWithCustomID(request, + clientApi->LoginWithCustomID(request, ApiCallback(&PlayFabEventTest::OnLogin), ApiCallback(&PlayFabEventTest::OnErrorSharedCallback), &testContext); @@ -76,7 +78,7 @@ namespace PlayFabUnit } void PlayFabEventTest::EventsApi(TestContext& testContext) { - if (!PlayFabClientAPI::IsClientLoggedIn()) + if (!PlayFabSettings::staticPlayer->IsClientLoggedIn()) { testContext.Skip("Earlier tests failed to log in"); return; @@ -92,7 +94,7 @@ namespace PlayFabUnit request.Events.push_back(CreateEventContents("event_B_", i)); } - PlayFabEventsAPI::WriteEvents(request, + eventsApi->WriteEvents(request, ApiCallback(&PlayFabEventTest::OnEventsApiSucceeded), ApiCallback(&PlayFabEventTest::OnEventsApiFailed), &testContext); @@ -311,6 +313,9 @@ namespace PlayFabUnit void PlayFabEventTest::ClassSetUp() { + clientApi = std::make_shared(PlayFabSettings::staticPlayer); + eventsApi = std::make_shared(PlayFabSettings::staticPlayer); + // Make sure PlayFab state is clean. PlayFabSettings::ForgetAllCredentials(); } diff --git a/test/TestApp/PlayFabEventTest.h b/test/TestApp/PlayFabEventTest.h index 7bdfde6c..9b0b4f4d 100644 --- a/test/TestApp/PlayFabEventTest.h +++ b/test/TestApp/PlayFabEventTest.h @@ -2,7 +2,7 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include @@ -34,6 +34,9 @@ namespace PlayFabUnit class PlayFabEventTest : public PlayFabApiTestCase { private: + std::shared_ptr clientApi; + std::shared_ptr eventsApi; + /// QoS API void QosResultApi(TestContext& testContext); diff --git a/test/TestApp/PlayFabTestAlloc.cpp b/test/TestApp/PlayFabTestAlloc.cpp index 0cb85272..7410405b 100644 --- a/test/TestApp/PlayFabTestAlloc.cpp +++ b/test/TestApp/PlayFabTestAlloc.cpp @@ -46,21 +46,21 @@ namespace PlayFabUnit // Context PlayFab::PlayFabAuthenticationContext* testPtrContext = new PlayFab::PlayFabAuthenticationContext(); testPtrContext->entityId = "this should succeed"; -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) testPtrContext->playFabId = "this is conditional"; #endif delete testPtrContext; std::shared_ptr testMSPContext = std::make_shared(); testMSPContext->entityId = "this should succeed"; -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) testMSPContext->playFabId = "this is conditional"; #endif testMSPContext.reset(); std::shared_ptr testNSpContext = std::shared_ptr(new PlayFab::PlayFabAuthenticationContext()); testNSpContext->entityId = "this should succeed"; -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) testNSpContext->playFabId = "this is conditional"; #endif testNSpContext.reset(); diff --git a/test/TestApp/PlayFabTestMultiUserInstance.cpp b/test/TestApp/PlayFabTestMultiUserInstance.cpp index 46ab973f..333389b1 100644 --- a/test/TestApp/PlayFabTestMultiUserInstance.cpp +++ b/test/TestApp/PlayFabTestMultiUserInstance.cpp @@ -2,7 +2,7 @@ #include "TestAppPch.h" -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include #include diff --git a/test/TestApp/PlayFabTestMultiUserInstance.h b/test/TestApp/PlayFabTestMultiUserInstance.h index 27542816..9654f2e8 100644 --- a/test/TestApp/PlayFabTestMultiUserInstance.h +++ b/test/TestApp/PlayFabTestMultiUserInstance.h @@ -2,7 +2,7 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include "TestCase.h" diff --git a/test/TestApp/PlayFabTestMultiUserStatic.cpp b/test/TestApp/PlayFabTestMultiUserStatic.cpp index a34248c5..452e2fe2 100644 --- a/test/TestApp/PlayFabTestMultiUserStatic.cpp +++ b/test/TestApp/PlayFabTestMultiUserStatic.cpp @@ -2,9 +2,9 @@ #include "TestAppPch.h" -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) -#include +#include #include #include "TestContext.h" #include "PlayFabTestMultiUserStatic.h" @@ -25,7 +25,7 @@ namespace PlayFabUnit const auto& user1ProfileSuccess = std::bind(&PlayFabTestMultiUserStatic::MultiUserProfile1Success, this, std::placeholders::_1, std::placeholders::_2); const auto& user1ProfileFailure = std::bind(&PlayFabTestMultiUserStatic::MultiUserProfile1Failure, this, std::placeholders::_1, std::placeholders::_2); - PlayFabClientAPI::GetPlayerProfile(profileRequest, user1ProfileSuccess, user1ProfileFailure, customData); + clientApi->GetPlayerProfile(profileRequest, user1ProfileSuccess, user1ProfileFailure, customData); } void PlayFabTestMultiUserStatic::MultiUserLogin1Failure(const PlayFabError& error, void* /*customData*/) { @@ -49,7 +49,7 @@ namespace PlayFabUnit const auto& user2ProfileSuccess = std::bind(&PlayFabTestMultiUserStatic::MultiUserProfile2Success, this, std::placeholders::_1, std::placeholders::_2); const auto& user2ProfileFailure = std::bind(&PlayFabTestMultiUserStatic::MultiUserProfile2Failure, this, std::placeholders::_1, std::placeholders::_2); - PlayFabClientAPI::GetPlayerProfile(profileRequest, user2ProfileSuccess, user2ProfileFailure, customData); + clientApi->GetPlayerProfile(profileRequest, user2ProfileSuccess, user2ProfileFailure, customData); } void PlayFabTestMultiUserStatic::MultiUserLogin2Failure(const PlayFabError& error, void* /*customData*/) { @@ -75,7 +75,7 @@ namespace PlayFabUnit const auto& user1LoginSuccess = std::bind(&PlayFabTestMultiUserStatic::MultiUserLogin1Success, this, std::placeholders::_1, std::placeholders::_2); const auto& user1LoginFailure = std::bind(&PlayFabTestMultiUserStatic::MultiUserLogin1Failure, this, std::placeholders::_1, std::placeholders::_2); - PlayFabClientAPI::LoginWithCustomID(user1LoginRequest, user1LoginSuccess, user1LoginFailure, &testContext); + clientApi->LoginWithCustomID(user1LoginRequest, user1LoginSuccess, user1LoginFailure, &testContext); LoginWithCustomIDRequest user2LoginRequest; user2LoginRequest.CustomId = "test_MultiStatic2"; @@ -84,7 +84,7 @@ namespace PlayFabUnit const auto& user2LoginSuccess = std::bind(&PlayFabTestMultiUserStatic::MultiUserLogin2Success, this, std::placeholders::_1, std::placeholders::_2); const auto& user2LoginFailure = std::bind(&PlayFabTestMultiUserStatic::MultiUserLogin2Failure, this, std::placeholders::_1, std::placeholders::_2); - PlayFabClientAPI::LoginWithCustomID(user2LoginRequest, user2LoginSuccess, user2LoginFailure, &testContext); + clientApi->LoginWithCustomID(user2LoginRequest, user2LoginSuccess, user2LoginFailure, &testContext); } void PlayFabTestMultiUserStatic::AddTests() @@ -94,6 +94,8 @@ namespace PlayFabUnit void PlayFabTestMultiUserStatic::ClassSetUp() { + clientApi = std::make_shared(PlayFabSettings::staticPlayer); + // Ref or create contexts for players multiUser1Context = PlayFabSettings::staticPlayer; multiUser2Context = std::make_shared(); diff --git a/test/TestApp/PlayFabTestMultiUserStatic.h b/test/TestApp/PlayFabTestMultiUserStatic.h index 8f5af51b..8a2dc5d5 100644 --- a/test/TestApp/PlayFabTestMultiUserStatic.h +++ b/test/TestApp/PlayFabTestMultiUserStatic.h @@ -2,7 +2,7 @@ #pragma once -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) #include "TestCase.h" @@ -26,6 +26,7 @@ namespace PlayFabUnit /// CLIENT API /// Try to log in two users simultaneously using static APIs. /// + std::shared_ptr clientApi; std::shared_ptr multiUser1Context; std::shared_ptr multiUser2Context; std::string multiUser1Error, multiUser2Error; diff --git a/test/TestApp/TestApp.cpp b/test/TestApp/TestApp.cpp index 7396d5a9..d43fa832 100644 --- a/test/TestApp/TestApp.cpp +++ b/test/TestApp/TestApp.cpp @@ -6,21 +6,23 @@ #include #include -#include -#include -#include #include "TestApp.h" #include "TestRunner.h" #include "TestReport.h" + +#if !defined(DISABLE_PLAYFABCLIENT_API) +#include + #include "PlayFabApiTest.h" #include "PlayFabEventTest.h" #include "PlayFabTestMultiUserStatic.h" #include "PlayFabTestMultiUserInstance.h" -#include "PlayFabTestAlloc.h" #include "PlayFabPlatformSpecificTest.h" +#endif -using namespace PlayFab; -using namespace ClientModels; +#include + +#include "PlayFabTestAlloc.h" namespace PlayFabUnit { @@ -69,7 +71,10 @@ namespace PlayFabUnit PlayFabTestAlloc allocTest; testRunner.Add(allocTest); -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) + // Set this up for use when the tests finish + this->clientApi = std::make_shared(PlayFab::PlayFabSettings::staticPlayer); + // Add PlayFab API tests. PlayFabApiTest pfApiTest; pfApiTest.SetTitleInfo(testTitleData); @@ -102,14 +107,14 @@ namespace PlayFabUnit // Publish the test summary to STDOUT. Log("%s\n", testRunner.suiteTestSummary.c_str()); -#ifndef DISABLE_PLAYFABCLIENT_API +#if !defined(DISABLE_PLAYFABCLIENT_API) // Publish the test report via cloud script (and wait for it to finish). - PlayFabSettings::staticSettings->titleId = testTitleData.titleId; + PlayFab::PlayFabSettings::staticSettings->titleId = testTitleData.titleId; - LoginWithCustomIDRequest request; - request.CustomId = PlayFabSettings::buildIdentifier; + PlayFab::ClientModels::LoginWithCustomIDRequest request; + request.CustomId = PlayFab::PlayFabSettings::buildIdentifier; request.CreateAccount = true; - PlayFabClientAPI::LoginWithCustomID(request, + this->clientApi->LoginWithCustomID(request, std::bind(&TestApp::OnPostReportLogin, this, std::placeholders::_1, std::placeholders::_2), std::bind(&TestApp::OnPostReportError, this, std::placeholders::_1, std::placeholders::_2), &testRunner.suiteTestReport); @@ -120,13 +125,17 @@ namespace PlayFabUnit cloudResponseConditionVar.wait_until(lk, std::chrono::system_clock::now() + std::chrono::milliseconds(CLOUDSCRIPT_TIMEOUT_MS), [this] {return !this->cloudResponse.empty(); }); lk.unlock(); } -#endif // Publish the cloud script response to STDOUT. Log("Cloud Response: %s\n", cloudResponse.c_str()); +#endif // Return 0 (success) if all tests passed. Otherwise, return 1 (error). - return testRunner.AllTestsPassed() && !cloudResponse.empty() ? 0 : 1; + return testRunner.AllTestsPassed() +#if !defined(DISABLE_PLAYFABCLIENT_API) + && !cloudResponse.empty() ? 0 : 1 +#endif + ; } bool TestApp::LoadTitleData(TestTitleData& titleData) @@ -158,14 +167,12 @@ namespace PlayFabUnit return parsedSuccessfully; } -#ifndef DISABLE_PLAYFABCLIENT_API - void TestApp::OnPostReportLogin(const LoginResult& result, void* customData) +#if !defined(DISABLE_PLAYFABCLIENT_API) + void TestApp::OnPostReportLogin(const PlayFab::ClientModels::LoginResult& result, void* customData) { - cloudPlayFabId = result.PlayFabId; - // Prepare a JSON value as a param for the remote cloud script. Json::Value cloudReportJson; - cloudReportJson["customId"] = cloudPlayFabId; + cloudReportJson["customId"] = result.PlayFabId; // The expected format is a list of TestSuiteReports, but this framework only submits one cloudReportJson["testReport"]; @@ -177,20 +184,20 @@ namespace PlayFabUnit testReport->internalReport.ToJson(cloudReportJson["testReport"][0]); // Save the test results via cloud script. - ExecuteCloudScriptRequest request; + PlayFab::ClientModels::ExecuteCloudScriptRequest request; request.FunctionName = "SaveTestData"; request.FunctionParameter = cloudReportJson; request.GeneratePlayStreamEvent = true; - PlayFabClientAPI::ExecuteCloudScript(request, + this->clientApi->ExecuteCloudScript(request, std::bind(&TestApp::OnPostReportComplete, this, std::placeholders::_1, std::placeholders::_2), std::bind(&TestApp::OnPostReportError, this, std::placeholders::_1, std::placeholders::_2)); } - void TestApp::OnPostReportComplete(const ExecuteCloudScriptResult& result, void* /*customData*/) + void TestApp::OnPostReportComplete(const PlayFab::ClientModels::ExecuteCloudScriptResult& result, void* /*customData*/) { if (result.Error.isNull()) { - cloudResponse = "Test report submitted via cloud script: " + PlayFabSettings::buildIdentifier + ", " + cloudPlayFabId; + cloudResponse = "Test report submitted via cloud script: " + PlayFab::PlayFabSettings::buildIdentifier + ", " + PlayFab::PlayFabSettings::staticPlayer->playFabId; } else { @@ -199,7 +206,7 @@ namespace PlayFabUnit cloudResponseConditionVar.notify_one(); } - void TestApp::OnPostReportError(const PlayFabError& error, void* /*customData*/) + void TestApp::OnPostReportError(const PlayFab::PlayFabError& error, void* /*customData*/) { cloudResponse = "Failed to report results via cloud script: " + error.GenerateErrorReport(); cloudResponseConditionVar.notify_one(); diff --git a/test/TestApp/TestApp.h b/test/TestApp/TestApp.h index 21bd2059..e64aaf43 100644 --- a/test/TestApp/TestApp.h +++ b/test/TestApp/TestApp.h @@ -11,12 +11,13 @@ namespace PlayFab { + class PlayFabClientInstanceAPI; struct PlayFabError; namespace ClientModels { - struct ExecuteCloudScriptResult; struct LoginResult; + struct ExecuteCloudScriptResult; } } @@ -30,15 +31,18 @@ namespace PlayFabUnit static void LogPut(const char* message); private: +#if !defined(DISABLE_PLAYFABCLIENT_API) // Cloud Report std::string cloudResponse = ""; std::string cloudPlayFabId = ""; std::mutex cloudResponseMutex; std::condition_variable cloudResponseConditionVar; + std::shared_ptr clientApi; void OnPostReportLogin(const PlayFab::ClientModels::LoginResult& result, void* customData); void OnPostReportComplete(const PlayFab::ClientModels::ExecuteCloudScriptResult& result, void* /*customData*/); void OnPostReportError(const PlayFab::PlayFabError& error, void* /*customData*/); +#endif // Utility static bool LoadTitleData(TestTitleData& titleData);