Skip to content

Commit

Permalink
style: applied epic code standard
Browse files Browse the repository at this point in the history
  • Loading branch information
YermekG committed Feb 28, 2024
1 parent 834b7bf commit 2038bcc
Show file tree
Hide file tree
Showing 55 changed files with 1,304 additions and 1,503 deletions.
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

0 comments on commit 2038bcc

Please sign in to comment.