Skip to content

Commit

Permalink
Updated from pipeline, Version : 7.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Oct 25, 2021
1 parent e8dc4b0 commit 3132f44
Show file tree
Hide file tree
Showing 15 changed files with 460 additions and 193 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/1677795625/387987681/
export COMMIT_HASH=174eaaf43fd1951aa4dbe2adf704d076281e5284
export GIT_HASH=174eaaf43fd1951aa4dbe2adf704d076281e5284
export VERSION=7.0.0
export REVISION_ID=7.0.0
export WORKDIR=/tmp/pipelines/1710226468/394479550/
export COMMIT_HASH=75dc6675396144f51975be0a9d315ff1ace29821
export GIT_HASH=75dc6675396144f51975be0a9d315ff1ace29821
export VERSION=7.0.1
export REVISION_ID=7.0.1
export [email protected]
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDcuMC4wIC0gY29tbWl0ZWQgYW5kIHRhZ2dlZCBieSBKZW5raW5zCg=='
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDcuMC4xIC0gY29tbWl0ZWQgYW5kIHRhZ2dlZCBieSBKZW5raW5zCg=='
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.1](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/7.0.1%0D7.0.0) (2021-10-25)


### Bug Fixes

* **lobby:** return invalidRequest when UserIds empty on bulk user presence ([a09c35f](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/a09c35f95651086f610dc7aec58c28534ae17578))


### Refactors

* **apiclient:** default ApiClient will use Credentials and HttpRetryScheduler instances from FRegistry ([00f73cb](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/00f73cb2ebb28c51d50b01a47e237bdb1f49cc53))

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


Expand Down
12 changes: 10 additions & 2 deletions Content/CompatibilityMap.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"iam": {
"minVersion": "4.5.0",
"maxVersion": "4.5.0"
"minVersion": "4.5.1",
"maxVersion": "4.5.1"
},
"agreement": {
"minVersion": "1.13.2",
Expand Down Expand Up @@ -43,8 +43,16 @@
"minVersion": "2.8.0",
"maxVersion": "2.8.0"
},
"qosm": {
"minVersion": "",
"maxVersion": ""
},
"dsmcontroller": {
"minVersion": "2.6.0",
"maxVersion": "2.6.0"
},
"game-telemetry": {
"minVersion": "1.1.10",
"maxVersion": "1.1.10"
}
}
33 changes: 32 additions & 1 deletion Source/AccelByteUe4Sdk/Private/Api/AccelByteLobbyApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ namespace Api
const FString SetSessionAttribute = TEXT("setSessionAttributeRequest");
const FString GetSessionAttribute = TEXT("getSessionAttributeRequest");
const FString GetAllSessionAttribute = TEXT("getAllSessionAttributeRequest");

// Refresh Token
const FString RefreshToken = TEXT("refreshTokenRequest");
}

namespace LobbyResponse
Expand Down Expand Up @@ -169,6 +172,9 @@ namespace Api
const FString SessionAttributeSet = TEXT("setSessionAttributeResponse");
const FString SessionAttributeGet = TEXT("getSessionAttributeResponse");
const FString SessionAttributeGetAll = TEXT("getAllSessionAttributeResponse");

// Refresh Token
const FString RefreshToken = TEXT("refreshTokenResponse");
}

namespace Prefix
Expand All @@ -181,6 +187,7 @@ namespace Api
const FString Block = TEXT("blocks");
const FString Signaling = TEXT("signaling");
const FString Attribute = TEXT("attribute");
const FString Token = TEXT("token");
}

void Lobby::Connect()
Expand Down Expand Up @@ -226,6 +233,8 @@ void Lobby::Disconnect()
FReport::Log(FString(__FUNCTION__));

ChannelSlug = "";
Credentials.OnTokenRefreshed().Remove(RefreshTokenDelegate.GetHandle());

if (LobbyTickDelegateHandle.IsValid())
{
FTicker::GetCoreTicker().RemoveTicker(LobbyTickDelegateHandle);
Expand All @@ -246,6 +255,7 @@ void Lobby::Disconnect()
if (GEngine) UE_LOG(LogAccelByteLobby, Display, TEXT("Disconnected"));
}


