Skip to content

Commit

Permalink
Updated from pipeline, Version : 26.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Aug 21, 2024
1 parent cd803a5 commit 74d1c04
Show file tree
Hide file tree
Showing 25 changed files with 199 additions and 107 deletions.
13 changes: 6 additions & 7 deletions .variables
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
export DO_UPDATE=true
export LEVEL=CRITICAL
export REPO_NAME=justice-unreal-sdk-plugin
export WORKDIR=/tmp/pipelines/7560048138/1409583466/
export COMMIT_HASH=b54b27248f84e97a2c65627e53236a8b7629026b
export GIT_HASH=b54b27248f84e97a2c65627e53236a8b7629026b
export VERSION=26.1.0
export REVISION_ID=26.1.0
export WORKDIR=/tmp/pipelines/7627503846/1420842363/
export COMMIT_HASH=a81081e5766309e4756cf501493ec919be8b655f
export GIT_HASH=a81081e5766309e4756cf501493ec919be8b655f
export VERSION=26.1.1
export REVISION_ID=26.1.1
export [email protected]
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI2LjEuMCAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2luc2Fnc1ZlcnNpb246IjMuNzYuMCIKCg=='
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI2LjEuMSAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2lucwo='
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": 74,
"VersionName": "26.1.0",
"Version": 75,
"VersionName": "26.1.1",
"FriendlyName": "AccelByte Unreal Engine SDK",
"Description": "Official AccelByte SDK for Unreal Engine 4",
"Category": "Online Platform",
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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.

### [26.1.1](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/26.1.1%0D26.1.0) (2024-08-21)


### Features

* Add TicketID in matchmaking v2 canceled notification model ([f76cb17](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/f76cb17b85337a8db5dfd7238b3a5bb139a51544))


### Bug Fixes

* access violation when accessing MessagingSystem that has been destroyed ([43c8c01](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/43c8c010319ec84b7df4ab6cf2b5e567808f3ca2))
* lobby notification buffer SortBuffer method consider SequenceId instead of SentAt ([8b00b90](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/8b00b90d42f9a6c394969d44bf09225168b06106))

## [26.1.0](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/26.1.0%0D26.0.2) (2024-08-12)


Expand Down
41 changes: 29 additions & 12 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteChatApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,11 @@ namespace IncomingMessage
, TSharedPtr<IWebSocket> WebSocket)
: FApiBase(InCredentialsRef, InSettingsRef, InHttpRef)
, ChatCredentialsRef{InCredentialsRef.AsShared()}
, MessagingSystem{InMessagingSystemRef}
#if ENGINE_MAJOR_VERSION < 5
, MessagingSystemWPtr{InMessagingSystemRef.AsShared()}
#else
, MessagingSystemWPtr{InMessagingSystemRef.AsWeak()}
#endif
, NetworkConditioner{InNetworkConditionerRef}
, PingDelay{PingDelay}
, InitialBackoffDelay{InitialBackoffDelay}
Expand Down Expand Up @@ -489,7 +493,13 @@ namespace IncomingMessage
void Chat::Disconnect()
{
FReport::Log(FString(__FUNCTION__));
MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);

auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);
}

if (WebSocket.IsValid())
{
WebSocket->Disconnect();
Expand All @@ -516,15 +526,18 @@ namespace IncomingMessage
void Chat::OnConnected()
{
UE_LOG(LogAccelByteChat, Log, TEXT("Connected"));

AuthTokenSetDelegateHandle = MessagingSystem.SubscribeToTopic(EAccelByteMessagingTopic::AuthTokenSet
, FOnMessagingSystemReceivedMessage::CreateLambda(
[this](FString const& Message)
{
FOauth2Token Token;
FJsonObjectConverter::JsonObjectStringToUStruct(Message, &Token);
RefreshToken(Token.Access_token, RefreshTokenResponse);
}));
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
AuthTokenSetDelegateHandle = MessagingSystemPtr->SubscribeToTopic(EAccelByteMessagingTopic::AuthTokenSet
, FOnMessagingSystemReceivedMessage::CreateLambda(
[this](FString const& Message)
{
FOauth2Token Token;
FJsonObjectConverter::JsonObjectStringToUStruct(Message, &Token);
RefreshToken(Token.Access_token, RefreshTokenResponse);
}));
}

ConnectSuccess.ExecuteIfBound();
}
Expand Down Expand Up @@ -553,7 +566,11 @@ namespace IncomingMessage
WebSocket->Reconnect();
}

MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);
}

bBanNotifReceived = false;
BanType = EBanType::EMPTY;
Expand Down
70 changes: 48 additions & 22 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteLobbyApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,14 @@ void Lobby::Disconnect(bool ForceCleanup)
FReport::Log(FString(__FUNCTION__));

ChannelSlug = "";

MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);

MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::NotificationSenderLobby, NotificationSenderListenerDelegateHandle);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::NotificationSenderLobby, NotificationSenderListenerDelegateHandle);
}

NotificationSenderListenerDelegate.Unbind();

if(WebSocket.IsValid())
Expand Down Expand Up @@ -2150,20 +2154,26 @@ void Lobby::OnConnected()
{
UE_LOG(LogAccelByteLobby, Log, TEXT("Connected"));

AuthTokenSetDelegateHandle = MessagingSystem.SubscribeToTopic(EAccelByteMessagingTopic::AuthTokenSet, FOnMessagingSystemReceivedMessage::CreateLambda(
[this](FString const& Message)
{
FOauth2Token Token;
FJsonObjectConverter::JsonObjectStringToUStruct(Message, &Token);
RefreshToken(Token.Access_token);
}));

NotificationSenderListenerDelegate = FOnMessagingSystemReceivedMessage::CreateRaw(this, &Lobby::OnNotificationSenderMessageReceived);
NotificationSenderListenerDelegateHandle = MessagingSystem.SubscribeToTopic(EAccelByteMessagingTopic::NotificationSenderLobby, NotificationSenderListenerDelegate);

ConnectSuccess.ExecuteIfBound();

MessagingSystem.SendMessage(EAccelByteMessagingTopic::LobbyConnected);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
AuthTokenSetDelegateHandle = MessagingSystemPtr->SubscribeToTopic(EAccelByteMessagingTopic::AuthTokenSet
, FOnMessagingSystemReceivedMessage::CreateLambda(
[this](FString const& Message)
{
FOauth2Token Token;
FJsonObjectConverter::JsonObjectStringToUStruct(Message, &Token);
RefreshToken(Token.Access_token);
}));

NotificationSenderListenerDelegate = FOnMessagingSystemReceivedMessage::CreateRaw(this
, &Lobby::OnNotificationSenderMessageReceived);
NotificationSenderListenerDelegateHandle = MessagingSystemPtr->SubscribeToTopic(EAccelByteMessagingTopic::NotificationSenderLobby
, NotificationSenderListenerDelegate);
MessagingSystemPtr->SendMessage(EAccelByteMessagingTopic::LobbyConnected);
}
}

void Lobby::OnConnectionError(FString const& Error)
Expand All @@ -2185,9 +2195,12 @@ void Lobby::OnClosed(int32 StatusCode
Disconnect();
}

MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);

MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::NotificationSenderLobby, NotificationSenderListenerDelegateHandle);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::AuthTokenSet, AuthTokenSetDelegateHandle);
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::NotificationSenderLobby, NotificationSenderListenerDelegateHandle);
}
NotificationSenderListenerDelegate.Unbind();

