-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated from pipeline, Version : 7.0.0
- Loading branch information
1 parent
46975e9
commit 36cfea1
Showing
33 changed files
with
920 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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==' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
Source/AccelByteUe4Sdk/Private/Api/AccelByteRewardApi.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.