bool Lobby::IsConnected() const
{
FReport::Log(FString(__FUNCTION__));
Expand Down Expand Up @@ -675,6 +685,12 @@ void Lobby::BulkGetUserPresence(const TArray<FString>& UserIds, const THandler<F
{
FReport::Log(FString(__FUNCTION__));

if (UserIds.Num() <= 0)
{
OnError.ExecuteIfBound((int32)ErrorCodes::InvalidRequest, TEXT("UserIds cannot be empty!"));
return;
}

FString Query = TEXT("?userIds=");
for (int i = 0; i < UserIds.Num(); i++)
{
Expand Down Expand Up @@ -896,6 +912,18 @@ FString Lobby::GetAllSessionAttribute()
FString::Printf(TEXT("namespace: %s"), *Credentials.GetNamespace()));
}

//-------------------------------------------------------------------------------------------------
// Refresh Token
//-------------------------------------------------------------------------------------------------

FString Lobby::RefreshToken(const FString& AccessToken)
{
FReport::Log(FString(__FUNCTION__));

return SendRawRequest(LobbyRequest::RefreshToken, Prefix::Token,
FString::Printf(TEXT("token: %s"), *AccessToken));
}

void Lobby::UnbindEvent()
{
FReport::Log(FString(__FUNCTION__));
Expand Down Expand Up @@ -1078,6 +1106,8 @@ void Lobby::OnConnected()
{
WsEvents |= EWebSocketEvent::Connected;
UE_LOG(LogAccelByteLobby, Display, TEXT("Connected"));

Credentials.OnTokenRefreshed().Add(RefreshTokenDelegate);

ConnectSuccess.ExecuteIfBound();
}
Expand Down Expand Up @@ -1582,6 +1612,7 @@ if (lobbyResponseType.Equals(MessageType)) \
HANDLE_LOBBY_MESSAGE_RESPONSE(LobbyResponse::SessionAttributeSet, FAccelByteModelsSetSessionAttributesResponse, SetSessionAttributeResponse, OnSetSessionAttributeError);
HANDLE_LOBBY_MESSAGE_RESPONSE(LobbyResponse::SessionAttributeGet, FAccelByteModelsGetSessionAttributesResponse, GetSessionAttributeResponse, OnGetSessionAttributeError);
HANDLE_LOBBY_MESSAGE_RESPONSE(LobbyResponse::SessionAttributeGetAll, FAccelByteModelsGetAllSessionAttributesResponse, GetAllSessionAttributeResponse, OnGetAllSessionAttributeError);
HANDLE_LOBBY_MESSAGE_RESPONSE(LobbyResponse::RefreshToken, FAccelByteModelsRefreshTokenResponse, RefreshTokenResponse, OnRefreshTokenError);

#undef HANDLE_LOBBY_MESSAGE_RESPONSE

Expand Down Expand Up @@ -1716,7 +1747,7 @@ void Lobby::ClearLobbyErrorMessages()
}

Lobby::Lobby(
const AccelByte::Credentials& Credentials,
AccelByte::Credentials& Credentials,
const AccelByte::Settings& Settings,
FHttpRetryScheduler& HttpRef,
float PingDelay,
Expand Down
8 changes: 8 additions & 0 deletions Source/AccelByteUe4Sdk/Private/Core/AccelByteCredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ void Credentials::PollRefreshToken(double CurrentTime)
RefreshTokenAdditionalActions.Broadcast();
RefreshTokenAdditionalActions.Clear();
}

TokenRefreshedEvent.Broadcast();
}),
FErrorHandler::CreateLambda([this, CurrentTime](int32 ErrorCode, const FString& ErrorMessage)
{
Expand All @@ -152,6 +154,7 @@ void Credentials::PollRefreshToken(double CurrentTime)
RefreshTokenAdditionalActions.Broadcast();
RefreshTokenAdditionalActions.Clear();
}

UserSessionState = ESessionState::Expired;
}));

Expand Down Expand Up @@ -184,6 +187,11 @@ void AccelByte::Credentials::SetBearerAuthRejectedHandler(FHttpRetryScheduler& H
}));
}

Credentials::FTokenRefreshedEvent& Credentials::OnTokenRefreshed()
{
return TokenRefreshedEvent;
}

void Credentials::BearerAuthRejectedRefreshToken(FHttpRetryScheduler& HttpRef)
{
if (GetSessionState() == ESessionState::Refreshing)
Expand Down
Loading

0 comments on commit 3132f44

Please sign in to comment.