Skip to content

Commit

Permalink
Updated from pipeline, Version : 24.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Jan 9, 2024
1 parent a563012 commit 2811e25
Show file tree
Hide file tree
Showing 40 changed files with 1,336 additions and 171 deletions.
13 changes: 7 additions & 6 deletions .variables
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export DO_UPDATE=true
export LEVEL=CRITICAL
export REPO_NAME=justice-unreal-sdk-plugin
export WORKDIR=/tmp/pipelines/5844330440/1124221706/
export COMMIT_HASH=c569c8da144844935d9eeb6a97decbd01fa7daf0
export GIT_HASH=c569c8da144844935d9eeb6a97decbd01fa7daf0
export VERSION=24.7.1
export REVISION_ID=24.7.1
export WORKDIR=/tmp/pipelines/5888353360/1131404518/
export COMMIT_HASH=77434b9b307a224a36541d2ee16d1f7907c977dd
export GIT_HASH=77434b9b307a224a36541d2ee16d1f7907c977dd
export VERSION=24.8.0
export REVISION_ID=24.8.0
export [email protected]
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI0LjcuMSAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2lucwo='
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI0LjguMCAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2luc2Fnc1ZlcnNpb246IjMuNjQuMCIKCg=='
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": 53,
"VersionName": "24.7.1",
"Version": 54,
"VersionName": "24.8.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.

## [24.8.0](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/24.8.0%0D24.7.1) (2024-01-09)


### Features

* add game session recent player endpoint ([1f3adea](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/1f3adea47845d524c132f7ed571a4931356daf44))
* expose cloud save game binary records endpoints in server SDK ([1b50200](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/1b5020058034e4f82642e0009288fcdfba32f23b))
* **gameTelemetry:** add feature to enable/disable game telemetry cache from Engine.ini setup ([4cdd848](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/4cdd84879e73dbfe35352c884deaedc07e4c99f6))
* **IAM:** refresh native platform token ([c8d3ac1](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/c8d3ac1ea43dd4f8d92e81f50192f5fca0f62598))
* new lobby notification delegate for UE OSS ([d2ae140](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/d2ae140975153167b224ac446ac1319137cf6d94))
* **oauth:** add namespaceRoles on Oauth2Token model ([5c748f3](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/5c748f3913021966cafd3f2a516b341d0fb582af))
* **ServerTime:** return back caculated ServerTime and sync ServerTime with the service every one hour. ([f6881af](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/f6881af70e7aade36ef938f4f7273653b7778e9a))


### Bug Fixes

* GetPublicUserProfileInfo headers attached as queryParam ([c0c7622](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/c0c7622dff79b587c28c78fdaa7bad2e92d39871))
* **presenceBroadcast:** mark StartHeartbeat and StopHeartbeat as deprecated since it not supposed to be used outside of the class ([fbc0ab7](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/fbc0ab77a931a6142718ac8ab4805c0a70a81bc6))

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


Expand Down
115 changes: 115 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteBinaryCloudSaveApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,43 @@ void BinaryCloudSave::SaveUserBinaryRecord(FString const& Key
HttpClient.ApiRequest(TEXT("POST"), Url, {}, Content, OnSuccess, OnError);
}

void BinaryCloudSave::SaveUserBinaryRecord(FString const& Key
, EAccelByteFileType FileType
, bool bIsPublic
, FVoidHandler const& OnSuccess
, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

if (Key.IsEmpty())
{
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), TEXT("Key cannot be empty!"));
return;
}

if (FileType == EAccelByteFileType::NONE)
{
const FString Message = TEXT("Invalid request. The 'FileType' field must be set to "
"(e.g., EAccelByteFileType::JPG, EAccelByteFileType::PNG, etc.). "
"Please set a valid 'FileType' value to fulfill the request.");
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), Message);
return;
}

const FString Url = FString::Printf(TEXT("%s/v1/namespaces/%s/users/%s/binaries")
, *SettingsRef.CloudSaveServerUrl
, *CredentialsRef.GetNamespace()
, *CredentialsRef.GetUserId());

