Skip to content

Commit

Permalink
Updated from pipeline, Version : 26.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Nov 7, 2024
1 parent ff5e965 commit 0cfeac7
Show file tree
Hide file tree
Showing 17 changed files with 222 additions and 102 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/8222839531/1519193148/
export COMMIT_HASH=3101fd8361b05d4052eb2b8188072b2c537fd417
export GIT_HASH=3101fd8361b05d4052eb2b8188072b2c537fd417
export VERSION=26.3.0
export REVISION_ID=26.3.0
export WORKDIR=/tmp/pipelines/8295288212/1531474268/
export COMMIT_HASH=d39e3b59bc0b60f7db9a59af369b0f5f339d3390
export GIT_HASH=d39e3b59bc0b60f7db9a59af369b0f5f339d3390
export VERSION=26.3.1
export REVISION_ID=26.3.1
export [email protected]
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI2LjMuMCAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2luc2Fnc1ZlcnNpb246IjIwMjQuMSIKCg=='
export COMMIT_MESSAGE_BASE64='Y2hvcmUocmVsZWFzZSk6IDI2LjMuMSAtIGNvbW1pdGVkIGFuZCB0YWdnZWQgYnkgSmVua2lucwo='
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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.3.1](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/26.3.1%0D26.3.0) (2024-11-07)


### Bug Fixes

* **AMS:** make heartbeat as optional and change error message for AMS parameters ([5de3fec](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/5de3fec5240ee63bac13b025f891973d3f2c3b46))
* **challenge:** add missing enum member CUSTOM in EAccelByteModelsChallengeAssignmentRule ([2553488](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/255348832847d5dbd06244b4ab43ed1f176dd96b))
* **gameTelemetry:** change TSharedPtr<FAccelByteModelsTelemetryBody> to TSharedPtr<FAccelByteModelsTelemetryBody, ESPMode::ThreadSafe> ([9cb2754](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/9cb275462cdfba90e707cbf01de28a20f413e2a2))
* **lobby, chat:** move to sharedPtr ([89ab8af](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/89ab8af1ce7a47be22753f24639ce5ffc693be7f))

## [26.3.0](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/26.3.0%0D26.2.1) (2024-10-30)