BanNotifReceived = false;
Expand Down Expand Up @@ -3474,8 +3487,13 @@ void Lobby::SetTokenGenerator(TSharedPtr<IAccelByteTokenGenerator> const& TokenG

void Lobby::InitializeMessaging()
{
OnReceivedQosLatenciesUpdatedDelegate = FOnMessagingSystemReceivedMessage::CreateRaw(this, &Lobby::OnReceivedQosLatencies);
QosLatenciesUpdatedDelegateHandle = MessagingSystem.SubscribeToTopic(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, OnReceivedQosLatenciesUpdatedDelegate);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
OnReceivedQosLatenciesUpdatedDelegate = FOnMessagingSystemReceivedMessage::CreateRaw(this, &Lobby::OnReceivedQosLatencies);
QosLatenciesUpdatedDelegateHandle = MessagingSystemPtr->SubscribeToTopic(EAccelByteMessagingTopic::QosRegionLatenciesUpdated
, OnReceivedQosLatenciesUpdatedDelegate);
}
}

Lobby::Lobby(Credentials & InCredentialsRef
Expand All @@ -3490,7 +3508,11 @@ Lobby::Lobby(Credentials & InCredentialsRef
, TSharedPtr<IWebSocket> InWebSocket)
: FApiBase(InCredentialsRef, InSettingsRef, InHttpRef)
, LobbyCredentialsRef{InCredentialsRef.AsShared()}
, MessagingSystem{InMessagingSystemRef}
#if ENGINE_MAJOR_VERSION < 5
, MessagingSystemWPtr{InMessagingSystemRef.AsShared()}
#else
, MessagingSystemWPtr{InMessagingSystemRef.AsWeak()}
#endif
, NetworkConditioner{InNetworkConditionerRef}
, PingDelay{InPingDelay}
, InitialBackoffDelay{InInitialBackoffDelay}
Expand All @@ -3508,7 +3530,11 @@ Lobby::Lobby(Credentials & InCredentialsRef

Lobby::~Lobby()
{
MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, QosLatenciesUpdatedDelegateHandle);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, QosLatenciesUpdatedDelegateHandle);
}
OnReceivedQosLatenciesUpdatedDelegate.Unbind();

// only disconnect when engine is still valid
Expand Down
24 changes: 20 additions & 4 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteQos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Qos::Qos(Credentials& InCredentialsRef
, FAccelByteMessagingSystem& InMessagingSystemRef)
: CredentialsRef{InCredentialsRef.AsShared()}
, SettingsRef{InSettingsRef}
, MessagingSystem{InMessagingSystemRef}
#if ENGINE_MAJOR_VERSION < 5
, MessagingSystemWPtr{InMessagingSystemRef.AsShared()}
#else
, MessagingSystemWPtr{InMessagingSystemRef.AsWeak()}
#endif
, bValidityFlagPtr(MakeShared<bool>(true))
{
// Credentials is possibly destroyed before we are so we can't remove
Expand All @@ -40,15 +44,23 @@ Qos::Qos(Credentials& InCredentialsRef


OnLobbyConnectedHandle = FOnMessagingSystemReceivedMessage::CreateRaw(this, &Qos::OnLobbyConnected);
LobbyConnectedDelegateHandle = MessagingSystem.SubscribeToTopic(EAccelByteMessagingTopic::LobbyConnected, OnLobbyConnectedHandle);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
LobbyConnectedDelegateHandle = MessagingSystemPtr->SubscribeToTopic(EAccelByteMessagingTopic::LobbyConnected, OnLobbyConnectedHandle);
}

QosUpdateCheckerTickerDelegate = FTickerDelegate::CreateRaw(this, &Qos::CheckQosUpdate);
QosUpdateCheckerHandle = FTickerAlias::GetCoreTicker().AddTicker(QosUpdateCheckerTickerDelegate, QosUpdateCheckerIntervalSecs);
}

Qos::~Qos()
{
MessagingSystem.UnsubscribeFromTopic(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, LobbyConnectedDelegateHandle);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->UnsubscribeFromTopic(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, LobbyConnectedDelegateHandle);
}
OnLobbyConnectedHandle.Unbind();

// Indicate to the OnLoginSuccess lambda that we have been destroyed and `this` is no longer valid.
Expand Down Expand Up @@ -291,7 +303,11 @@ void Qos::SendQosLatenciesMessage()
RegionLatencies.Data.Add(RegionLatency);
}

