diff --git a/code/include/playfab/PlayFabClientApi.h b/code/include/playfab/PlayFabClientApi.h index 2b34817f..a0ca48c7 100644 --- a/code/include/playfab/PlayFabClientApi.h +++ b/code/include/playfab/PlayFabClientApi.h @@ -86,6 +86,7 @@ namespace PlayFab static void GetPlayFabIDsFromNintendoServiceAccountIds(ClientModels::GetPlayFabIDsFromNintendoServiceAccountIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromNintendoSwitchDeviceIds(ClientModels::GetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromPSNAccountIDs(ClientModels::GetPlayFabIDsFromPSNAccountIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetPlayFabIDsFromPSNOnlineIDs(ClientModels::GetPlayFabIDsFromPSNOnlineIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromSteamIDs(ClientModels::GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromTwitchIDs(ClientModels::GetPlayFabIDsFromTwitchIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromXboxLiveIDs(ClientModels::GetPlayFabIDsFromXboxLiveIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -255,6 +256,7 @@ namespace PlayFab static void OnGetPlayFabIDsFromNintendoServiceAccountIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromPSNAccountIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetPlayFabIDsFromPSNOnlineIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromSteamIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromTwitchIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromXboxLiveIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); diff --git a/code/include/playfab/PlayFabClientDataModels.h b/code/include/playfab/PlayFabClientDataModels.h index a449fbf3..c979f2e2 100644 --- a/code/include/playfab/PlayFabClientDataModels.h +++ b/code/include/playfab/PlayFabClientDataModels.h @@ -13146,6 +13146,103 @@ namespace PlayFab } }; + struct GetPlayFabIDsFromPSNOnlineIDsRequest : public PlayFabRequestCommon + { + Boxed IssuerId; + std::list PSNOnlineIDs; + + GetPlayFabIDsFromPSNOnlineIDsRequest() : + PlayFabRequestCommon(), + IssuerId(), + PSNOnlineIDs() + {} + + GetPlayFabIDsFromPSNOnlineIDsRequest(const GetPlayFabIDsFromPSNOnlineIDsRequest& src) : + PlayFabRequestCommon(), + IssuerId(src.IssuerId), + PSNOnlineIDs(src.PSNOnlineIDs) + {} + + ~GetPlayFabIDsFromPSNOnlineIDsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["IssuerId"], IssuerId); + FromJsonUtilS(input["PSNOnlineIDs"], PSNOnlineIDs); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_IssuerId; ToJsonUtilP(IssuerId, each_IssuerId); output["IssuerId"] = each_IssuerId; + Json::Value each_PSNOnlineIDs; ToJsonUtilS(PSNOnlineIDs, each_PSNOnlineIDs); output["PSNOnlineIDs"] = each_PSNOnlineIDs; + return output; + } + }; + + struct PSNOnlinePlayFabIdPair : public PlayFabBaseModel + { + std::string PlayFabId; + std::string PSNOnlineId; + + PSNOnlinePlayFabIdPair() : + PlayFabBaseModel(), + PlayFabId(), + PSNOnlineId() + {} + + PSNOnlinePlayFabIdPair(const PSNOnlinePlayFabIdPair& src) : + PlayFabBaseModel(), + PlayFabId(src.PlayFabId), + PSNOnlineId(src.PSNOnlineId) + {} + + ~PSNOnlinePlayFabIdPair() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["PlayFabId"], PlayFabId); + FromJsonUtilS(input["PSNOnlineId"], PSNOnlineId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_PlayFabId; ToJsonUtilS(PlayFabId, each_PlayFabId); output["PlayFabId"] = each_PlayFabId; + Json::Value each_PSNOnlineId; ToJsonUtilS(PSNOnlineId, each_PSNOnlineId); output["PSNOnlineId"] = each_PSNOnlineId; + return output; + } + }; + + struct GetPlayFabIDsFromPSNOnlineIDsResult : public PlayFabResultCommon + { + std::list Data; + + GetPlayFabIDsFromPSNOnlineIDsResult() : + PlayFabResultCommon(), + Data() + {} + + GetPlayFabIDsFromPSNOnlineIDsResult(const GetPlayFabIDsFromPSNOnlineIDsResult& src) : + PlayFabResultCommon(), + Data(src.Data) + {} + + ~GetPlayFabIDsFromPSNOnlineIDsResult() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Data"], Data); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Data; ToJsonUtilO(Data, each_Data); output["Data"] = each_Data; + return output; + } + }; + struct GetPlayFabIDsFromSteamIDsRequest : public PlayFabRequestCommon { std::list SteamStringIDs; diff --git a/code/include/playfab/PlayFabClientInstanceApi.h b/code/include/playfab/PlayFabClientInstanceApi.h index d4864b51..6477f94a 100644 --- a/code/include/playfab/PlayFabClientInstanceApi.h +++ b/code/include/playfab/PlayFabClientInstanceApi.h @@ -104,6 +104,7 @@ namespace PlayFab void GetPlayFabIDsFromNintendoServiceAccountIds(ClientModels::GetPlayFabIDsFromNintendoServiceAccountIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromNintendoSwitchDeviceIds(ClientModels::GetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromPSNAccountIDs(ClientModels::GetPlayFabIDsFromPSNAccountIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetPlayFabIDsFromPSNOnlineIDs(ClientModels::GetPlayFabIDsFromPSNOnlineIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromSteamIDs(ClientModels::GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromTwitchIDs(ClientModels::GetPlayFabIDsFromTwitchIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromXboxLiveIDs(ClientModels::GetPlayFabIDsFromXboxLiveIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -269,6 +270,7 @@ namespace PlayFab void OnGetPlayFabIDsFromNintendoServiceAccountIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromPSNAccountIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetPlayFabIDsFromPSNOnlineIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromSteamIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromTwitchIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromXboxLiveIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); diff --git a/code/include/playfab/PlayFabServerApi.h b/code/include/playfab/PlayFabServerApi.h index cfe579c6..0f979cda 100644 --- a/code/include/playfab/PlayFabServerApi.h +++ b/code/include/playfab/PlayFabServerApi.h @@ -75,6 +75,7 @@ namespace PlayFab static void GetPlayFabIDsFromNintendoServiceAccountIds(ServerModels::GetPlayFabIDsFromNintendoServiceAccountIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromNintendoSwitchDeviceIds(ServerModels::GetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromPSNAccountIDs(ServerModels::GetPlayFabIDsFromPSNAccountIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + static void GetPlayFabIDsFromPSNOnlineIDs(ServerModels::GetPlayFabIDsFromPSNOnlineIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromSteamIDs(ServerModels::GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromTwitchIDs(ServerModels::GetPlayFabIDsFromTwitchIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); static void GetPlayFabIDsFromXboxLiveIDs(ServerModels::GetPlayFabIDsFromXboxLiveIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -216,6 +217,7 @@ namespace PlayFab static void OnGetPlayFabIDsFromNintendoServiceAccountIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromPSNAccountIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + static void OnGetPlayFabIDsFromPSNOnlineIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromSteamIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromTwitchIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); static void OnGetPlayFabIDsFromXboxLiveIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); diff --git a/code/include/playfab/PlayFabServerDataModels.h b/code/include/playfab/PlayFabServerDataModels.h index ffe301c9..72f68100 100644 --- a/code/include/playfab/PlayFabServerDataModels.h +++ b/code/include/playfab/PlayFabServerDataModels.h @@ -20727,6 +20727,103 @@ namespace PlayFab } }; + struct GetPlayFabIDsFromPSNOnlineIDsRequest : public PlayFabRequestCommon + { + Boxed IssuerId; + std::list PSNOnlineIDs; + + GetPlayFabIDsFromPSNOnlineIDsRequest() : + PlayFabRequestCommon(), + IssuerId(), + PSNOnlineIDs() + {} + + GetPlayFabIDsFromPSNOnlineIDsRequest(const GetPlayFabIDsFromPSNOnlineIDsRequest& src) : + PlayFabRequestCommon(), + IssuerId(src.IssuerId), + PSNOnlineIDs(src.PSNOnlineIDs) + {} + + ~GetPlayFabIDsFromPSNOnlineIDsRequest() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilP(input["IssuerId"], IssuerId); + FromJsonUtilS(input["PSNOnlineIDs"], PSNOnlineIDs); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_IssuerId; ToJsonUtilP(IssuerId, each_IssuerId); output["IssuerId"] = each_IssuerId; + Json::Value each_PSNOnlineIDs; ToJsonUtilS(PSNOnlineIDs, each_PSNOnlineIDs); output["PSNOnlineIDs"] = each_PSNOnlineIDs; + return output; + } + }; + + struct PSNOnlinePlayFabIdPair : public PlayFabBaseModel + { + std::string PlayFabId; + std::string PSNOnlineId; + + PSNOnlinePlayFabIdPair() : + PlayFabBaseModel(), + PlayFabId(), + PSNOnlineId() + {} + + PSNOnlinePlayFabIdPair(const PSNOnlinePlayFabIdPair& src) : + PlayFabBaseModel(), + PlayFabId(src.PlayFabId), + PSNOnlineId(src.PSNOnlineId) + {} + + ~PSNOnlinePlayFabIdPair() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilS(input["PlayFabId"], PlayFabId); + FromJsonUtilS(input["PSNOnlineId"], PSNOnlineId); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_PlayFabId; ToJsonUtilS(PlayFabId, each_PlayFabId); output["PlayFabId"] = each_PlayFabId; + Json::Value each_PSNOnlineId; ToJsonUtilS(PSNOnlineId, each_PSNOnlineId); output["PSNOnlineId"] = each_PSNOnlineId; + return output; + } + }; + + struct GetPlayFabIDsFromPSNOnlineIDsResult : public PlayFabResultCommon + { + std::list Data; + + GetPlayFabIDsFromPSNOnlineIDsResult() : + PlayFabResultCommon(), + Data() + {} + + GetPlayFabIDsFromPSNOnlineIDsResult(const GetPlayFabIDsFromPSNOnlineIDsResult& src) : + PlayFabResultCommon(), + Data(src.Data) + {} + + ~GetPlayFabIDsFromPSNOnlineIDsResult() = default; + + void FromJson(const Json::Value& input) override + { + FromJsonUtilO(input["Data"], Data); + } + + Json::Value ToJson() const override + { + Json::Value output; + Json::Value each_Data; ToJsonUtilO(Data, each_Data); output["Data"] = each_Data; + return output; + } + }; + struct GetPlayFabIDsFromSteamIDsRequest : public PlayFabRequestCommon { std::list SteamStringIDs; diff --git a/code/include/playfab/PlayFabServerInstanceApi.h b/code/include/playfab/PlayFabServerInstanceApi.h index c776038d..a0d79635 100644 --- a/code/include/playfab/PlayFabServerInstanceApi.h +++ b/code/include/playfab/PlayFabServerInstanceApi.h @@ -93,6 +93,7 @@ namespace PlayFab void GetPlayFabIDsFromNintendoServiceAccountIds(ServerModels::GetPlayFabIDsFromNintendoServiceAccountIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromNintendoSwitchDeviceIds(ServerModels::GetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromPSNAccountIDs(ServerModels::GetPlayFabIDsFromPSNAccountIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); + void GetPlayFabIDsFromPSNOnlineIDs(ServerModels::GetPlayFabIDsFromPSNOnlineIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromSteamIDs(ServerModels::GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromTwitchIDs(ServerModels::GetPlayFabIDsFromTwitchIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); void GetPlayFabIDsFromXboxLiveIDs(ServerModels::GetPlayFabIDsFromXboxLiveIDsRequest& request, const ProcessApiCallback callback, const ErrorCallback errorCallback = nullptr, void* customData = nullptr); @@ -230,6 +231,7 @@ namespace PlayFab void OnGetPlayFabIDsFromNintendoServiceAccountIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromPSNAccountIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); + void OnGetPlayFabIDsFromPSNOnlineIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromSteamIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromTwitchIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); void OnGetPlayFabIDsFromXboxLiveIDsResult(int httpCode, const std::string& result, const std::shared_ptr& reqContainer); diff --git a/code/source/playfab/PlayFabClientApi.cpp b/code/source/playfab/PlayFabClientApi.cpp index 825a97a1..67af2830 100644 --- a/code/source/playfab/PlayFabClientApi.cpp +++ b/code/source/playfab/PlayFabClientApi.cpp @@ -2675,6 +2675,55 @@ namespace PlayFab } } + void PlayFabClientAPI::GetPlayFabIDsFromPSNOnlineIDs( + GetPlayFabIDsFromPSNOnlineIDsRequest& 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-Authorization", context->clientSessionTicket); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Client/GetPlayFabIDsFromPSNOnlineIDs", + headers, + jsonAsString, + OnGetPlayFabIDsFromPSNOnlineIDsResult, + 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 PlayFabClientAPI::OnGetPlayFabIDsFromPSNOnlineIDsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetPlayFabIDsFromPSNOnlineIDsResult 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 PlayFabClientAPI::GetPlayFabIDsFromSteamIDs( GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, diff --git a/code/source/playfab/PlayFabClientInstanceApi.cpp b/code/source/playfab/PlayFabClientInstanceApi.cpp index 72be9c8e..8418b563 100644 --- a/code/source/playfab/PlayFabClientInstanceApi.cpp +++ b/code/source/playfab/PlayFabClientInstanceApi.cpp @@ -2762,6 +2762,56 @@ namespace PlayFab } } + void PlayFabClientInstanceAPI::GetPlayFabIDsFromPSNOnlineIDs( + GetPlayFabIDsFromPSNOnlineIDsRequest& 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-Authorization", context->clientSessionTicket); + + auto reqContainer = std::unique_ptr(new CallRequestContainer( + "/Client/GetPlayFabIDsFromPSNOnlineIDs", + headers, + jsonAsString, + std::bind(&PlayFabClientInstanceAPI::OnGetPlayFabIDsFromPSNOnlineIDsResult, 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 PlayFabClientInstanceAPI::OnGetPlayFabIDsFromPSNOnlineIDsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetPlayFabIDsFromPSNOnlineIDsResult 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 PlayFabClientInstanceAPI::GetPlayFabIDsFromSteamIDs( GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, diff --git a/code/source/playfab/PlayFabServerApi.cpp b/code/source/playfab/PlayFabServerApi.cpp index fa78c49d..81b0cf17 100644 --- a/code/source/playfab/PlayFabServerApi.cpp +++ b/code/source/playfab/PlayFabServerApi.cpp @@ -2283,6 +2283,55 @@ namespace PlayFab } } + void PlayFabServerAPI::GetPlayFabIDsFromPSNOnlineIDs( + GetPlayFabIDsFromPSNOnlineIDsRequest& 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/GetPlayFabIDsFromPSNOnlineIDs", + headers, + jsonAsString, + OnGetPlayFabIDsFromPSNOnlineIDsResult, + 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::OnGetPlayFabIDsFromPSNOnlineIDsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetPlayFabIDsFromPSNOnlineIDsResult 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::GetPlayFabIDsFromSteamIDs( GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, diff --git a/code/source/playfab/PlayFabServerInstanceApi.cpp b/code/source/playfab/PlayFabServerInstanceApi.cpp index eb347e41..9cdc0f17 100644 --- a/code/source/playfab/PlayFabServerInstanceApi.cpp +++ b/code/source/playfab/PlayFabServerInstanceApi.cpp @@ -2360,6 +2360,56 @@ namespace PlayFab } } + void PlayFabServerInstanceAPI::GetPlayFabIDsFromPSNOnlineIDs( + GetPlayFabIDsFromPSNOnlineIDsRequest& 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/GetPlayFabIDsFromPSNOnlineIDs", + headers, + jsonAsString, + std::bind(&PlayFabServerInstanceAPI::OnGetPlayFabIDsFromPSNOnlineIDsResult, 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::OnGetPlayFabIDsFromPSNOnlineIDsResult(int /*httpCode*/, const std::string& /*result*/, const std::shared_ptr& reqContainer) + { + CallRequestContainer& container = static_cast(*reqContainer); + std::shared_ptr context = container.GetContext(); + + GetPlayFabIDsFromPSNOnlineIDsResult 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::GetPlayFabIDsFromSteamIDs( GetPlayFabIDsFromSteamIDsRequest& request, const ProcessApiCallback callback, diff --git a/code/source/playfab/PlayFabSettings.cpp b/code/source/playfab/PlayFabSettings.cpp index 0a050ea8..2ea12c8f 100644 --- a/code/source/playfab/PlayFabSettings.cpp +++ b/code/source/playfab/PlayFabSettings.cpp @@ -7,9 +7,9 @@ namespace PlayFab // Control whether all callbacks are threaded or whether the user manually controls callback timing from their main-thread // Note ANY api call may synchronously throw an exception if the title id is not set bool PlayFabSettings::threadedCallbacks = false; - const std::string PlayFabSettings::sdkVersion = "3.130.240119"; + const std::string PlayFabSettings::sdkVersion = "3.131.240202"; const std::string PlayFabSettings::buildIdentifier = "adobuild_xplatcppsdk_117"; - const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.130.240119"; + const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.131.240202"; std::string PlayFabSettings::productionEnvironmentURL = ".playfabapi.com"; ErrorCallback PlayFabSettings::globalErrorHandler = nullptr; diff --git a/com.playfab.xplatcppsdk.v141.autopkg b/com.playfab.xplatcppsdk.v141.autopkg index 3540c847..4d2ed601 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.130.240119; + version : 3.131.240202; title: "PlayFab Cross Platform C++ Sdk for Visual Studio 2017"; summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience."; authors: "PlayFab"; @@ -18,7 +18,7 @@ nuget { iconUrl: "https://playfab.com/assets/img/playfab-mark.png"; requireLicenseAcceptance: false; description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services."; - releaseNotes: "https://api.playfab.com/releaseNotes/#240119"; + releaseNotes: "https://api.playfab.com/releaseNotes/#240202"; copyright: "Copyright 2024"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native }; diff --git a/com.playfab.xplatcppsdk.v141.nuspec b/com.playfab.xplatcppsdk.v141.nuspec index 8db9d2e0..6b9b5ce5 100644 --- a/com.playfab.xplatcppsdk.v141.nuspec +++ b/com.playfab.xplatcppsdk.v141.nuspec @@ -2,14 +2,14 @@ com.playfab.xplatcppsdk.v141 - 3.130.240119 + 3.131.240202 Microsoft Microsoft http://github.com/PlayFab/XPlatCppSdk Apache-2.0 ./images/icon.png false - https://api.playfab.com/releaseNotes/#3.130.240119 + https://api.playfab.com/releaseNotes/#3.131.240202 Microsoft Azure PlayFab XPlatCppSdk © Microsoft Corporation. All rights reserved. Microsoft Azure PlayFab Baas Paas JSON REST HTTP SSL API cloud liveops game gamedev native nativepackage diff --git a/com.playfab.xplatcppsdk.v142.autopkg b/com.playfab.xplatcppsdk.v142.autopkg index 48b3a27f..aefc9b06 100644 --- a/com.playfab.xplatcppsdk.v142.autopkg +++ b/com.playfab.xplatcppsdk.v142.autopkg @@ -8,7 +8,7 @@ configurations { nuget { nuspec { id = "com.playfab.xplatcppsdk.v142"; - version : 3.130.240119; + version : 3.131.240202; title: "PlayFab Cross Platform C++ Sdk for Visual Studio 2019+"; summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience."; authors: "PlayFab"; @@ -18,7 +18,7 @@ nuget { iconUrl: "https://playfab.com/assets/img/playfab-mark.png"; requireLicenseAcceptance: false; description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services."; - releaseNotes: "https://api.playfab.com/releaseNotes/#240119"; + releaseNotes: "https://api.playfab.com/releaseNotes/#240202"; copyright: "Copyright 2024"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native }; diff --git a/com.playfab.xplatcppsdk.v142.nuspec b/com.playfab.xplatcppsdk.v142.nuspec index 9c91d4d8..473f940a 100644 --- a/com.playfab.xplatcppsdk.v142.nuspec +++ b/com.playfab.xplatcppsdk.v142.nuspec @@ -2,14 +2,14 @@ com.playfab.xplatcppsdk.v142 - 3.130.240119 + 3.131.240202 Microsoft Microsoft http://github.com/PlayFab/XPlatCppSdk Apache-2.0 ./images/icon.png false - https://api.playfab.com/releaseNotes/#3.130.240119 + https://api.playfab.com/releaseNotes/#3.131.240202 Microsoft Azure PlayFab XPlatCppSdk © Microsoft Corporation. All rights reserved. Microsoft Azure PlayFab Baas Paas JSON REST HTTP SSL API cloud liveops game gamedev native nativepackage diff --git a/com.playfab.xplatxboxsdk.v141.autopkg b/com.playfab.xplatxboxsdk.v141.autopkg index dc63ed49..f94fcf18 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.130.240119; + version : 3.131.240202; title: "PlayFab Xbox Platform C++ Sdk for Visual Studio 2017"; summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience."; authors: "PlayFab"; @@ -28,7 +28,7 @@ nuget { iconUrl: "https://playfab.com/assets/img/playfab-mark.png"; requireLicenseAcceptance: false; description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services."; - releaseNotes: "https://api.playfab.com/releaseNotes/#240119"; + releaseNotes: "https://api.playfab.com/releaseNotes/#240202"; copyright: "Copyright 2024"; language: "C++"; tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native, xbox };