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

Restorable Connections #1068

Merged
merged 59 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ea790be
checkpoint, IWalletProvider abstracted for web3auth but only signing …
rob1997 Jul 4, 2024
23a7da2
fixed send transaction
rob1997 Jul 4, 2024
f7a4bba
fixed signing
rob1997 Jul 4, 2024
9f88fe3
cleanup and docs
rob1997 Jul 5, 2024
93fd5b3
made requested changes
rob1997 Jul 5, 2024
ad14375
fixed WebGL issue with web3auth
rob1997 Jul 6, 2024
5e10cfb
checkpoint
rob1997 Jul 8, 2024
68fa2af
colors updated
rob1997 Jul 9, 2024
92a092b
checkpoint
rob1997 Jul 9, 2024
7132734
checkpoint
rob1997 Jul 9, 2024
540dc0e
checkpoint
rob1997 Jul 10, 2024
3d7da3b
editor code improved and added WC as a provider
rob1997 Jul 10, 2024
5370b57
meta file bug fix
rob1997 Jul 10, 2024
e818776
use resources instead of json to fetch providers, much nicer this way
rob1997 Jul 10, 2024
c8b7c03
font changed
rob1997 Jul 11, 2024
69ca0c3
checkpoint, web3auth modal initial run
rob1997 Jul 11, 2024
1ca6053
conflicts from dev
rob1997 Jul 11, 2024
ee7cf1d
Merge branch 'dev' into rob/wallet-prefab-connection-1014
rob1997 Jul 11, 2024
0a7b906
fixed some compile errors from merge
rob1997 Jul 11, 2024
35cf47f
revert from merge
rob1997 Jul 11, 2024
6c65e64
checkpoint
rob1997 Jul 12, 2024
71c8fd0
Web3Auth working (not WebGL)
rob1997 Jul 12, 2024
192c13a
working web3auth WebGL Modal
rob1997 Jul 16, 2024
bb4aa19
build error fix
rob1997 Jul 16, 2024
2792773
Merge branch 'dev' into rob/wallet-prefab-connection-1014
rob1997 Jul 17, 2024
6885e8f
documentation and namespace changes
rob1997 Jul 17, 2024
cff0b03
Merge branch 'dev' into rob/wallet-prefab-connection-1014
juans-chainsafe Jul 17, 2024
c9c8388
Merge branch 'dev' into rob/wallet-prefab-connection-1014
rob1997 Jul 17, 2024
eb75c7e
compile error fix
rob1997 Jul 17, 2024
8110fb5
HyperPlay platform fix and added Connect Modal scene to build settings
rob1997 Jul 17, 2024
6f685f2
first draft
rob1997 Jul 19, 2024
1727559
connection provider config and connection provider merged into one sc…
rob1997 Jul 19, 2024
354c75f
logout and missing changes from previous commit
rob1997 Jul 19, 2024
e8b8ed2
logout error fix
rob1997 Jul 19, 2024
81f6a97
UI flow fixed for Restore and removed LoginProviders
rob1997 Jul 20, 2024
d7efedd
wallet connect sessions now restorable
rob1997 Jul 22, 2024
cc73291
merged from dev
rob1997 Jul 22, 2024
e06be07
restore web3auth working on editor
rob1997 Aug 1, 2024
51edb49
checkpoint
rob1997 Aug 2, 2024
485445d
web data storage added
rob1997 Aug 2, 2024
731cf26
remember me working for web3auth WebGL
rob1997 Aug 2, 2024
844e8a9
unused scenes and samples removed
rob1997 Aug 5, 2024
475ccf3
checkpoint
rob1997 Aug 5, 2024
0cc3057
checkpoint
rob1997 Aug 5, 2024
ef1e5a8
fixed json issue
rob1997 Aug 5, 2024
c8219eb
added documentation to new files
rob1997 Aug 6, 2024
eaed086
merge from dev
rob1997 Aug 6, 2024
95cdf52
added show wallet gui
rob1997 Aug 6, 2024
f494bce
web3auth wallet gui added
rob1997 Aug 6, 2024
f7c0902
Merge branch 'dev' into rob/wallet-prefab-restore-connection-1014
rob1997 Aug 6, 2024
6ebd44f
removed ErrorPopup
rob1997 Aug 6, 2024
27c647e
merged from dev
rob1997 Aug 7, 2024
bc4f9ea
transaction issue kinda fixed
rob1997 Aug 7, 2024
706a47f
show wallet gui moved to connection provider SO
rob1997 Aug 7, 2024
0744f06
Merge branch 'dev' into rob/wallet-prefab-restore-connection-1014
rob1997 Aug 7, 2024
6fa5658
Merge branch 'dev' into rob/wallet-prefab-restore-connection-1014
kantagara Aug 7, 2024
83d7a02
HyperPlay WebGL fix
rob1997 Aug 7, 2024
aa58350
Merge branch 'rob/wallet-prefab-restore-connection-1014' of https://g…
rob1997 Aug 7, 2024
3828ffc
Merge branch 'dev' into rob/wallet-prefab-restore-connection-1014
rob1997 Aug 7, 2024
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 @@ -107,37 +107,5 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 4942797880779212655, guid: 5fc3fb751209aae4a97201647b943503, type: 3}
insertIndex: -1
addedObject: {fileID: 1727169539746137890}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5fc3fb751209aae4a97201647b943503, type: 3}
--- !u!1 &8369934619212736850 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4942797880779212655, guid: 5fc3fb751209aae4a97201647b943503, type: 3}
m_PrefabInstance: {fileID: 3512705784189120061}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1727169539746137890
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8369934619212736850}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 73b5e9380c5275043b3558f49f807100, type: 3}
m_Name:
m_EditorClassIdentifier:
<ConnectButton>k__BackingField: {fileID: 8599114313589093787}
--- !u!114 &8599114313589093787 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5181835182331206566, guid: 5fc3fb751209aae4a97201647b943503, type: 3}
m_PrefabInstance: {fileID: 3512705784189120061}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8369934619212736850}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 73b5e9380c5275043b3558f49f807100, type: 3}
m_Name: HyperPlayConnectionProvider
m_EditorClassIdentifier:
<Name>k__BackingField: HyperPlay
<ConnectButtonRow>k__BackingField: {fileID: 8599114313589093787, guid: 71b112e16f898d140935553a4b33ae1f, type: 3}
<RememberSession>k__BackingField: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
using ChainSafe.Gaming.LocalStorage;
using ChainSafe.Gaming.UnityPackage;
using ChainSafe.Gaming.UnityPackage.Connection;
using ChainSafe.Gaming.Web3.Build;
using ChainSafe.Gaming.Web3.Evm.Wallet;
Expand All @@ -9,30 +11,41 @@ namespace ChainSafe.Gaming.HyperPlay
/// <summary>
/// Connection provider for connecting via HyperPlay Launcher.
/// </summary>
public class HyperPlayConnectionProvider : ConnectionProvider
[CreateAssetMenu(menuName = "ChainSafe/Connection Provider/HyperPlay", fileName = nameof(HyperPlayConnectionProvider))]
public class HyperPlayConnectionProvider : RestorableConnectionProvider
{
public override bool IsAvailable => Application.isEditor || !Application.isMobilePlatform;

private bool _storedSessionAvailable;

public override Task Initialize()
{
return Task.CompletedTask;
}

public override Web3Builder ConfigureServices(Web3Builder web3Builder)
protected override void ConfigureServices(IWeb3ServiceCollection services)
{
return web3Builder.Configure(services =>
var config = new HyperPlayConfig
{
var config = new HyperPlayConfig
{
// RememberSession = rememberMeToggle.isOn || _storedSessionAvailable,
};
RememberSession = RememberSession,
};
#if UNITY_WEBGL && !UNITY_EDITOR
services.UseHyperPlay<HyperPlayWebGLProvider>(config);
#else
services.UseHyperPlay(config);
services.UseHyperPlay(config);
#endif
services.UseWalletSigner().UseWalletTransactionExecutor();
});
services.UseWalletSigner().UseWalletTransactionExecutor();
}

public override async Task<bool> SavedSessionAvailable()
{
var data = new HyperPlayData();

await data.LoadOneTime();

_storedSessionAvailable = data.RememberSession;

return _storedSessionAvailable;
}
}
}
Loading
Loading