Skip to content

Commit

Permalink
Updated from pipeline, Version : 25.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Mar 8, 2024
1 parent b3dd058 commit 8fe2040
Show file tree
Hide file tree
Showing 35 changed files with 2,641 additions and 137 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/6224678981/1185140299/
export COMMIT_HASH=04e3cdf349660cc7a31c7d08f19031af80d7c552
export GIT_HASH=04e3cdf349660cc7a31c7d08f19031af80d7c552
export VERSION=24.11.0
export REVISION_ID=24.11.0
export WORKDIR=/tmp/pipelines/6350100201/1206134264/
export COMMIT_HASH=dc8b273dfc96d049a1995c05a3888d9b61625948
export GIT_HASH=dc8b273dfc96d049a1995c05a3888d9b61625948
export VERSION=25.0.0
export REVISION_ID=25.0.0
export [email protected]
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI0LjExLjAgLSBjb21taXRlZCBhbmQgdGFnZ2VkIGJ5IEplbmtpbnNhZ3NWZXJzaW9uOiIzLjY4LjAiCgo='
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI1LjAuMCAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2luc2Fnc1ZlcnNpb246IjMuNjkuMCIKCg=='
4 changes: 2 additions & 2 deletions AccelByteUe4Sdk.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 57,
"VersionName": "24.11.0",
"Version": 58,
"VersionName": "25.0.0",
"FriendlyName": "AccelByte Unreal Engine SDK",
"Description": "Official AccelByte SDK for Unreal Engine 4",
"Category": "Online Platform",
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

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.

## [25.0.0](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/25.0.0%0D24.11.0) (2024-03-08)


### ⚠ BREAKING CHANGES

* **CommerceBalance:** balance type on wallet is using int64 now

### Features

* add enablesecret field to response model in sdk ([93d1c6b](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/93d1c6b3360ed7ad4e9b898e346a1cae453abc67))
* **backfill:** add new notification for backfill ticket expired ([b501d1b](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/b501d1bc6393ca2cac99a512b21bfefdd78e53b7))
* **challenge:** add client and server API methods for the challenge service ([83bb01e](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/83bb01e677ee5ab514f49eda45526b3d27ed0e19))


### Bug Fixes

* **CommerceBalance:** fix wallet balance using int64 type ([58059ff](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/58059ffc4d6104e0002b312580e98d9c4c69c358))
* **ecommerce:** add missing field DisplayOrder in FAccelByteModelsSectionInfo ([9915723](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/99157237657a94df8f8d5a9ade6062fc073c64bb))

## [24.11.0](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/24.11.0%0D24.10.0) (2024-02-21)


Expand Down
157 changes: 157 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteChallengeApi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
// Copyright (c) 2024 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.

#include "Api/AccelByteChallengeApi.h"
#include "Core/AccelByteReport.h"