FJsonObject JsonObj{};
JsonObj.SetStringField("key", Key);
JsonObj.SetBoolField("is_public", bIsPublic);
JsonObj.SetStringField("file_type", FAccelByteUtilities::GetUEnumValueAsString(FileType).ToLower());
auto Content = MakeShared<FJsonObject>(JsonObj);

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

void BinaryCloudSave::GetCurrentUserBinaryRecord(FString const& Key
, THandler<FAccelByteModelsUserBinaryRecord> const& OnSuccess
, FErrorHandler const& OnError)
Expand Down Expand Up @@ -297,6 +334,49 @@ void BinaryCloudSave::UpdateUserBinaryRecordFile(FString const& Key
HttpClient.ApiRequest(TEXT("PUT"), Url, {}, Content, OnSuccess, OnError);
}

void BinaryCloudSave::UpdateUserBinaryRecordFile(FString const& Key
, EAccelByteFileType ContentType
, FString const& FileLocation
, THandler<FAccelByteModelsUserBinaryRecord> const& OnSuccess
, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

if (Key.IsEmpty())
{
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), TEXT("Key cannot be empty!"));
return;
}

if (FileLocation.IsEmpty())
{
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), TEXT("File Location cannot be empty!"));
return;
}

if (ContentType == EAccelByteFileType::NONE)
{
const FString Message = TEXT("Invalid request. The 'ContentType' field must be set to "
"(e.g., EAccelByteFileType::JPG, EAccelByteFileType::PNG, etc.). "
"Please set a valid 'ContentType' value to fulfill the request.");
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), Message);
return;
}

const FString Url = FString::Printf(TEXT("%s/v1/namespaces/%s/users/%s/binaries/%s")
, *SettingsRef.CloudSaveServerUrl
, *CredentialsRef.GetNamespace()
, *CredentialsRef.GetUserId()
, *Key);

FJsonObject JsonObj{};
JsonObj.SetStringField("content_type", FAccelByteUtilities::GetContentType(ContentType));
JsonObj.SetStringField("file_location", FileLocation);
auto Content = MakeShared<FJsonObject>(JsonObj);

HttpClient.ApiRequest(TEXT("PUT"), Url, {}, Content, OnSuccess, OnError);
}

void BinaryCloudSave::UpdateUserBinaryRecordMetadata(FString const& Key
, bool bIsPublic
, THandler<FAccelByteModelsUserBinaryRecord> const& OnSuccess
Expand Down Expand Up @@ -375,6 +455,41 @@ void BinaryCloudSave::RequestUserBinaryRecordPresignedUrl(FString const& Key
HttpClient.ApiRequest(TEXT("POST"), Url, {}, Content, OnSuccess, OnError);
}

void BinaryCloudSave::RequestUserBinaryRecordPresignedUrl(FString const& Key
, EAccelByteFileType FileType
, THandler<FAccelByteModelsBinaryInfo> const& OnSuccess
, FErrorHandler const& OnError)
{
FReport::Log(FString(__FUNCTION__));

if (Key.IsEmpty())
{
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), TEXT("Key cannot be empty!"));
return;
}

if (FileType == EAccelByteFileType::NONE)
{
const FString Message = TEXT("Invalid request. The 'FileType' field must be set to "
"(e.g., EAccelByteFileType::JPG, EAccelByteFileType::PNG, etc.). "
"Please set a valid 'FileType' value to fulfill the request.");
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::InvalidRequest), Message);
return;
}

const FString Url = FString::Printf(TEXT("%s/v1/namespaces/%s/users/%s/binaries/%s/presigned")
, *SettingsRef.CloudSaveServerUrl
, *CredentialsRef.GetNamespace()
, *CredentialsRef.GetUserId()
, *Key);

FJsonObject JsonObj{};
JsonObj.SetStringField("file_type", FAccelByteUtilities::GetUEnumValueAsString(FileType).ToLower());
auto Content = MakeShared<FJsonObject>(JsonObj);

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

