Skip to content

Commit 9e5f4c7

Browse files
authored
[DX-2506] feat: new passport login without wallet (#61)
* feat: login and connectImx * feat: modified pkce connect method for new login * feat: code cleanup * fix: fixed issues on windows platform * feat: updated bridge on ue 4.26 * fix: separated login and connect imx functionalities * fix: minor addition to guard cef related variable * fix: fixed android compile issue * feat: updated sample and bridge assets * feat: updated the bridge * feat: removed redundant code
1 parent 3397a48 commit 9e5f4c7

19 files changed

+771
-741
lines changed
Binary file not shown.
1.16 KB
Binary file not shown.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
#include "Immutable/Actions/ImtblConnectImxAsyncAction.h"
4+
5+
#include "Immutable/ImmutablePassport.h"
6+
#include "Immutable/ImmutableSubsystem.h"
7+
#include "Immutable/Misc/ImtblLogging.h"
8+
9+
10+
UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::Login(UObject* WorldContextObject, bool UseCachedSession)
11+
{
12+
UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject<UImtblConnectionAsyncActions>();
13+
14+
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
15+
PassportInitBlueprintNode->bUseCachedSession = UseCachedSession;
16+
PassportInitBlueprintNode->bIsConnectImx = false;
17+
18+
return PassportInitBlueprintNode;
19+
}
20+
21+
UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::ConnectImx(UObject* WorldContextObject, bool UseCachedSession)
22+
{
23+
UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject<UImtblConnectionAsyncActions>();
24+
25+
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
26+
PassportInitBlueprintNode->bUseCachedSession = UseCachedSession;
27+
PassportInitBlueprintNode->bIsConnectImx = true;
28+
29+
return PassportInitBlueprintNode;
30+
}
31+
32+
UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::LoginPKCE(UObject* WorldContextObject)
33+
{
34+
UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject<UImtblConnectionAsyncActions>();
35+
36+
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
37+
PassportInitBlueprintNode->bIsConnectImx = false;
38+
PassportInitBlueprintNode->bIsPKCE = true;
39+
40+
return PassportInitBlueprintNode;
41+
}
42+
43+
UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::ConnectImxPKCE(UObject* WorldContextObject)
44+
{
45+
UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject<UImtblConnectionAsyncActions>();
46+
47+
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
48+
PassportInitBlueprintNode->bIsConnectImx = true;
49+
PassportInitBlueprintNode->bIsPKCE = true;
50+
51+
return PassportInitBlueprintNode;
52+
}
53+
54+
void UImtblConnectionAsyncActions::Activate()
55+
{
56+
if (!WorldContextObject || !WorldContextObject->GetWorld())
57+
{
58+
FString Error = "Connect failed due to missing world or world context object.";
59+
IMTBL_WARN("%s", *Error)
60+
Failed.Broadcast(Error);
61+
62+
return;
63+
}
64+
65+
GetSubsystem()->WhenReady(this, &UImtblConnectionAsyncActions::DoConnect);
66+
}
67+
68+
void UImtblConnectionAsyncActions::DoConnect(TWeakObjectPtr<UImtblJSConnector> JSConnector)
69+
{
70+
auto Passport = GetSubsystem()->GetPassport();
71+
72+
if (Passport.IsValid())
73+
{
74+
if (bIsPKCE)
75+
{
76+
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC
77+
Passport->ConnectPKCE(bIsConnectImx, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject
78+
(this, &UImtblConnectionAsyncActions::OnConnect));
79+
#endif
80+
}
81+
else
82+
{
83+
Passport->Connect(bIsConnectImx, bUseCachedSession, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject
84+
(this, &UImtblConnectionAsyncActions::OnConnect));
85+
}
86+
}
87+
else
88+
{
89+
IMTBL_ERR("Passport was not valid while trying to connect")
90+
}
91+
}
92+
93+
void UImtblConnectionAsyncActions::OnConnect(FImmutablePassportResult Result)
94+
{
95+
if (Result.Success)
96+
{
97+
Success.Broadcast(TEXT(""));
98+
}
99+
else
100+
{
101+
Failed.Broadcast(Result.Message);
102+
}
103+
}

Source/Immutable/Private/Immutable/Actions/ImtblPassportConnectAsyncAction.cpp

Lines changed: 0 additions & 48 deletions
This file was deleted.

Source/Immutable/Private/Immutable/Actions/ImtblPassportConnectPKCEAsyncAction.cpp

Lines changed: 0 additions & 49 deletions
This file was deleted.

Source/Immutable/Private/Immutable/Actions/ImtblPassportConnectSilentAsyncAction.cpp

Lines changed: 0 additions & 53 deletions
This file was deleted.

Source/Immutable/Private/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "Immutable/ImmutablePassport.h"
66
#include "Immutable/ImmutableSubsystem.h"
7+
#include "Immutable/ImmutableResponses.h"
78
#include "Immutable/Misc/ImtblLogging.h"
89

910
UImmutablePassportImxBatchNftTransferAsyncAction *

Source/Immutable/Private/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "Immutable/ImmutablePassport.h"
44
#include "Immutable/ImmutableSubsystem.h"
5+
#include "Immutable/ImmutableResponses.h"
56
#include "Immutable/Misc/ImtblLogging.h"
67

78

0 commit comments

Comments
 (0)