Code Monkey home page Code Monkey logo

Comments (22)

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

@Khaldi-Anouar Thanks for your report. Our team will see if this is something we can fix or maybe is a Unity 2021.3 bug.

from unity-web3-game-kit.

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?

from unity-web3-game-kit.

Khaldi-Anouar avatar Khaldi-Anouar commented on June 12, 2024

@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?

Hello, I tried with unity 2021.3.8f1 (Empty project with moralis), it doesn't work
can you try on different browsers please?

from unity-web3-game-kit.

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

Which browser are you using? Does the introduction scene work?

from unity-web3-game-kit.

Khaldi-Anouar avatar Khaldi-Anouar commented on June 12, 2024

@KoenRijpstra yeah everything works fine until I click on connect and I sign with Metamask
this is the build link https://crimin.itch.io/newmoralis

from unity-web3-game-kit.

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

Which browser are you testing on?

from unity-web3-game-kit.

Khaldi-Anouar avatar Khaldi-Anouar commented on June 12, 2024

More than one browser! chrome, opera, edge, brave, in some computers it's working on them all, is some computers it working only in some of them, in some computers it doesn't work on all of them

from unity-web3-game-kit.

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

@Khaldi-Anouar We tested on multiple browser and can't replicate the issue. If it is working on some computers and not on others what is the difference between those computers?

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

Same problem:
https://forum.moralis.io/t/unity-moralis-v1-2-7-unauthorized-problem/19297/10
I am using Unity 2021.3.9f1 (latest stable) and i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. How can i fix?
Note: I am trying on Unity Editor.
image

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?

I installed 2021.3.8f1 and tried with moralis v1.2.7 sdk on Unity Editor. But it's not working. Wallet cannot connect.
image

from unity-web3-game-kit.

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard:
image

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard: image
I am using v0.0.385 server version. Also, i tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).

from unity-web3-game-kit.

Khaldi-Anouar avatar Khaldi-Anouar commented on June 12, 2024

@newbiedev1 same like you version, my version is v0.0.385

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard: image
I am using v0.0.385 server version. Also, i tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).

Unity version: 2021.3.8f1
Moralis SDK version: v1.2.7
Server version: v0.0.385
i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. I have no problem with moralis v1.1.0 sdk.

image
image
image

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

Isn't there a solution?

from unity-web3-game-kit.

xactant avatar xactant commented on June 12, 2024

At this time we have tried every combination given to us and we have not been able to replicate this issue.

Please do this:

  1. Open your project in Visual Studio.
  2. In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
  3. Go to line 60 Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
  4. Go to line 60: Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
  5. Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers)
            { 
                Debug.Log($"{kvp.Key}: {kvp.Value}");
            }

5a. If the Debug is not found, add a using UnityEngine; statement at the top of the file.
6. Run the app.
7. At authentication, if you receive the error, check the Console log.
8. If the headers were logged, please copy these as TEXT and post them in a new comment.
9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.

Thank you.

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

At this time we have tried every combination given to us and we have not been able to replicate this issue.

Please do this:

  1. Open your project in Visual Studio.
  2. In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
  3. Go to line 60 Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
  4. Go to line 60: Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
  5. Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers)
            { 
                Debug.Log($"{kvp.Key}: {kvp.Value}");
            }

5a. If the Debug is not found, add a using UnityEngine; statement at the top of the file. 6. Run the app. 7. At authentication, if you receive the error, check the Console log. 8. If the headers were logged, please copy these as TEXT and post them in a new comment. 9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.

Thank you.

Thank you for reply. Debug.log:

Content-Type: application/json
UnityEngine.Debug:Log (object)
MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisCommandRunner.cs:64) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1<System.Tuple2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:114)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

image

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

I tested Unity 2021.3.3f1, 2021.3.4f1, 2021.3.8f1, 2021.3.9f1, 2020.3.0f1. Also, i used moralis sdk 1.2.5 and 1.2.7. Same error on all of them. But , i have tested with moralis old sdk (v1.1.0) and unity 2021.3.9f1, there is no problem. Wallet connection is working.

First error:
Target: https://dhwor46zhuia.usemoralis.com:2053/server/users
UnityEngine.Debug:LogError (object)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:87)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

Second error:
Error: HTTP/1.1 403 Forbidden
{"error":"unauthorized"}
UnityEngine.Debug:LogError (object)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:88)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

Warning error:
LogInAsync failed: {"error":"unauthorized"}
UnityEngine.Debug:Log (object)
MoralisUnity.Platform.Services.ClientServices.MoralisUserService1/<LogInAsync>d__19<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisUserService.cs:106) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.ClientServices.MoralisUserService1/<LogInAsync>d__19<MoralisUnity.Platform.Objects.MoralisUser>, MoralisUnity.Platform.Objects.MoralisUser>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21) Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1<System.Tuple2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisCommandRunner.cs:88) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1<System.Tuple2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:114)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

Third error:
NullReferenceException: Object reference not set to an instance of an object
MoralisUnity.Platform.Services.ClientServices.UserServiceExtensions.LogInWithAsync[TUser] (MoralisUnity.Platform.Abstractions.IServiceHub1[TUser] serviceHub, System.String authType, System.Collections.Generic.IDictionary2[TKey,TValue] data, System.Threading.CancellationToken cancellationToken) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UserServiceExtensions.cs:202)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342) MoralisUnity.MoralisClient.LogInAsync (System.Collections.Generic.IDictionary2[TKey,TValue] data, System.Threading.CancellationToken cancellationToken) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/MoralisClient.cs:221)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342) MoralisUnity.Moralis.LogInAsync (System.Collections.Generic.IDictionary2[TKey,TValue] authData, System.Int32 chainId) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Moralis.cs:320)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342)
MoralisUnity.Kits.AuthenticationKit.AuthenticationKit.WalletConnect_SignAndLoginToMoralis (WalletConnectSharp.Unity.WalletConnectUnitySession session) (at Packages/io.moralis.web3-unity-sdk/Runtime/Kits/AuthenticationKit/Scripts/AuthenticationKit.cs:387)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <6073cf49ed704e958b8a66d540dea948>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)

from unity-web3-game-kit.

newbiedev1 avatar newbiedev1 commented on June 12, 2024

At this time we have tried every combination given to us and we have not been able to replicate this issue.

Please do this:

  1. Open your project in Visual Studio.
  2. In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
  3. Go to line 60 Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
  4. Go to line 60: Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
  5. Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers)
            { 
                Debug.Log($"{kvp.Key}: {kvp.Value}");
            }

5a. If the Debug is not found, add a using UnityEngine; statement at the top of the file. 6. Run the app. 7. At authentication, if you receive the error, check the Console log. 8. If the headers were logged, please copy these as TEXT and post them in a new comment. 9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.

Thank you.

Are there any solution 🙂

from unity-web3-game-kit.

Khaldi-Anouar avatar Khaldi-Anouar commented on June 12, 2024

Hello @xactant
I tried what you ask then I took a WebGL build, the headers are correct in both devices (device A where we can and device B where we can't login)
both of them are giving the same debugs, but when I check the headers, there's some missing parameters x-parse-installation-id and x-parse-application-id
This is the device A (or browser A) no missing headers:
NoError
This is the device B (or browser B) with missing headers
WithError

from unity-web3-game-kit.

KoenRijpstra avatar KoenRijpstra commented on June 12, 2024

@Khaldi-Anouar Does this only happen with users on Turkish networks?

from unity-web3-game-kit.

stale avatar stale commented on June 12, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from unity-web3-game-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.