namespace AccelByte
{
namespace Api
{

Challenge::Challenge(Credentials const& InCredentialsRef
, Settings const& InSettingsRef
, FHttpRetryScheduler& InHttpRef)
: FApiBase(InCredentialsRef
, InSettingsRef
, InHttpRef)
{}

Challenge::~Challenge()
{
}

void Challenge::GetChallenges(const THandler<FAccelByteModelsGetChallengesResponse>& OnSuccess
, const FErrorHandler& OnError
, const EAccelByteModelsChallengeSortBy& SortBy
, const EAccelByteModelsChallengeStatus& Status
, uint64 Offset
, uint64 Limit)
{
FReport::Log(FString(__FUNCTION__));

const TMap<FString, FString> QueryParams = {
{ TEXT("sortBy"), FAccelByteUtilities::ConvertChallengeSortByToString(SortBy) },
{ TEXT("status"), (Status != EAccelByteModelsChallengeStatus::NONE) ? FAccelByteUtilities::GetUEnumValueAsString(Status) : FString() },
{ TEXT("offset"), FString::FromInt(Offset) },
{ TEXT("limit"), FString::FromInt(Limit) },
};

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/challenges")
, *SettingsRef.ChallengeServerUrl
, *CredentialsRef.GetNamespace());

HttpClient.ApiRequest(TEXT("GET"), Url, QueryParams, FString(), OnSuccess, OnError);
}

void Challenge::GetScheduledChallengeGoals(const FString& ChallengeCode
, const THandler<FAccelByteModelsGetScheduledChallengeGoalsResponse>& OnSuccess
, const FErrorHandler& OnError
, const TArray<FString>& Tags
, uint64 Offset
, uint64 Limit)
{
FReport::Log(FString(__FUNCTION__));

FString TagsString{};
for (int64 Index = 0; Index < Tags.Num(); Index++)
{
TagsString.Append(Tags[Index]);
if (Index != Tags.Num() - 1)
{
TagsString.AppendChar(',');
}
}

const TMap<FString, FString> QueryParams{
{ TEXT("tags"), FGenericPlatformHttp::UrlEncode(TagsString) },
{ TEXT("offset"), FString::FromInt(Offset) },
{ TEXT("limit"), FString::FromInt(Limit) },
};

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/challenges/%s/goals")
, *SettingsRef.ChallengeServerUrl
, *CredentialsRef.GetNamespace()
, *ChallengeCode);

HttpClient.ApiRequest(TEXT("GET"), Url, QueryParams, FString(), OnSuccess, OnError);
}

void Challenge::GetChallengeProgress(const FString& ChallengeCode
, const FString& GoalCode
, const THandler<FAccelByteModelsChallengeProgressResponse>& OnSuccess
, const FErrorHandler& OnError
, uint64 Offset
, uint64 Limit)
{
FReport::Log(FString(__FUNCTION__));

const TMap<FString, FString> QueryParams{
{ TEXT("goalCode"), GoalCode },
{ TEXT("offset"), FString::FromInt(Offset) },
{ TEXT("limit"), FString::FromInt(Limit) },
};

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/users/me/progress/%s")
, *SettingsRef.ChallengeServerUrl
, *CredentialsRef.GetNamespace()
, *ChallengeCode);

HttpClient.ApiRequest(TEXT("GET"), Url, QueryParams, FString(), OnSuccess, OnError);
}

void Challenge::GetRewards(const THandler<FAccelByteModelsChallengeGetRewardStatusResponse>& OnSuccess
, const FErrorHandler& OnError
, const EAccelByteModelsChallengeRewardStatus& Status
, const EAccelByteModelsChallengeSortBy& SortBy
, uint64 Offset
, uint64 Limit)
{
FReport::Log(FString(__FUNCTION__));

TMap<FString, FString> QueryParams{
{ TEXT("sortBy"), FAccelByteUtilities::GetUEnumValueAsString(SortBy) },
{ TEXT("offset"), FString::FromInt(Offset) },
{ TEXT("limit"), FString::FromInt(Limit) },
};

if (Status != EAccelByteModelsChallengeRewardStatus::NONE)
{
QueryParams.Add(TEXT("status"), FAccelByteUtilities::GetUEnumValueAsString(Status));
}

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/users/me/rewards")
, *SettingsRef.ChallengeServerUrl
, *CredentialsRef.GetNamespace());

HttpClient.ApiRequest(TEXT("GET"), Url, QueryParams, FString(), OnSuccess, OnError);
}

void Challenge::ClaimReward(const FAccelByteModelsChallengeRewardClaimRequest& Request
, const THandler<TArray<FAccelByteModelsChallengeReward>>& OnSuccess
, const FErrorHandler& OnError)
{
FReport::Log(FString(__FUNCTION__));

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/users/me/rewards/claim")
, *SettingsRef.ChallengeServerUrl
, *CredentialsRef.GetNamespace());

