SocketclusterClientDotNet icon indicating copy to clipboard operation
SocketclusterClientDotNet copied to clipboard

Errors in Unity

Open pickmeup101 opened this issue 7 years ago β€’ 34 comments

Installing from nuget, the ScClient namespace is available in the C# environment and compiles success in the Visual Studio. But when run in the Unity, error occurs: "Assets/Scripts/GameManager.cs(8,7): error CS0246: The type or namespace name `ScClient' could not be found. Are you missing an assembly reference?"

I have goooogled a lot, but still can't resolve it. But there's something useful messages: The unity doesn't support the DLL well, the DLL should be copy to Unity's assets Plugins folder. I follow the step, but still get the following error info: "Unloading broken assembly Assets/Plugins/ScClient.dll, this assembly can cause crashes in the runtime."

Any suggestions or if it possible to make a plugin to the Unity's asset store? It will be much easier to use in Unity.

pickmeup101 avatar Aug 15 '18 15:08 pickmeup101

Hi @pickmeup101 , will look into it πŸ‘ . Meanwhile this will help you

  1. https://github.com/sacOO7/SocketclusterClientDotNet/issues/4
  2. https://github.com/sacOO7/SocketclusterClientDotNet/issues/15

Please go through those issues. You will find useful information for sure πŸ‘

sacOO7 avatar Aug 15 '18 21:08 sacOO7

There is also a video link available in above issue discussions. There is a proper way to import DLLS in Unity engine. Please let me know if you need anything else. BTW, sorry for late reply.. Little busy those days.. :P.

sacOO7 avatar Aug 15 '18 21:08 sacOO7

Hi @pickmeup101, just a summarized link from above issues, https://www.youtube.com/watch?v=Wy4uu8lMEDA . This will surely help you πŸ‘

sacOO7 avatar Aug 16 '18 14:08 sacOO7

@sacOO7 Thanks for your advice! I have read all of the issues and watch the video, but still can't make it run. I am using Unity 2018.2.2f1 Personal (the newest version now) and .NET4.x runtime and "ScClient.Unity.0.1.0/lib/net46/ScClient.dll" (also tried other dll). And still got the error message: "Unloading broken assembly Assets/Plugins/ScClient.dll, this assembly can cause crashes in the runtime" Does it because of the software's version?

pickmeup101 avatar Aug 16 '18 15:08 pickmeup101

Maybe I need to download latest version of unity, I will try to reproduce the same on my local ... I think we have different releases available for .Net client (Not unity client). Try downloading previous version and try importing it ..

sacOO7 avatar Aug 16 '18 15:08 sacOO7

Or I need to upload proper .dll file in the repo ... I can see DLLs being uploaded on the github repository itself for unity based C# codes/clients.

sacOO7 avatar Aug 16 '18 15:08 sacOO7

Appreciated. I do really update all of the libs including Unity and .Net days ago. Maybe it's the problem. I will try different .Net clients.

pickmeup101 avatar Aug 16 '18 16:08 pickmeup101

Resolve it! I download the source files and compile to dll in my environment, and it works!

pickmeup101 avatar Aug 16 '18 16:08 pickmeup101

Ok great ✌️😌. Still I am not sure, why you need to use source files for compilation. You can just download library using nuget package. And the make dll out of it.

sacOO7 avatar Aug 16 '18 17:08 sacOO7

Need to reproduce on my local env.

sacOO7 avatar Aug 16 '18 17:08 sacOO7

@sacOO7 I am new to Unity and C#, I don't know why, but it works :) Thank you!

pickmeup101 avatar Aug 17 '18 04:08 pickmeup101

Just one final question @pickmeup101 , are you using source code of .Net client or Unity client. I would recommend Unity client source code...... Also, let me know if you face any problem πŸ‘ .

sacOO7 avatar Aug 17 '18 06:08 sacOO7

I am using Unity client. I have read all of the issues, one issue says that the .NET client has some problems when running in Android. I will tell you if have other problems :)

pickmeup101 avatar Aug 17 '18 14:08 pickmeup101

@sacOO7 Problem comes :) The Unity client can't connect to the server. It continually triggers the disconnect event. The server works well with js client. There are no other error messages or logs in the Server or Client, I don't know how to debug. Need your help!

pickmeup101 avatar Aug 18 '18 12:08 pickmeup101

Sure 😌, will look into it.

On Aug 18, 2018 5:55 PM, "ζ¨θΆ…θΆŠ" [email protected] wrote:

