Skip to content

Commit

Permalink
Updated from pipeline, Version : 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Oct 11, 2021
1 parent 46975e9 commit 36cfea1
Show file tree
Hide file tree
Showing 33 changed files with 920 additions and 283 deletions.
12 changes: 6 additions & 6 deletions .variables
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export DO_UPDATE=true
export LEVEL=CRITICAL
export REPO_NAME=justice-unreal-sdk-plugin
export WORKDIR=/tmp/pipelines/1583562175/369439194/
export COMMIT_HASH=a2404232a06bcbe3ef3268c1356c3a82cbdd7a59
export GIT_HASH=a2404232a06bcbe3ef3268c1356c3a82cbdd7a59
export VERSION=6.0.0
export REVISION_ID=6.0.0
export WORKDIR=/tmp/pipelines/1666405960/385834505/
export COMMIT_HASH=174eaaf43fd1951aa4dbe2adf704d076281e5284
export GIT_HASH=174eaaf43fd1951aa4dbe2adf704d076281e5284
export VERSION=7.0.0
export REVISION_ID=7.0.0
export [email protected]
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDYuMC4wIC0gY29tbWl0ZWQgYW5kIHRhZ2dlZCBieSBKZW5raW5zCg=='
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDcuMC4wIC0gY29tbWl0ZWQgYW5kIHRhZ2dlZCBieSBKZW5raW5zCg=='
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [7.0.0](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/7.0.0%0D6.1.1) (2021-10-11)


### ⚠ BREAKING CHANGES

* **ServerLobby:** remove GetActiveParties method

### Features

* **DSM:** Save server info when registered into variable and add Getter function ([cccd3b9](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/cccd3b964eb526863064b2533db8535763821579))
* **ecommerce:** Add GetUserEntitlementOwnershipByItemId ([395bb97](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/395bb97a3953c212a40803c28556467bdd821b74))
* **ecommerce:** remove returnURL on CreateNewOrder if empty ([d39cfbc](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/d39cfbcec7b270e49098042f37a42bc5fcbcde95))
* implement qos turn manager to get the closest TURN server ([eeeab32](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/eeeab32995d95e82a25ccec6a18c5f5536cf7ef3))
* **reward:** Add new Reward Endpoint and Integration Test ([5ad088f](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/5ad088f371e1da90f963a2784c718f706eac6e83))
* **settings:** change ResetSettings param from FString to enum ESettingsEnvironment ([b6f7948](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/b6f79489e438c41f1ce47e927d801698bbdf31a6))


### Bug Fixes

* **CheckServicesCompatibility:** Only check compatibility for non shipping build ([e2c78c5](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/e2c78c5c3acfd1d320ffe7aafc0b8edb8d394974))
* **lobby:** linux build failure due to werror on unreal engine > 4.25 ([fd12ddb](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/fd12ddb0d6a02f3530a1eeb57bc7f4d1745ad822))
* **sdkModule:** remove GetDefaultUrl, change it to call from Settings instead ([138acc3](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/138acc34c2f91dd3e18b783b97ed16ed53e95a3a))
* **seasonpass:** season pass tier duplicates when there are more than 1 pass codes ([547b32b](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/547b32bc974b859de360d009efd909f6507d51a5))
* **User:** change UpdateUser verb from PUT to PATCH ([ff6ca90](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/ff6ca90c8ea7ce78c390d7233ba2a56aa8de6741))


### Tests

* **ParseErrorTest:** add unit test for service error parser ([c53be56](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/c53be5697afac1f3e8104ecef3564ea0d01ed589))


### Refactors

* **ServerLobby:** remove GetActiveParties method ([4dc4d8f](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/4dc4d8f304b4d666472086ed2e4425315df6ebba))

### [6.1.1](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/6.1.1%0D6.1.0) (2021-10-01)