HttpClient.ApiRequest(TEXT("POST"), Url, {}, Request, OnSuccess, OnError);
}

void Challenge::EvaluateChallengeProgress(const FVoidHandler& OnSuccess, const FErrorHandler& OnError)
{
FReport::Log(FString(__FUNCTION__));

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/users/me/progress/evaluate")
, *SettingsRef.ChallengeServerUrl
, *CredentialsRef.GetNamespace());

HttpClient.ApiRequest(TEXT("POST"), Url, {}, FString(), OnSuccess, OnError);
}


} // Namespace Api
} // Namespace AccelByte
73 changes: 73 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteLoginQueueApi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Copyright (c) 2024 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.


#include "Api/AccelByteLoginQueueApi.h"
#include "AccelByteUe4SdkModule.h"
#include "Core/AccelByteRegistry.h"
#include "Core/AccelByteReport.h"
#include "Core/AccelByteHttpListenerExtension.h"
#include "Core/AccelByteHttpRetryScheduler.h"
#include "Core/AccelByteEnvironment.h"
#include "Core/AccelByteOauth2Api.h"
#include "Core/AccelByteUtilities.h"

DECLARE_LOG_CATEGORY_EXTERN(LogAccelByteLoginQueue, Log, All);
DEFINE_LOG_CATEGORY(LogAccelByteLoginQueue);

using AccelByte::Api::Oauth2;

namespace AccelByte
{
namespace Api
{

LoginQueue::LoginQueue(Credentials& InCredentialsRef
, Settings& InSettingsRef
, FHttpRetryScheduler& InHttpRef)
: FApiBase(InCredentialsRef, InSettingsRef, InHttpRef)
, UserCredentialsRef{InCredentialsRef}
{
}

LoginQueue::~LoginQueue()
{}

void LoginQueue::RefreshTicket(const FString& Ticket, const THandler<FAccelByteModelsLoginQueueTicketInfo>& OnSuccess, const FErrorHandler& OnError, const FString& Namespace)
{
FReport::Log(FString(__FUNCTION__));

const FString Url = FString::Printf(TEXT("%s/v1/namespaces/%s/ticket")
, *SettingsRef.LoginQueueServerUrl
, Namespace.IsEmpty() ? *SettingsRef.Namespace : *Namespace);

TMap<FString, FString> Headers{};
Headers.Add(TEXT("Authorization"), FString::Printf(TEXT("Bearer %s"), *Ticket));

HttpClient.Request(TEXT("GET"), Url, {}, FString(), Headers, THandler<FAccelByteModelsLoginQueueTicketInfo>::CreateLambda([Ticket, OnSuccess](const FAccelByteModelsLoginQueueTicketInfo& Response)
{
FAccelByteModelsLoginQueueTicketInfo NewTicketInfo = Response;
NewTicketInfo.Ticket = Ticket;
OnSuccess.ExecuteIfBound(NewTicketInfo);
}), OnError);
}

void LoginQueue::CancelTicket(const FString& Ticket, const FVoidHandler& OnSuccess, const FErrorHandler& OnError, const FString& Namespace)
{
FReport::Log(FString(__FUNCTION__));

const FString Url = FString::Printf(TEXT("%s/v1/namespaces/%s/ticket")
, *SettingsRef.LoginQueueServerUrl
, Namespace.IsEmpty() ? *SettingsRef.Namespace : *Namespace);

TMap<FString, FString> Headers{};
Headers.Add(TEXT("Authorization"), FString::Printf(TEXT("Bearer %s"), *Ticket));
Headers.Add(TEXT("Accept"), TEXT("application/json"));
Headers.Add(TEXT("Content-Type"), TEXT(""));

HttpClient.Request(TEXT("DELETE"), Url, {}, FString(), Headers, OnSuccess, OnError);
}

} // Namespace Api
} // Namespace AccelByte
Loading

0 comments on commit 8fe2040

Please sign in to comment.