@sacOO7 https://github.com/sacOO7 Problem comes :) The Unity client can't connect to the server. It continually triggers the disconnect event. The server works well with js client. There are no other error messages, I don't know how to debug. Need your help!

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sacOO7/SocketclusterClientDotNet/issues/21#issuecomment-414054531, or mute the thread https://github.com/notifications/unsubscribe-auth/AP8vSSWYySNYDtaM7ev37MBBtDFOHqj2ks5uSAfDgaJpZM4V-SAQ .

sacOO7 avatar Aug 18 '18 15:08 sacOO7

@sacOO7 Find the reason! It works well with http but not https. Does the Unity client not support https yet? Or some config needed to work for https?

pickmeup101 avatar Aug 19 '18 16:08 pickmeup101

Hey, thanks for the help... It might be ssl certificate issue. Can you check if SSL certificate is valid from server. Also try disabling ssl certificate check from client side.

On Aug 19, 2018 9:42 PM, "ζ¨θΆ…θΆŠ" [email protected] wrote:

@sacOO7 https://github.com/sacOO7 Find the reason! It works well with http but not https. Does the Unity client not support https yet?

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sacOO7/SocketclusterClientDotNet/issues/21#issuecomment-414138000, or mute the thread https://github.com/notifications/unsubscribe-auth/AP8vSYXeR5WmHZ4eQcnHN5KIvJ7rhZ_1ks5uSY5ygaJpZM4V-SAQ .

sacOO7 avatar Aug 19 '18 16:08 sacOO7

I am using "self signed certificate", is it the problem? How to disable ssl certificate check from client side?

pickmeup101 avatar Aug 19 '18 16:08 pickmeup101

Yes, it should be problem. SSL certificate is supposed to be signed by trusted authorities. In the client, we have option to disable the certificate verification... You can try it out. Please read the last line in the README doc.

On Aug 19, 2018 10:04 PM, "ζ¨θΆ…θΆŠ" [email protected] wrote:

I am using "self signed certificate", is it the problem?

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sacOO7/SocketclusterClientDotNet/issues/21#issuecomment-414139417, or mute the thread https://github.com/notifications/unsubscribe-auth/AP8vSZl6pqpQNNJGygjSbaO8ncwrT9e5ks5uSZOdgaJpZM4V-SAQ .

sacOO7 avatar Aug 19 '18 17:08 sacOO7

Do you mean this config: "socket.SetSslCertVerification(false);" I tried to add this config, but still get the same error as without the config in https: It continually triggers disconnect event.

pickmeup101 avatar Aug 19 '18 17:08 pickmeup101

Yeah, it should have worked. Do you have server hosted on a specific domain? I can try it from here

sacOO7 avatar Aug 19 '18 17:08 sacOO7

Sorry, I am using it in the local environment. If needed, I will try to deploy it to a remote server. But actually, the server code is simple. It's the demo code from the SC's doc. I just open the SSL and give it a self-signed certificate. Nothing special.

pickmeup101 avatar Aug 19 '18 17:08 pickmeup101

Ok .... will look into it. It will be helpful if you can upload code on github. I can try cloning it, and then try reproducing the issue. Till then you can write code assuming http/ws connection.

sacOO7 avatar Aug 20 '18 07:08 sacOO7

It also seems an old issue... https://github.com/sacOO7/SocketclusterClientDotNet/issues/4

sacOO7 avatar Aug 20 '18 07:08 sacOO7

@pickmeup101 , keep watching the issue, I will post an update, once I find the fix...

sacOO7 avatar Aug 20 '18 07:08 sacOO7

Sure! Will keep watching it! Waiting for your good news! I will use HTTP for developing temporally.
I uploaded the code to GitHub, including the self-signed ca files, hope it will help :) https://github.com/pickmeup101/sc-test.git

And yes, it's quite the same with the #4 issue. So is it the problem of the websocket4net?

pickmeup101 avatar Aug 20 '18 16:08 pickmeup101

Might not be ... https/wss works for me on local console application... Still trying to reproduce the issue.

sacOO7 avatar Aug 22 '18 11:08 sacOO7

@sacOO7 Hello Sachin, another problem found, the Unity client seems not supporting the "WaitForAuth" parameter. Do I miss something or is it a bug? Here's the API doc, FYI: https://socketcluster.io/#!/docs/api-scchannel-client

pickmeup101 avatar Sep 02 '18 16:09 pickmeup101

Hi @pickmeup101 , yes it does not support WaitForAuth parameter. I will be adding that functionality soon.

sacOO7 avatar Sep 09 '18 14:09 sacOO7

Also, do let me know about your updates on the client. More issues are always welcome..

sacOO7 avatar Sep 09 '18 14:09 sacOO7