MessagingSystem.SendMessage<FAccelByteModelsQosRegionLatencies>(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, RegionLatencies);
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
MessagingSystemPtr->SendMessage<FAccelByteModelsQosRegionLatencies>(EAccelByteMessagingTopic::QosRegionLatenciesUpdated, RegionLatencies);
}
}

void Qos::OnLobbyConnected(const FString& Payload)
Expand Down
12 changes: 7 additions & 5 deletions Source/AccelByteUe4Sdk/Private/Core/AccelByteApiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace AccelByte

FApiClient::FApiClient()
: bUseSharedCredentials(false)
, MessagingSystem(MakeShared<FAccelByteMessagingSystem>())
, MessagingSystem(MakeShared<FAccelByteMessagingSystem, ESPMode::ThreadSafe>())
, CredentialsRef(MakeShared<AccelByte::Credentials, ESPMode::ThreadSafe>(*MessagingSystem.Get()))
, HttpRef(MakeShared<AccelByte::FHttpRetryScheduler, ESPMode::ThreadSafe>())
{
Expand All @@ -21,12 +21,13 @@ FApiClient::FApiClient()
PresenceBroadcastEvent.Startup();
}

FApiClient::FApiClient(AccelByte::Credentials& Credentials, AccelByte::FHttpRetryScheduler& Http, TSharedPtr<AccelByte::FAccelByteMessagingSystem> MessagingRef)
FApiClient::FApiClient(AccelByte::Credentials& Credentials
, AccelByte::FHttpRetryScheduler& Http
, FAccelByteMessagingSystemPtr InMessagingPtr)
: bUseSharedCredentials(true)
, MessagingSystem(MessagingRef == nullptr ? MakeShared<FAccelByteMessagingSystem>() : MessagingRef)
, MessagingSystem(InMessagingPtr.IsValid() ? InMessagingPtr: MakeShared<FAccelByteMessagingSystem, ESPMode::ThreadSafe>())
, CredentialsRef(Credentials.AsShared())
, HttpRef(MakeShareable<AccelByte::FHttpRetryScheduler>(&Http,
[](AccelByte::FHttpRetryScheduler*) {}))
, HttpRef(MakeShareable<AccelByte::FHttpRetryScheduler>(&Http, [](AccelByte::FHttpRetryScheduler*) {}))
{
GameTelemetry.Startup();
PredefinedEvent.Startup();
Expand All @@ -40,6 +41,7 @@ FApiClient::~FApiClient()
PredefinedEvent.Shutdown();
GameStandardEvent.Shutdown();
PresenceBroadcastEvent.Shutdown();
MessagingSystem.Reset();

if (!bUseSharedCredentials)
{
Expand Down
6 changes: 3 additions & 3 deletions Source/AccelByteUe4Sdk/Private/Core/AccelByteCredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ namespace AccelByte
Credentials::Credentials(FAccelByteMessagingSystem& MessagingRef)
: AuthToken()
#if ENGINE_MAJOR_VERSION < 5
, MessagingSystem(MessagingRef.AsShared())
, MessagingSystemWPtr(MessagingRef.AsShared())
#else
, MessagingSystem(MessagingRef.AsWeak())
, MessagingSystemWPtr(MessagingRef.AsWeak())
#endif
, RefreshTokenTask(nullptr)
{
Expand Down Expand Up @@ -133,7 +133,7 @@ void Credentials::SetAuthToken(const FOauth2Token& NewAuthToken, float CurrentTi
BackoffCount = 0;
SessionState = ESessionState::Valid;

auto MessagingSystemPtr = MessagingSystem.Pin();
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();

if (MessagingSystemPtr.IsValid())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ FAccelByteMessagingSystem::FAccelByteMessagingSystem()

FAccelByteMessagingSystem::~FAccelByteMessagingSystem()
{
UnsubscribeAll();
FTickerAlias::GetCoreTicker().RemoveTicker(PollHandle);
}

Expand Down
Loading

0 comments on commit 74d1c04

Please sign in to comment.