Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b535637
Revert "automated duplicating imported samples modifications (#595)"
robGG1997 Sep 14, 2023
95fb832
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 14, 2023
e3ab3c2
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 14, 2023
a536df0
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 15, 2023
c12a0de
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 18, 2023
8e1ea0a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 18, 2023
1318cd7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 21, 2023
33b8e52
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 22, 2023
0a205bd
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 25, 2023
df4795a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 29, 2023
abc34f6
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Sep 29, 2023
031e8d3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 18, 2023
3a4bdd9
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 24, 2023
67d871d
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 25, 2023
3c1d099
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 30, 2023
ed22cb7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Oct 31, 2023
4c8b282
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 1, 2023
ea609de
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 2, 2023
adcb974
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 2, 2023
77dd93a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 3, 2023
12af139
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 7, 2023
0cc92d4
Changes made
robGG1997 Nov 7, 2023
1ebbce0
Auto-duplicate Packages Samples
robGG1997 Nov 7, 2023
d29ca05
Published Solution Dependencies to Package Libraries as DLLs
robGG1997 Nov 7, 2023
3080de3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 8, 2023
e8accf8
merge to main
robGG1997 Nov 8, 2023
0c5ff79
reverted unwanted changes back to main
robGG1997 Nov 8, 2023
4929e5b
Published Solution Dependencies to Package Libraries as DLLs
robGG1997 Nov 8, 2023
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
9 changes: 7 additions & 2 deletions Packages/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,15 @@ crashlytics-build.properties
!*.meta

# Ignore the build artifacts from our libraries
# /io.chainsafe.web3-unity/Runtime/Libraries/*.dll
# /io.chainsafe.web3-unity/Runtime/Libraries/*.dll.meta
/io.chainsafe.web3-unity/Runtime/Libraries/*.dll
/io.chainsafe.web3-unity/Runtime/Libraries/*.dll.meta
/io.chainsafe.web3-unity/Runtime/Libraries/*.pdb
/io.chainsafe.web3-unity/Runtime/Libraries/*.pdb.meta

/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/*.dll
/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/*.dll.meta
/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/*.pdb
/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/*.pdb.meta

# Since the folder is called 'Debug', it's being ignored, so negate that
!/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Debug
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ private void BuildWalletConnectConfig()
// try and get saved value
SavedSessionTopic = walletConnectConfig?.SavedSessionTopic,
SupportedWallets = supportedWallets,
StoragePath = Application.persistentDataPath,
// save file closer to assets when in editor, more accessible
StoragePath = Application.isEditor ? Application.dataPath : Application.persistentDataPath,
RedirectToWallet = redirectToWallet,
KeepSessionAlive = autoLogin || rememberMeToggle.isOn,
DefaultWallet = defaultWallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ public class PlayerData
{
#region Save & Load

private static string _path = $"{Path.Combine(Application.persistentDataPath, nameof(PlayerData))}.json";
private string Path
{
get
{
// save closer to assets when in editor
// more accessible
string directory = Application.isEditor ? Application.dataPath : Application.persistentDataPath;

return $"{System.IO.Path.Combine(directory, nameof(PlayerData))}.json";
}
}

/// <summary>
/// Singleton instance.
/// </summary>
public static PlayerData Instance { get; private set; } = new PlayerData();

private bool FileExists => File.Exists(_path);
private bool FileExists => File.Exists(Path);

/// <summary>
/// Loads Data when runtime starts.
Expand All @@ -41,26 +51,26 @@ private void LoadData()
return;
}

using (FileStream fs = new FileStream(_path, FileMode.Open, FileAccess.Read))
using (FileStream fs = new FileStream(Path, FileMode.Open, FileAccess.Read))
using (StreamReader sr = new StreamReader(fs))
{
string rawJson = sr.ReadToEnd();

Instance = JsonConvert.DeserializeObject<PlayerData>(rawJson);

Debug.Log($"{nameof(PlayerData)} loaded from path {_path}.");
Debug.Log($"{nameof(PlayerData)} loaded from path {Path}.");
}
}

private void SaveData()
{
// create file
using (FileStream fs = new FileStream(_path, FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream fs = new FileStream(Path, FileMode.OpenOrCreate, FileAccess.Write))
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine(JsonConvert.SerializeObject(Instance));

Debug.Log($"{nameof(PlayerData)} saved at path {_path}.");
Debug.Log($"{nameof(PlayerData)} saved at path {Path}.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ private FileSystemStorage BuildStorage()
{
var path = Path.Combine(config.StoragePath, "walletconnect.json");

// If we're not restoring a session and save WC file exists remove it.
// This is done to mitigate for a WC error that happens intermittently where generated Uri doesn't connect wallet.
if (string.IsNullOrEmpty(config.SavedSessionTopic) && File.Exists(path))
{
File.Delete(path);
}

WCLogger.Log($"Wallet Connect Storage set to {path}");

return new FileSystemStorage(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ private void BuildWalletConnectConfig()
// try and get saved value
SavedSessionTopic = walletConnectConfig?.SavedSessionTopic,
SupportedWallets = supportedWallets,
StoragePath = Application.persistentDataPath,
// save file closer to assets when in editor, more accessible
StoragePath = Application.isEditor ? Application.dataPath : Application.persistentDataPath,
RedirectToWallet = redirectToWallet,
KeepSessionAlive = autoLogin || rememberMeToggle.isOn,
DefaultWallet = defaultWallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ public class PlayerData
{
#region Save & Load

private static string _path = $"{Path.Combine(Application.persistentDataPath, nameof(PlayerData))}.json";
private string Path
{
get
{
// save closer to assets when in editor
// more accessible
string directory = Application.isEditor ? Application.dataPath : Application.persistentDataPath;

return $"{System.IO.Path.Combine(directory, nameof(PlayerData))}.json";
}
}

/// <summary>
/// Singleton instance.
/// </summary>
public static PlayerData Instance { get; private set; } = new PlayerData();

private bool FileExists => File.Exists(_path);
private bool FileExists => File.Exists(Path);

/// <summary>
/// Loads Data when runtime starts.
Expand All @@ -41,26 +51,26 @@ private void LoadData()
return;
}

using (FileStream fs = new FileStream(_path, FileMode.Open, FileAccess.Read))
using (FileStream fs = new FileStream(Path, FileMode.Open, FileAccess.Read))
using (StreamReader sr = new StreamReader(fs))
{
string rawJson = sr.ReadToEnd();

Instance = JsonConvert.DeserializeObject<PlayerData>(rawJson);

Debug.Log($"{nameof(PlayerData)} loaded from path {_path}.");
Debug.Log($"{nameof(PlayerData)} loaded from path {Path}.");
}
}

private void SaveData()
{
// create file
using (FileStream fs = new FileStream(_path, FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream fs = new FileStream(Path, FileMode.OpenOrCreate, FileAccess.Write))
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine(JsonConvert.SerializeObject(Instance));

Debug.Log($"{nameof(PlayerData)} saved at path {_path}.");
Debug.Log($"{nameof(PlayerData)} saved at path {Path}.");
}
}

Expand Down