Ethereum Unity3D Boilerplate Questions

cool.

To fix the Pink sword and chest In Unity go to Edit -> Render Pipeline -> Universal Render Pipeline -> Upgrade Project Materials to UniversalRP Materials

thanks for the tip, already done that but these objects dont want to upgrade. Its cool tho. the focus is on the wallet!

1 Like

I don’t see any WalletTokenController script, is it the TokenListController ?
thanks again for the amazing support.

1 Like

Hey, when you upgrade project materials to URP, select the folder that the sdk is in and reimport it, this should fix the pink sword and chest

1 Like

yes, sorry was answering from memory :smiley:

1 Like

Getting below error for unknown reasons, please help figure out.

Server log error:
2022-02-18T12:33:28.495Z - Error: Signing message has expired.
at /moralis-server/lib/Adapters/Auth/moralisEth.js:48:13
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 0)
2022-02-18T12:33:26.010Z - Error: Invalid session token
at Object.getAuthForSessionToken (/moralis-server/lib/Auth.js:114:11)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Hello are all the variable referenced for the wallect connect and Ui panel,
is the user able to login ?

The error is caused when login fails.

This makes me suspect the message you are sending is not signed properly.

There was an update with v1.0.5 that added server time to the message being signed by the wallet. Make sure you have this update (or newer).

Also make sure your Moralis Server is up-to-date.

Hi there !
Thanks a lot for the amazing work!
Managed to setup the demo scene.

Authentification is working nicely on desktop (with the QR code) but it doesnt on mobile (android):
I click authenticate -> Connect to Wallet -> Opens imtoken or trust wallet -> request to connect the wallet -> I click allow -> I go back to the game -> it asks to reopen imtoken -> “sign & verify message” -> confirm -> I go back to the game /// and nothing happens, it’s stuck on the “connect to wallet” UI and can repeat these steps indefinitely.

Any ideas where it could come from ? No error on the server.
thanks again guys !

1 Like

I did get the latest version which has server time signed in and servers were newly created. Have been trying with all server types but the result is the same. I do get the signature request on trust wallet and as soon as I press ok this error pops up. Stuck here.

1 Like

That is odd, I have not seen this on Android.

In Build Setting check Development Build and try again. If it still fails use Android Studio to try to debug.

Also what version of Unity are you using?

1 Like

Please capture the console log for logs before the error. Include lines from “Wallet connection received” through the error. Post this block of logs. Thank you

checked Development Build but same issue!
I’m using unity 2020.3.23

Hi, David.

Do you by chance have any updates on this? Very interested in being able to give users the option to use MetaMask browser plugin.

Thanks!

1 Like

Please check this. It seems it is failing to get server time from Moralis.

This is the part of the code which was provided in the new release.

// Retrieve server time from Moralis Server for message signature
Dictionary<string, object> serverTimeResponse = await MoralisInterface.GetClient().Cloud.RunAsync<Dictionary<string, object>>(“getServerTime”, new Dictionary<string, object>());

    if (serverTimeResponse == null || !serverTimeResponse.ContainsKey("dateTime") ||
        !long.TryParse(serverTimeResponse["dateTime"].ToString(), out serverTime))
    {
        Debug.Log("Failed to retrieve server time from Moralis Server!");
    }

    Debug.Log($"Sending sign request for {address} ...");
1 Like

can you check if there is an error, development build usually show all the errors the app encountered and you can also use android studio to try to debug it and also try unity remote

can you check your moralis logs to see if there is any errors, and i see the signature got through , is the error breaking any part of the code ?

you mean for build on webgl, @dgoodrich is currently working on this

Server logs were shared in my OG post.

Server log error:
2022-02-18T12:33:28.495Z - Error: Signing message has expired.
at /moralis-server/lib/Adapters/Auth/moralisEth.js:48:13
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 0)
2022-02-18T12:33:26.010Z - Error: Invalid session token
at Object.getAuthForSessionToken (/moralis-server/lib/Auth.js:114:11)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)

idk, is your pc time correct ? can you check this, if it is try to get the sdk again and test out the demo scene