Expand Down
4 changes: 2 additions & 2 deletions Content/CompatibilityMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"maxVersion": "1.8.0"
},
"ugc": {
"minVersion": "1.6.1",
"maxVersion": "1.6.1"
"minVersion": "1.6.2",
"maxVersion": "1.6.2"
},
"lobby": {
"minVersion": "2.2.0",
Expand Down
45 changes: 4 additions & 41 deletions Source/AccelByteUe4Sdk/Private/AccelByteUe4SdkModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
#include "ISettingsSection.h"
#endif

FString GetDefaultAPIUrl(const FString& SpecificServerUrl, const FString& DefaultServerPath)
{
if (SpecificServerUrl.IsEmpty())
{
return FString::Printf(TEXT("%s/%s"), *FRegistry::Settings.BaseUrl, *DefaultServerPath);
}

return SpecificServerUrl;
}

FString GetDefaultServerAPIUrl(const FString& SpecificServerUrl, const FString& DefaultServerPath)
{
if (SpecificServerUrl.IsEmpty())
Expand Down Expand Up @@ -67,7 +57,10 @@ void FAccelByteUe4SdkModule::StartupModule()
RegisterSettings();
LoadSettingsFromConfigUobject();
LoadServerSettingsFromConfigUobject();

#if UE_BUILD_DEVELOPMENT
CheckServicesCompatibility();
#endif

FRegistry::HttpRetryScheduler.Startup();
FRegistry::Credentials.Startup();
Expand Down Expand Up @@ -126,41 +119,11 @@ void FAccelByteUe4SdkModule::UnregisterSettings()

bool FAccelByteUe4SdkModule::LoadSettingsFromConfigUobject()
{
FRegistry::Settings.ClientId = GetDefault<UAccelByteSettings>()->ClientId;
FRegistry::Settings.ClientSecret = GetDefault<UAccelByteSettings>()->ClientSecret;
FRegistry::Settings.Namespace = GetDefault<UAccelByteSettings>()->Namespace;
FRegistry::Settings.PublisherNamespace = GetDefault<UAccelByteSettings>()->PublisherNamespace;
FRegistry::Settings.RedirectURI = GetDefault<UAccelByteSettings>()->RedirectURI;
FRegistry::Settings.BaseUrl = GetDefault<UAccelByteSettings>()->BaseUrl;
FRegistry::Settings.Reset(ESettingsEnvironment::Default);

NullCheckConfig(*FRegistry::Settings.ClientId, "Client ID");
NullCheckConfig(*FRegistry::Settings.Namespace, "Namespace");
NullCheckConfig(*FRegistry::Settings.BaseUrl, "Base URL");

FRegistry::Settings.IamServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->IamServerUrl, TEXT("iam"));
FRegistry::Settings.PlatformServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->PlatformServerUrl, TEXT("platform"));
FRegistry::Settings.LobbyServerUrl = GetDefault<UAccelByteSettings>()->LobbyServerUrl;
if (FRegistry::Settings.LobbyServerUrl.IsEmpty())
{
const FString BaseUrl = FRegistry::Settings.BaseUrl.Replace(TEXT("https://"), TEXT("wss://"));
FRegistry::Settings.LobbyServerUrl = FString::Printf(TEXT("%s/%s"), *BaseUrl, TEXT("lobby/"));
}
FRegistry::Settings.BasicServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->BasicServerUrl, TEXT("basic"));
FRegistry::Settings.CloudStorageServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->CloudStorageServerUrl, TEXT("social"));
FRegistry::Settings.GameProfileServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->GameProfileServerUrl, TEXT("social"));
FRegistry::Settings.StatisticServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->StatisticServerUrl, TEXT("social"));
FRegistry::Settings.QosManagerServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->QosManagerServerUrl, TEXT("qosm"));
FRegistry::Settings.LeaderboardServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->LeaderboardServerUrl, TEXT("leaderboard"));
FRegistry::Settings.GameTelemetryServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->GameTelemetryServerUrl, TEXT("game-telemetry"));
FRegistry::Settings.AgreementServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->AgreementServerUrl, TEXT("agreement"));
FRegistry::Settings.CloudSaveServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->CloudSaveServerUrl, TEXT("cloudsave"));
FRegistry::Settings.AchievementServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->AchievementServerUrl, TEXT("achievement"));
FRegistry::Settings.SessionBrowserServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->SessionBrowserServerUrl, TEXT("sessionbrowser"));
FRegistry::Settings.UGCServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->UGCServerUrl, TEXT("ugc"));
FRegistry::Settings.SeasonPassServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->UGCServerUrl, TEXT("seasonpass"));
FRegistry::Settings.ReportingServerUrl = GetDefaultAPIUrl(GetDefault<UAccelByteSettings>()->ReportingServerUrl, TEXT("reporting"));
FRegistry::Settings.AppId = GetDefault<UAccelByteSettings>()->AppId;
FRegistry::Credentials.SetClientCredentials(FRegistry::Settings.ClientId, FRegistry::Settings.ClientSecret);