void BinaryCloudSave::GetGameBinaryRecord(FString const& Key
, THandler<FAccelByteModelsGameBinaryRecord> const& OnSuccess
, FErrorHandler const& OnError)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ GameTelemetry::GameTelemetry(Credentials& InCredentialsRef
{
GameTelemetryLoginSuccess = CredentialsRef.OnLoginSuccess().AddRaw(this, &GameTelemetry::OnLoginSuccess);
GameTelemetryLogoutSuccess = CredentialsRef.OnLogoutSuccess().AddRaw(this, &GameTelemetry::OnLogoutSuccess);
bCacheEvent = SettingsRef.bEnableGameTelemetryCache;
}

GameTelemetry::~GameTelemetry()
Expand Down
4 changes: 2 additions & 2 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteLobbyApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ void Lobby::UnbindEvent()
{
FReport::Log(FString(__FUNCTION__));

MessageNotif.Unbind();
MessageNotifBroadcaster.Clear();
PartyDataUpdateNotif.Unbind();

UnbindFriendNotifEvents();
Expand Down Expand Up @@ -2430,7 +2430,7 @@ void Lobby::HandleMessageNotif(const FString& ReceivedMessageType
break;
}

MessageNotif.ExecuteIfBound(NotificationMessage);
MessageNotifBroadcaster.Broadcast(NotificationMessage);
break;
}
// Matchmaking
Expand Down
11 changes: 2 additions & 9 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteMiscellaneousApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Miscellaneous::Miscellaneous(Credentials const& InCredentialsRef
, Settings const& InSettingsRef
, FHttpRetryScheduler& InHttpRef)
: FApiBase(InCredentialsRef, InSettingsRef, InHttpRef)
, TimeManager(InHttpRef)
{}

Miscellaneous::~Miscellaneous()
Expand All @@ -26,15 +27,7 @@ void Miscellaneous::GetServerCurrentTime(const THandler<FTime>& OnSuccess, const
{
FReport::Log(FString(__FUNCTION__));

const FString Url = FString::Printf(TEXT("%s/v1/public/misc/time"), *SettingsRef.BasicServerUrl);

const FString Accept = TEXT("application/json");

const TMap<FString, FString> Headers = {
{TEXT("Accept"), Accept}
};

HttpClient.Request(TEXT("GET"), Url, TEXT(""), Headers, OnSuccess, OnError);
TimeManager.GetServerTime(OnSuccess, OnError);
}

} // Namespace Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PresenceBroadcastEvent::PresenceBroadcastEvent(Credentials& InCredentialsRef
: FApiBase(InCredentialsRef, InSettingsRef, InHttpRef)
, CredentialsRef{ InCredentialsRef }
{
SetHeartbeatInterval(FTimespan::FromSeconds(SettingsRef.PresenceBroadcastEventHeartbeatInterval));
PresenceBroadcastLoginSuccess = CredentialsRef.OnLoginSuccess().AddRaw(this, &PresenceBroadcastEvent::OnLoginSuccess);
}

Expand Down Expand Up @@ -99,6 +100,8 @@ void PresenceBroadcastEvent::Startup()

void PresenceBroadcastEvent::StartHeartbeat()
{
FReport::LogDeprecated(FString(__FUNCTION__),
TEXT("This funtion is DEPRECATED, will be removed soon"));
if (PresenceBroadcastEventHeartbeatTickDelegateHandle.IsValid())
{
return;
Expand All @@ -109,6 +112,8 @@ void PresenceBroadcastEvent::StartHeartbeat()

void PresenceBroadcastEvent::StopHeartbeat()
{
FReport::LogDeprecated(FString(__FUNCTION__),
TEXT("This funtion is DEPRECATED, will be removed soon"));
if (PresenceBroadcastEventHeartbeatTickDelegateHandle.IsValid())
{
FTickerAlias::GetCoreTicker().RemoveTicker(PresenceBroadcastEventHeartbeatTickDelegateHandle);
Expand Down Expand Up @@ -166,7 +171,6 @@ void PresenceBroadcastEvent::OnLoginSuccess(FOauth2Token const& Response)

if (SettingsRef.bEnablePresenceBroadcastEventHeartbeat)
{
SetHeartbeatInterval(FTimespan::FromSeconds(SettingsRef.PresenceBroadcastEventHeartbeatInterval));
StartHeartbeat();
}
}
Expand Down
20 changes: 20 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteSessionApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,5 +611,25 @@ void Session::UpdateMemberStorage(FString const& SessionID

HttpClient.ApiRequest(TEXT("PATCH"), Url, {}, Data.JsonObject.ToSharedRef(), OnSuccess, OnError);
}

void Session::GetRecentPlayers(THandler<FAccelByteModelsV2SessionRecentPlayers> const& OnSuccess,
FErrorHandler const& OnError, const int32 Limit /* = 20 */)
{
FReport::Log(FString(__FUNCTION__));

if(Limit > 200)
{
UE_LOG(LogAccelByte, Warning, TEXT("Requesting recent player limit with %d will only return 200 items"), Limit);
}

const FString Url = FString::Printf(TEXT("%s/v1/public/namespaces/%s/recent-player")
, *SettingsRef.SessionServerUrl
, *CredentialsRef.GetNamespace());

TMap<FString, FString> QueryParam;
QueryParam.Emplace(TEXT("limit"), FString::FromInt(Limit));

HttpClient.ApiRequest(TEXT("GET"), Url, QueryParam, FString(), OnSuccess, OnError);
}
}
}
22 changes: 22 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteUserApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,28 @@ void User::LoginWithRefreshToken(const FString& RefreshToken
, SettingsRef.IamServerUrl);
}

void User::RefreshPlatformToken(const EAccelBytePlatformType& Platform
, const FString& NativePlatformToken
, const THandler<FPlatformTokenRefreshResponse>& OnSuccess
, const FOAuthErrorHandler& OnError)
{
FReport::Log(FString(__FUNCTION__));

if (NativePlatformToken.IsEmpty())
{
OnError.ExecuteIfBound(static_cast<int32>(ErrorCodes::StatusBadRequest), TEXT("Please provide a valid NativePlatformToken"), FErrorOAuthInfo{});
return;
}

Oauth2::RefreshPlatformToken(UserCredentialsRef.GetOAuthClientId()
, UserCredentialsRef.GetOAuthClientSecret()
, FAccelByteUtilities::GetPlatformString(Platform)
, NativePlatformToken
, OnSuccess
, OnError
, SettingsRef.IamServerUrl);
}

bool IsTokenExpired(FRefreshInfo RefreshInfo)
{
return RefreshInfo.Expiration <= FDateTime::UtcNow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void UserProfile::GetPublicUserProfileInfo(FString UserID
{TEXT("Accept"), TEXT("application/json")}
};

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

void UserProfile::BatchGetPublicUserProfileInfos(const FString& UserIds
Expand Down
21 changes: 21 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Core/AccelByteOauth2Api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,27 @@ void Oauth2::GetTokenWithRefreshToken(const FString& ClientId
FRegistry::HttpRetryScheduler.ProcessRequest(Request, CreateHttpResultHandler(OnSuccess, OnError), FPlatformTime::Seconds());
}

void Oauth2::RefreshPlatformToken(const FString& ClientID
, const FString& ClientSecret
, const FString& PlatformID
, const FString& PlatformToken
, const THandler<FPlatformTokenRefreshResponse>& OnSuccess
, const FOAuthErrorHandler& OnError
, const FString& IamUrl)
{
FReport::Log(FString(__FUNCTION__));

const FString Url = FString::Printf(TEXT("%s/v3/platforms/%s/token/verify")
, IamUrl.IsEmpty() ? *FRegistry::Settings.IamServerUrl : *IamUrl,
*PlatformID);

FString Content = FString::Printf(TEXT("platform_token=%s"), *PlatformToken);
FHttpRequestPtr Request = ConstructTokenRequest(Url, ClientID, ClientSecret);
Request->SetContentAsString(Content);

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

void Oauth2::RevokeToken(const FString& AccessToken
, const FVoidHandler& OnSuccess
, const FErrorHandler& OnError
Expand Down
Loading

0 comments on commit 2811e25

Please sign in to comment.