Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX-2698] style: applied epic code standard #75

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

#include "Immutable/Actions/ImtblBlueprintAsyncAction.h"

UImmutableSubsystem *UImtblBlueprintAsyncAction::GetSubsystem() const {
if (!WorldContextObject || !WorldContextObject->GetWorld())
return nullptr;
return WorldContextObject->GetWorld()
->GetGameInstance()
->GetSubsystem<UImmutableSubsystem>();
UImmutableSubsystem* UImtblBlueprintAsyncAction::GetSubsystem() const
{
if (!WorldContextObject || !WorldContextObject->GetWorld())
{
return nullptr;
}
return WorldContextObject->GetWorld()->GetGameInstance()->GetSubsystem<UImmutableSubsystem>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::ConnectImx(UObject*
UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::LoginPKCE(UObject* WorldContextObject)
{
UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject<UImtblConnectionAsyncActions>();

PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
PassportInitBlueprintNode->bIsConnectImx = false;
PassportInitBlueprintNode->bIsPKCE = true;

return PassportInitBlueprintNode;
}

UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::ConnectImxPKCE(UObject* WorldContextObject)
{
UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject<UImtblConnectionAsyncActions>();

PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
PassportInitBlueprintNode->bIsConnectImx = true;
PassportInitBlueprintNode->bIsPKCE = true;

return PassportInitBlueprintNode;
}

Expand All @@ -58,7 +58,7 @@ void UImtblConnectionAsyncActions::Activate()
FString Error = "Connect failed due to missing world or world context object.";
IMTBL_WARN("%s", *Error)
Failed.Broadcast(Error);

return;
}

Expand All @@ -74,14 +74,12 @@ void UImtblConnectionAsyncActions::DoConnect(TWeakObjectPtr<UImtblJSConnector> J
if (bIsPKCE)
{
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC
Passport->ConnectPKCE(bIsConnectImx, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject
(this, &UImtblConnectionAsyncActions::OnConnect));
Passport->ConnectPKCE(bIsConnectImx, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblConnectionAsyncActions::OnConnect));
#endif
}
else
{
Passport->Connect(bIsConnectImx, bUseCachedSession, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject
(this, &UImtblConnectionAsyncActions::OnConnect));
Passport->Connect(bIsConnectImx, bUseCachedSession, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblConnectionAsyncActions::OnConnect));
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,42 @@
#include "Immutable/ImmutableSubsystem.h"
#include "Immutable/Misc/ImtblLogging.h"

UImtblPassportConnectEvmAsyncAction *
UImtblPassportConnectEvmAsyncAction::ConnectEvm(UObject *WorldContextObject) {
UImtblPassportConnectEvmAsyncAction *PassportInitBlueprintNode =
NewObject<UImtblPassportConnectEvmAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
UImtblPassportConnectEvmAsyncAction* UImtblPassportConnectEvmAsyncAction::ConnectEvm(UObject* WorldContextObject)
{
UImtblPassportConnectEvmAsyncAction* PassportInitBlueprintNode = NewObject<UImtblPassportConnectEvmAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
}

void UImtblPassportConnectEvmAsyncAction::Activate() {
if (!WorldContextObject || !WorldContextObject->GetWorld()) {
FString Err =
"ConnectEvm failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err);
return;
}
void UImtblPassportConnectEvmAsyncAction::Activate()
{
if (!WorldContextObject || !WorldContextObject->GetWorld())
{
FString Err = "ConnectEvm failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err);
return;
}

GetSubsystem()->WhenReady(this,
&UImtblPassportConnectEvmAsyncAction::DoConnectEvm);
GetSubsystem()->WhenReady(this, &UImtblPassportConnectEvmAsyncAction::DoConnectEvm);
}

void UImtblPassportConnectEvmAsyncAction::DoConnectEvm(
TWeakObjectPtr<UImtblJSConnector> JSConnector) {
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run ConnectEvm
Passport->ConnectEvm(
UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(
this, &UImtblPassportConnectEvmAsyncAction::OnConnectEvm));
void UImtblPassportConnectEvmAsyncAction::DoConnectEvm(TWeakObjectPtr<UImtblJSConnector> JSConnector)
{
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run ConnectEvm
Passport->ConnectEvm(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportConnectEvmAsyncAction::OnConnectEvm));
}

void UImtblPassportConnectEvmAsyncAction::OnConnectEvm(
FImmutablePassportResult Result) {
if (Result.Success) {
Success.Broadcast(Result.Message);
} else {
Failed.Broadcast(Result.Message);
}
void UImtblPassportConnectEvmAsyncAction::OnConnectEvm(FImmutablePassportResult Result)
{
if (Result.Success)
{
Success.Broadcast(Result.Message);
}
else
{
Failed.Broadcast(Result.Message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,42 @@
#include "Immutable/ImmutableSubsystem.h"
#include "Immutable/Misc/ImtblLogging.h"

UImtblPassportGetAccessTokenAsyncAction *
UImtblPassportGetAccessTokenAsyncAction::GetAccessToken(
UObject *WorldContextObject) {
UImtblPassportGetAccessTokenAsyncAction *PassportInitBlueprintNode =
NewObject<UImtblPassportGetAccessTokenAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
UImtblPassportGetAccessTokenAsyncAction* UImtblPassportGetAccessTokenAsyncAction::GetAccessToken(UObject* WorldContextObject)
{
UImtblPassportGetAccessTokenAsyncAction* PassportInitBlueprintNode = NewObject<UImtblPassportGetAccessTokenAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
}

void UImtblPassportGetAccessTokenAsyncAction::Activate() {
if (!WorldContextObject || !WorldContextObject->GetWorld()) {
FString Err =
"GetAccessToken failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err, TEXT(""));
return;
}
void UImtblPassportGetAccessTokenAsyncAction::Activate()
{
if (!WorldContextObject || !WorldContextObject->GetWorld())
{
FString Err = "GetAccessToken failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err, TEXT(""));
return;
}

GetSubsystem()->WhenReady(
this, &UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken);
GetSubsystem()->WhenReady(this, &UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken);
}

void UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken(
TWeakObjectPtr<UImtblJSConnector> JSConnector) {
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run GetAccessToken
Passport->GetAccessToken(
UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(
this,
&UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse));
void UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken(TWeakObjectPtr<UImtblJSConnector> JSConnector)
{
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run GetAccessToken
Passport->GetAccessToken(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse));
}

void UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse(
FImmutablePassportResult Result) {
if (Result.Success) {
GotAccessToken.Broadcast(TEXT(""), Result.Message);
} else {
Failed.Broadcast(Result.Message, TEXT(""));
}
void UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse(FImmutablePassportResult Result)
{
if (Result.Success)
{
GotAccessToken.Broadcast(TEXT(""), Result.Message);
}
else
{
Failed.Broadcast(Result.Message, TEXT(""));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,43 @@
#include "Immutable/ImmutableSubsystem.h"
#include "Immutable/Misc/ImtblLogging.h"

UImtblPassportGetAddressAsyncAction *
UImtblPassportGetAddressAsyncAction::GetAddress(UObject *WorldContextObject) {
UImtblPassportGetAddressAsyncAction *PassportInitBlueprintNode =
NewObject<UImtblPassportGetAddressAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
UImtblPassportGetAddressAsyncAction* UImtblPassportGetAddressAsyncAction::GetAddress(UObject* WorldContextObject)
{
UImtblPassportGetAddressAsyncAction* PassportInitBlueprintNode = NewObject<UImtblPassportGetAddressAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
}

void UImtblPassportGetAddressAsyncAction::Activate() {
if (!WorldContextObject || !WorldContextObject->GetWorld()) {
FString Err =
"GetAddress failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err, TEXT(""));
return;
}
void UImtblPassportGetAddressAsyncAction::Activate()
{
if (!WorldContextObject || !WorldContextObject->GetWorld())
{
FString Err = "GetAddress failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err, TEXT(""));
return;
}

GetSubsystem()->WhenReady(
this,
&UImtblPassportGetAddressAsyncAction::DoGetAddress); //, /* timoutSec
//*/ 15.0f);
GetSubsystem()->WhenReady(this, &UImtblPassportGetAddressAsyncAction::DoGetAddress); //, /* timoutSec
//*/ 15.0f);
}

void UImtblPassportGetAddressAsyncAction::DoGetAddress(
TWeakObjectPtr<UImtblJSConnector> JSConnector) {
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run GetAddress
Passport->GetAddress(
UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(
this, &UImtblPassportGetAddressAsyncAction::OnGetAddressResponse));
void UImtblPassportGetAddressAsyncAction::DoGetAddress(TWeakObjectPtr<UImtblJSConnector> JSConnector)
{
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run GetAddress
Passport->GetAddress(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportGetAddressAsyncAction::OnGetAddressResponse));
}

void UImtblPassportGetAddressAsyncAction::OnGetAddressResponse(
FImmutablePassportResult Result) {
if (Result.Success) {
GotAddress.Broadcast(TEXT(""), Result.Message);
} else {
Failed.Broadcast(Result.Message, TEXT(""));
}
void UImtblPassportGetAddressAsyncAction::OnGetAddressResponse(FImmutablePassportResult Result)
{
if (Result.Success)
{
GotAddress.Broadcast(TEXT(""), Result.Message);
}
else
{
Failed.Broadcast(Result.Message, TEXT(""));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@
#include "Immutable/ImmutableSubsystem.h"
#include "Immutable/Misc/ImtblLogging.h"

UImtblPassportGetEmailAsyncAction *
UImtblPassportGetEmailAsyncAction::GetEmail(UObject *WorldContextObject) {
UImtblPassportGetEmailAsyncAction *PassportInitBlueprintNode =
NewObject<UImtblPassportGetEmailAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
UImtblPassportGetEmailAsyncAction* UImtblPassportGetEmailAsyncAction::GetEmail(UObject* WorldContextObject)
{
UImtblPassportGetEmailAsyncAction* PassportInitBlueprintNode = NewObject<UImtblPassportGetEmailAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
return PassportInitBlueprintNode;
}

void UImtblPassportGetEmailAsyncAction::Activate() {
if (!WorldContextObject || !WorldContextObject->GetWorld()) {
FString Err =
"GetEmail failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err, TEXT(""));
return;
}
void UImtblPassportGetEmailAsyncAction::Activate()
{
if (!WorldContextObject || !WorldContextObject->GetWorld())
{
FString Err = "GetEmail failed due to missing world or world context object.";
IMTBL_WARN("%s", *Err)
Failed.Broadcast(Err, TEXT(""));
return;
}

GetSubsystem()->WhenReady(
this, &UImtblPassportGetEmailAsyncAction::DoGetEmail); //, /* timoutSec
//*/ 15.0f);
GetSubsystem()->WhenReady(this, &UImtblPassportGetEmailAsyncAction::DoGetEmail); //, /* timoutSec
//*/ 15.0f);
}

void UImtblPassportGetEmailAsyncAction::DoGetEmail(
TWeakObjectPtr<UImtblJSConnector> JSConnector) {
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run GetEmail
Passport->GetEmail(
UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(
this, &UImtblPassportGetEmailAsyncAction::OnGetEmailResponse));
void UImtblPassportGetEmailAsyncAction::DoGetEmail(TWeakObjectPtr<UImtblJSConnector> JSConnector)
{
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run GetEmail
Passport->GetEmail(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportGetEmailAsyncAction::OnGetEmailResponse));
}

void UImtblPassportGetEmailAsyncAction::OnGetEmailResponse(
FImmutablePassportResult Result) {
if (Result.Success) {
GotEmail.Broadcast(TEXT(""), Result.Message);
} else {
Failed.Broadcast(Result.Message, TEXT(""));
}
void UImtblPassportGetEmailAsyncAction::OnGetEmailResponse(FImmutablePassportResult Result)
{
if (Result.Success)
{
GotEmail.Broadcast(TEXT(""), Result.Message);
}
else
{
Failed.Broadcast(Result.Message, TEXT(""));
}
}
Loading
Loading