return true;
}
Expand Down
21 changes: 21 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteEntitlementApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,27 @@ void Entitlement::GetUserEntitlementOwnershipBySku(FString const& Sku, THandler<
HttpRef.ProcessRequest(Request, CreateHttpResultHandler(OnSuccess, OnError), FPlatformTime::Seconds());
}

void Entitlement::GetUserEntitlementOwnershipByItemId(FString const& ItemId, THandler<FAccelByteModelsEntitlementOwnership> const& OnSuccess, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

FString Authorization = FString::Printf(TEXT("Bearer %s"), *CredentialsRef.GetAccessToken());
FString Url = FString::Printf(TEXT("%s/public/namespaces/%s/users/me/entitlements/ownership/byItemId?itemId=%s"), *SettingsRef.PlatformServerUrl, *SettingsRef.Namespace, *ItemId);

FString Verb = TEXT("GET");
FString ContentType = TEXT("application/json");
FString Accept = TEXT("application/json");

FHttpRequestPtr Request = FHttpModule::Get().CreateRequest();
Request->SetURL(Url);
Request->SetHeader(TEXT("Authorization"), Authorization);
Request->SetVerb(Verb);
Request->SetHeader(TEXT("Content-Type"), ContentType);
Request->SetHeader(TEXT("Accept"), Accept);

HttpRef.ProcessRequest(Request, CreateHttpResultHandler(OnSuccess, OnError), FPlatformTime::Seconds());
}