Expand Down
4 changes: 3 additions & 1 deletion Source/AccelByteUe4Sdk/Private/AccelByteUe4SdkModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "Api/AccelBytePredefinedEventApi.h"
#include "Api/AccelByteGameStandardEventApi.h"
#include "Api/AccelByteQos.h"
#include "Api/AccelByteLobbyApi.h"
#include "Core/ServerTime/AccelByteTimeManager.h"
#include "GameServerApi/AccelByteServerAMSApi.h"
#include "Engine/GameInstance.h"
Expand Down Expand Up @@ -106,6 +107,7 @@ void FAccelByteUe4SdkModule::StartupModule()
AccelByte::FRegistry::GameTelemetryPtr->Startup();
AccelByte::FRegistry::PredefinedEventPtr->Startup();
AccelByte::FRegistry::GameStandardEventPtr->Startup();
AccelByte::FRegistry::LobbyPtr->Startup();
#if !UE_SERVER
AccelByte::FRegistry::HeartBeat.Startup();
#endif
Expand Down Expand Up @@ -424,7 +426,7 @@ void FAccelByteUe4SdkModule::OnGameInstanceCreated(UGameInstance* GameInstance)
{
if (!AccelByte::FRegistry::ServerSettings.LoadAMSSettings())
{
UE_LOG(LogAccelByte, Warning, TEXT("dsid not provided, not connecting to AMS"));
UE_LOG(LogAccelByte, Log, TEXT("Dedicated server is not connected to AMS."));
}
else
{
Expand Down
27 changes: 17 additions & 10 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteChatApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ namespace IncomingMessage
{
if(UObjectInitialized())
{
UnbindEvent();
Disconnect();
ReconnectAttempted.Clear();
MassiveOutage.Clear();
}
Expand Down Expand Up @@ -477,12 +479,12 @@ namespace IncomingMessage
*this /*Reconnect Strategy*/,
PingDelay);

WebSocket->OnConnected().AddRaw(this, &Chat::OnConnected);
WebSocket->OnMessageReceived().AddRaw(this, &Chat::OnMessage);
WebSocket->OnConnectionError().AddRaw(this, &Chat::OnConnectionError);
WebSocket->OnConnectionClosed().AddRaw(this, &Chat::OnClosed);
WebSocket->OnReconnectAttempt().AddRaw(this, &Chat::OnReconnectAttempt);
WebSocket->OnMassiveOutage().AddRaw(this, &Chat::OnMassiveOutage);
WebSocket->OnConnected().AddThreadSafeSP(AsShared(), &Chat::OnConnected);
WebSocket->OnMessageReceived().AddThreadSafeSP(AsShared(), &Chat::OnMessage);
WebSocket->OnConnectionError().AddThreadSafeSP(AsShared(), &Chat::OnConnectionError);
WebSocket->OnConnectionClosed().AddThreadSafeSP(AsShared(), &Chat::OnClosed);
WebSocket->OnReconnectAttempt().AddThreadSafeSP(AsShared(), &Chat::OnReconnectAttempt);
WebSocket->OnMassiveOutage().AddThreadSafeSP(AsShared(), &Chat::OnMassiveOutage);
}

void Chat::Connect()
Expand Down Expand Up @@ -542,13 +544,18 @@ namespace IncomingMessage
auto MessagingSystemPtr = MessagingSystemWPtr.Pin();
if (MessagingSystemPtr.IsValid())
{
ChatWPtr ChatWeak = AsShared();
AuthTokenSetDelegateHandle = MessagingSystemPtr->SubscribeToTopic(EAccelByteMessagingTopic::AuthTokenSet
, FOnMessagingSystemReceivedMessage::CreateLambda(
[this](FString const& Message)
[ChatWeak](FString const& Message)
{
FOauth2Token Token;
FJsonObjectConverter::JsonObjectStringToUStruct(Message, &Token);
RefreshToken(Token.Access_token, RefreshTokenResponse);
auto ChatApi = ChatWeak.Pin();
if (ChatApi.IsValid())
{
FOauth2Token Token;
FJsonObjectConverter::JsonObjectStringToUStruct(Message, &Token);
ChatApi->RefreshToken(Token.Access_token, ChatApi->RefreshTokenResponse);
}
}));
}

Expand Down
34 changes: 17 additions & 17 deletions Source/AccelByteUe4Sdk/Private/Api/AccelByteGameTelemetryApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void GameTelemetry::OnLoginSuccess(FOauth2Token const& Response)
{
if (bCacheEvent)
{
TWeakPtr<GameTelemetry, ESPMode::ThreadSafe> GameTelemetryWeak = AsShared();
GameTelemetryWPtr GameTelemetryWeak = AsShared();
AsyncTask(ENamedThreads::AnyBackgroundThreadNormalTask, [GameTelemetryWeak]()
{
const auto GameTelemetryApi = GameTelemetryWeak.Pin();
Expand Down Expand Up @@ -109,12 +109,12 @@ void GameTelemetry::Send(FAccelByteModelsTelemetryBody TelemetryBody

if (ImmediateEvents.Contains(TelemetryBody.EventName))
{
SendProtectedEvents({ MakeShared<FAccelByteModelsTelemetryBody>(TelemetryBody) }, OnSuccess, OnError);
SendProtectedEvents({ MakeShared<FAccelByteModelsTelemetryBody, ESPMode::ThreadSafe>(TelemetryBody) }, OnSuccess, OnError);
}
else
{
TSharedPtr<FAccelByteModelsTelemetryBody> TelemetryPtr = MakeShared<FAccelByteModelsTelemetryBody>(TelemetryBody);
JobQueue.Enqueue(TTuple<TSharedPtr<FAccelByteModelsTelemetryBody>, FVoidHandler, FErrorHandler>{ TelemetryPtr, OnSuccess, OnError });
TelemetryBodyPtr TelemetryPtr = MakeShared<FAccelByteModelsTelemetryBody, ESPMode::ThreadSafe>(TelemetryBody);
JobQueue.Enqueue(TTuple<TelemetryBodyPtr, FVoidHandler, FErrorHandler>{ TelemetryPtr, OnSuccess, OnError });
if (bCacheEvent || CriticalEvents.Contains(TelemetryBody.EventName))
{
GameTelemetryWPtr GameTelemetryWeak = AsShared();
Expand Down Expand Up @@ -186,20 +186,20 @@ bool GameTelemetry::PeriodicTelemetry(float DeltaTime)
{
FReport::Log(FString(__FUNCTION__));

TArray<TSharedPtr<FAccelByteModelsTelemetryBody>> TelemetryBodies;
TArray<TelemetryBodyPtr> TelemetryBodies;
TArray<FVoidHandler> OnSuccessCallbacks;
TArray<FErrorHandler> OnErrorCallbacks;
while (!JobQueue.IsEmpty())
{
TTuple<TSharedPtr<FAccelByteModelsTelemetryBody>, FVoidHandler, FErrorHandler> DequeueResult;
TTuple<TelemetryBodyPtr, FVoidHandler, FErrorHandler> DequeueResult;
if (JobQueue.Dequeue(DequeueResult))
{
TelemetryBodies.Add(DequeueResult.Get<0>());
OnSuccessCallbacks.Add(DequeueResult.Get<1>());
OnErrorCallbacks.Add(DequeueResult.Get<2>());
}
}
TWeakPtr<GameTelemetry, ESPMode::ThreadSafe> GameTelemetryWeak = AsShared();
GameTelemetryWPtr GameTelemetryWeak = AsShared();
SendProtectedEvents(TelemetryBodies
, FVoidHandler::CreateLambda(
[GameTelemetryWeak, OnSuccessCallbacks, TelemetryBodies]()
Expand Down Expand Up @@ -227,7 +227,7 @@ bool GameTelemetry::PeriodicTelemetry(float DeltaTime)
{
for (int i = 0; i < TelemetryBodies.Num(); i++)
{
GameTelemetryApi->JobQueue.Enqueue(TTuple<TSharedPtr<FAccelByteModelsTelemetryBody>, FVoidHandler, FErrorHandler>
GameTelemetryApi->JobQueue.Enqueue(TTuple<TelemetryBodyPtr, FVoidHandler, FErrorHandler>
{
TelemetryBodies[i],
i < OnSuccessCallbacks.Num() ? OnSuccessCallbacks[i] : FVoidHandler{},
Expand All @@ -247,7 +247,7 @@ bool GameTelemetry::PeriodicTelemetry(float DeltaTime)
return true;
}

void GameTelemetry::SendProtectedEvents(TArray<TSharedPtr<FAccelByteModelsTelemetryBody>> const& Events
void GameTelemetry::SendProtectedEvents(TArray<TelemetryBodyPtr> const& Events
, FVoidHandler const& OnSuccess
, FErrorHandler const& OnError)
{
Expand Down Expand Up @@ -301,7 +301,7 @@ void GameTelemetry::LoadCachedEvents()

bCacheUpdated = true;

TWeakPtr<GameTelemetry, ESPMode::ThreadSafe> GameTelemetryWeak = AsShared();
GameTelemetryWPtr GameTelemetryWeak = AsShared();
IAccelByteUe4SdkModuleInterface::Get().GetLocalDataStorage()->GetItem(TelemetryKey
, THandler<TPair<FString, FString>>::CreateLambda(
[GameTelemetryWeak](TPair<FString, FString> Pair)
Expand All @@ -311,7 +311,7 @@ void GameTelemetry::LoadCachedEvents()
return;
}
const auto GameTelemetryApi = GameTelemetryWeak.Pin();
TArray<TSharedPtr<FAccelByteModelsTelemetryBody>> EventList;
TArray<TelemetryBodyPtr> EventList;
if (GameTelemetryApi.IsValid()
&& GameTelemetryApi->EventsJsonToArray(Pair.Value, EventList))
{
Expand All @@ -337,7 +337,7 @@ void GameTelemetry::LoadCachedEvents()
{
for (int i = 0; i < EventList.Num(); i++)
{
GameTelemetryApi->JobQueue.Enqueue(TTuple<TSharedPtr<FAccelByteModelsTelemetryBody>, FVoidHandler, FErrorHandler>
GameTelemetryApi->JobQueue.Enqueue(TTuple<TelemetryBodyPtr, FVoidHandler, FErrorHandler>
{ EventList[i], FVoidHandler{}, FErrorHandler{} });
}
}
Expand All @@ -349,7 +349,7 @@ void GameTelemetry::LoadCachedEvents()
}

//Should be called from async task
void GameTelemetry::AppendEventToCache(TSharedPtr<FAccelByteModelsTelemetryBody> Telemetry)
void GameTelemetry::AppendEventToCache(TelemetryBodyPtr Telemetry)
{
FString TelemetryKey = GetTelemetryKey();
if (TelemetryKey.IsEmpty())
Expand Down Expand Up @@ -399,7 +399,7 @@ void GameTelemetry::AppendEventToCache(TSharedPtr<FAccelByteModelsTelemetryBody>
}

//Should be called from async task
void GameTelemetry::RemoveEventsFromCache(TArray<TSharedPtr<FAccelByteModelsTelemetryBody>> const& Events)
void GameTelemetry::RemoveEventsFromCache(TArray<TelemetryBodyPtr> const& Events)
{
FString TelemetryKey = GetTelemetryKey();
if (TelemetryKey.IsEmpty())
Expand Down Expand Up @@ -436,7 +436,7 @@ bool GameTelemetry::JobArrayQueueAsJsonString(FString& OutJsonString)
{
TSharedRef<FJsonObject> TelemetryObj = MakeShared<FJsonObject>();
TArray<TSharedPtr<FJsonValue>> EventsObjArray;
TArray<TSharedPtr<FAccelByteModelsTelemetryBody>> TempEventPtrArray;
TArray<TelemetryBodyPtr> TempEventPtrArray;
{
FScopeLock ScopeLock(&EventPtrArrayLock);
TempEventPtrArray = EventPtrArray;
Expand Down Expand Up @@ -473,7 +473,7 @@ const FString GameTelemetry::GetEventNamespace()
}

bool GameTelemetry::EventsJsonToArray(FString& InJsonString
, TArray<TSharedPtr<FAccelByteModelsTelemetryBody>>& OutArray)
, TArray<TelemetryBodyPtr>& OutArray)
{
TSharedPtr<FJsonObject> JsonObjectPtr{ MakeShared<FJsonObject>() };

Expand Down Expand Up @@ -505,7 +505,7 @@ bool GameTelemetry::EventsJsonToArray(FString& InJsonString
TelemetryBody.Payload = JsonObj->GetObjectField(TEXT("Payload"));
ClientTimestamp = JsonObj->GetIntegerField(TEXT("ClientTimestamp"));
TelemetryBody.ClientTimestamp = FDateTime::FromUnixTimestamp(ClientTimestamp);
OutArray.Add(MakeShared<FAccelByteModelsTelemetryBody>(TelemetryBody));
OutArray.Add(MakeShared<FAccelByteModelsTelemetryBody, ESPMode::ThreadSafe>(TelemetryBody));
}
return true;
}
Expand Down
Loading

0 comments on commit 0cfeac7

Please sign in to comment.