这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 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
3080de3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 8, 2023
87a1dcc
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 8, 2023
f25d202
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 9, 2023
300d906
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 14, 2023
f28d9f4
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 16, 2023
ab26fa3
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 17, 2023
c5c0cb4
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 17, 2023
a1671d7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 20, 2023
a4755d1
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 21, 2023
6ca4ea7
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 21, 2023
07cee0a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 22, 2023
f2bb351
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 23, 2023
b064568
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 23, 2023
02606c0
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 23, 2023
6644661
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Nov 27, 2023
93e8fbe
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 6, 2023
5881543
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 7, 2023
a2cdc0e
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 11, 2023
9765f8d
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 11, 2023
fc7269a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 12, 2023
0fe7628
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 12, 2023
bba537e
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 13, 2023
9930e97
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 13, 2023
1f1d439
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 14, 2023
da2418a
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Dec 15, 2023
8a5be99
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Jan 18, 2024
cea3e2b
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Jan 18, 2024
718bf99
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Jan 29, 2024
89f11bf
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Jan 30, 2024
916dca1
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Feb 1, 2024
a9a20bc
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Feb 7, 2024
cd514db
made main package testable, revert due to a mistake
robGG1997 Feb 7, 2024
3428344
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Feb 8, 2024
d2e7533
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Feb 8, 2024
7acb12d
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Mar 11, 2024
b6337a6
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Apr 1, 2024
c386de9
Merge branch 'main' of https://github.com/ChainSafe/web3.unity
robGG1997 Apr 2, 2024
f3638c9
Sign verify and WebGL login logout issue fixed for metamask
robGG1997 Apr 8, 2024
0b4e613
Merge branch 'dev' into rob/metamask-sdk-fixes
rob1997 Apr 9, 2024
8fe4479
Merge branch 'dev' into rob/metamask-sdk-fixes
rob1997 Apr 9, 2024
32b941d
Merge branch 'dev' into rob/metamask-sdk-fixes
kantagara Apr 12, 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 @@ -131,7 +131,7 @@ public static async Task<bool> SignVerify(Web3 web3, string message)
var msgHash = new Sha3Keccack().CalculateHash(Encoding.UTF8.GetBytes(msg));
var signature = MessageSigner.ExtractEcdsaSignature(signatureString);
var key = EthECKey.RecoverFromSignature(signature, msgHash);
return key.GetPublicAddress() == playerAccount;
return key.GetPublicAddress().ToLower() == playerAccount.ToLower();
}

public static string EcdsaSignTransaction(string _privateKey, string _transaction, string _chainId)
Expand Down
10 changes: 9 additions & 1 deletion src/ChainSafe.Gaming.MetaMask.Unity/MetaMaskProvider.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Threading.Tasks;
using ChainSafe.Gaming.Web3;
using ChainSafe.Gaming.Web3.Analytics;
using ChainSafe.Gaming.Web3.Core.Logout;
using ChainSafe.Gaming.Web3.Environment;
using UnityEngine;
using Object = UnityEngine.Object;
Expand All @@ -10,7 +11,7 @@ namespace ChainSafe.Gaming.MetaMask.Unity
/// <summary>
/// Concrete implementation of <see cref="IMetaMaskProvider"/>.
/// </summary>
public class MetaMaskProvider : IMetaMaskProvider
public class MetaMaskProvider : IMetaMaskProvider, ILogoutHandler
{
private readonly ILogWriter logWriter;

Expand Down Expand Up @@ -86,5 +87,12 @@ public async Task<T> Request<T>(string method, params object[] parameters)
{
return await metaMaskController.Request<T>(method, parameters);
}

public Task OnLogout()
{
Object.Destroy(metaMaskController.gameObject);

return Task.CompletedTask;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ChainSafe.Gaming.Web3.Build;
using ChainSafe.Gaming.Web3.Core.Logout;
using Microsoft.Extensions.DependencyInjection;

namespace ChainSafe.Gaming.MetaMask.Unity
Expand All @@ -18,7 +19,7 @@ public static IWeb3ServiceCollection UseMetaMask(this IWeb3ServiceCollection col
collection.AssertServiceNotBound<IMetaMaskProvider>();

// wallet
collection.AddSingleton<IMetaMaskProvider, MetaMaskProvider>();
collection.AddSingleton<ILogoutHandler, IMetaMaskProvider, MetaMaskProvider>();

return collection;
}
Expand Down