void Entitlement::GetUserEntitlementOwnershipAny(
TArray<FString> const ItemIds,
TArray<FString> const AppIds,
Expand Down
6 changes: 3 additions & 3 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteLobbyApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1691,11 +1691,11 @@ void Lobby::FetchLobbyErrorMessages()

bool bFetchErrorMessageDone = false;
FHttpClient HttpClient(Credentials, Settings, HttpRef);
HttpClient.Request("GET", Url, {}, "", {}, THandler<TArray<FLobbyMessages>>::CreateLambda([&](const TArray<FLobbyMessages>& result)
HttpClient.Request("GET", Url, {}, "", {}, THandler<TArray<FLobbyMessages>>::CreateLambda([&](const TArray<FLobbyMessages>& Result)
{
for(const FLobbyMessages code : result)
for(const FLobbyMessages& LobbyMessages : Result)
{
LobbyErrorMessages.Add(code.Code, code.CodeName);
LobbyErrorMessages.Add(LobbyMessages.Code, LobbyMessages.CodeName);
}

bFetchErrorMessageDone = true;
Expand Down
9 changes: 7 additions & 2 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteOrderApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Core/AccelByteRegistry.h"
#include "Core/AccelByteReport.h"
#include "Core/AccelByteHttpRetryScheduler.h"
#include "Core/AccelByteUtilities.h"
#include "Core/AccelByteSettings.h"

namespace AccelByte
Expand All @@ -32,8 +33,12 @@ void Order::CreateNewOrder(const FAccelByteModelsOrderCreate& OrderCreate, const
FString Verb = TEXT("POST");
FString ContentType = TEXT("application/json");
FString Accept = TEXT("application/json");
FString Content;
FJsonObjectConverter::UStructToJsonObjectString(OrderCreate, Content);
FString Content;

TSharedPtr<FJsonObject> JsonObject = FJsonObjectConverter::UStructToJsonObject(OrderCreate);
FAccelByteUtilities::RemoveEmptyStrings(JsonObject);
TSharedRef<TJsonWriter<>> Writer = TJsonWriterFactory<>::Create(&Content);
FJsonSerializer::Serialize(JsonObject.ToSharedRef(), Writer);

FHttpRequestPtr Request = FHttpModule::Get().CreateRequest();
Request->SetURL(Url);
Expand Down
133 changes: 133 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteRewardApi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.

#include "Api/AccelByteRewardApi.h"

#include "Core/AccelByteReport.h"
#include "Core/AccelByteSettings.h"

namespace AccelByte
{
namespace Api
{
Reward::Reward(
Credentials const& CredentialsRef,
Settings const& SettingsRef,
FHttpRetryScheduler& HttpRef):
HttpRef(HttpRef),
CredentialsRef(CredentialsRef),
SettingsRef(SettingsRef) {}

Reward::~Reward() {}

FString Reward::ConvertRewardSortByToString(EAccelByteRewardListSortBy const& SortBy)
{
switch (SortBy)
{
case EAccelByteRewardListSortBy::NAMESPACE:
return TEXT("namespace");
case EAccelByteRewardListSortBy::NAMESPACE_ASC:
return TEXT("namespace%3Aasc");
case EAccelByteRewardListSortBy::NAMESPACE_DESC:
return TEXT("namespace%3Adesc");
case EAccelByteRewardListSortBy::REWARDCODE:
return TEXT("rewardcode");
case EAccelByteRewardListSortBy::REWARDCODE_ASC:
return TEXT("rewardcode%3Aasc");
case EAccelByteRewardListSortBy::REWARDCODE_DESC:
return TEXT("rewardcode%3Adesc");
}
return TEXT("");
}

void Reward::GetRewardByRewardCode(FString const& RewardCode, THandler<FAccelByteModelsRewardInfo> const& OnSuccess, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

FString Authorization = FString::Printf(TEXT("Bearer %s"), *CredentialsRef.GetAccessToken());
FString Url = FString::Printf(TEXT("%s/public/namespaces/%s/rewards/byCode"), *SettingsRef.PlatformServerUrl, *CredentialsRef.GetNamespace());
Url.Append(FString::Printf(TEXT("?rewardCode=%s"), *RewardCode));
FString Verb = TEXT("GET");
FString ContentType = TEXT("application/json");
FString Accept = TEXT("application/json");
FString Content;

FHttpRequestPtr Request = FHttpModule::Get().CreateRequest();
Request->SetURL(Url);
Request->SetHeader(TEXT("Authorization"), Authorization);
Request->SetVerb(Verb);
Request->SetHeader(TEXT("Content-Type"), ContentType);
Request->SetHeader(TEXT("Accept"), Accept);
Request->SetContentAsString(Content);

HttpRef.ProcessRequest(Request, CreateHttpResultHandler(OnSuccess, OnError), FPlatformTime::Seconds());
}

void Reward::GetRewardByRewardId(FString const& RewardId, THandler<FAccelByteModelsRewardInfo> const& OnSuccess, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

FString Authorization = FString::Printf(TEXT("Bearer %s"), *CredentialsRef.GetAccessToken());
FString Url = FString::Printf(TEXT("%s/public/namespaces/%s/rewards/%s"), *SettingsRef.PlatformServerUrl, *CredentialsRef.GetNamespace(), *RewardId);
FString Verb = TEXT("GET");
FString ContentType = TEXT("application/json");
FString Accept = TEXT("application/json");
FString Content;

FHttpRequestPtr Request = FHttpModule::Get().CreateRequest();
Request->SetURL(Url);
Request->SetHeader(TEXT("Authorization"), Authorization);
Request->SetVerb(Verb);
Request->SetHeader(TEXT("Content-Type"), ContentType);
Request->SetHeader(TEXT("Accept"), Accept);
Request->SetContentAsString(Content);

HttpRef.ProcessRequest(Request, CreateHttpResultHandler(OnSuccess, OnError), FPlatformTime::Seconds());
}

void Reward::QueryRewards(FString const& EventTopic, int32 Offset, int32 Limit, EAccelByteRewardListSortBy const& SortBy, THandler<FAccelByteModelsQueryReward> const& OnSuccess, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

FString Authorization = FString::Printf(TEXT("Bearer %s"), *CredentialsRef.GetAccessToken());
FString Url = FString::Printf(TEXT("%s/public/namespaces/%s/rewards/byCriteria"), *SettingsRef.PlatformServerUrl, *CredentialsRef.GetNamespace());
FString Verb = TEXT("GET");
FString ContentType = TEXT("application/json");
FString Accept = TEXT("application/json");
FString Query = TEXT("");

if (!EventTopic.IsEmpty())
{
Query.Append(Query.IsEmpty() ? TEXT("") : TEXT("&"));
Query.Append(FString::Printf(TEXT("eventTopic=%s"), *EventTopic));
}
if (Offset >= 0)
{
Query.Append(Query.IsEmpty() ? TEXT("") : TEXT("&"));
Query.Append(FString::Printf(TEXT("offset=%d"), Offset));
}
if (Limit >= 0)
{
Query.Append(Query.IsEmpty() ? TEXT("") : TEXT("&"));
Query.Append(FString::Printf(TEXT("limit=%d"), Limit));
}
if (SortBy != EAccelByteRewardListSortBy::NONE)
{
Query.Append(Query.IsEmpty() ? TEXT("") : TEXT("&"));
Query.Append(FString::Printf(TEXT("sortBy=%s"), *ConvertRewardSortByToString(SortBy)));
}
Url.Append(Query.IsEmpty() ? TEXT("") : FString::Printf(TEXT("?%s"), *Query));

FHttpRequestPtr Request = FHttpModule::Get().CreateRequest();
Request->SetURL(Url);
Request->SetHeader(TEXT("Authorization"), Authorization);
Request->SetVerb(Verb);
Request->SetHeader(TEXT("Content-Type"), ContentType);
Request->SetHeader(TEXT("Accept"), Accept);

HttpRef.ProcessRequest(Request, CreateHttpResultHandler(OnSuccess, OnError), FPlatformTime::Seconds());
}

} // Namespace Api
} // Namespace AccelByte
15 changes: 6 additions & 9 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteSeasonPassApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ namespace AccelByte
// Convert the Tier JsonObject to TMap<FString, TArray<FString>>
TArray<FAccelByteModelsSeasonPassTier> Tiers;

for (FString const& PassCode : SeasonResult.PassCodes)
for (FAccelByteModelsSeasonPassTierJsonObject const& Tier : SeasonResult.Tiers)
{
for (FAccelByteModelsSeasonPassTierJsonObject const& Tier : SeasonResult.Tiers)
{
FAccelByteModelsSeasonPassTier TierRes;
TierRes.Id = Tier.Id;
TierRes.RequiredExp = Tier.RequiredExp;
TierRes.Rewards = FJsonObjectToPassRewards(Tier.Rewards.JsonObject);
Tiers.Add(TierRes);
}
FAccelByteModelsSeasonPassTier TierRes;
TierRes.Id = Tier.Id;
TierRes.RequiredExp = Tier.RequiredExp;
TierRes.Rewards = FJsonObjectToPassRewards(Tier.Rewards.JsonObject);
Tiers.Add(TierRes);
}

FAccelByteModelsSeasonInfo const EndResult
Expand Down
Loading

0 comments on commit 36cfea1

Please sign in to comment.