sacOO7 / SocketclusterClientDotNet

C# client for socketcluster framework in node.js
http://socketcluster.io/#!/
Apache License 2.0
69 stars 16 forks source link

Errors in Unity #21

Open pickmeup101 opened 6 years ago

pickmeup101 commented 6 years ago

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.

sacOO7 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

pickmeup101 commented 6 years ago

@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?

sacOO7 commented 6 years ago

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 commented 6 years ago

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.

pickmeup101 commented 6 years ago

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 commented 6 years ago

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

sacOO7 commented 6 years ago

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 commented 6 years ago

Need to reproduce on my local env.

pickmeup101 commented 6 years ago

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

sacOO7 commented 6 years ago

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 πŸ‘ .

pickmeup101 commented 6 years ago

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 commented 6 years ago

@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!

sacOO7 commented 6 years ago

Sure 😌, will look into it.

On Aug 18, 2018 5:55 PM, "ζ¨θΆ…θΆŠ" notifications@github.com 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 .

pickmeup101 commented 6 years ago

@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?

sacOO7 commented 6 years ago

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, "ζ¨θΆ…θΆŠ" notifications@github.com 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 .

pickmeup101 commented 6 years ago

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

sacOO7 commented 6 years ago

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, "ζ¨θΆ…θΆŠ" notifications@github.com 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 .

pickmeup101 commented 6 years ago

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.

sacOO7 commented 6 years ago

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

pickmeup101 commented 6 years ago

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.

sacOO7 commented 6 years ago

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 commented 6 years ago

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

sacOO7 commented 6 years ago

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

pickmeup101 commented 6 years ago

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?

sacOO7 commented 6 years ago

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

pickmeup101 commented 6 years ago

@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

sacOO7 commented 6 years ago

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

sacOO7 commented 6 years ago

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

pickmeup101 commented 6 years ago

Sure, I am using the client without https now. It's OK for developing. New issues will be reported here if I found. :) Thank you very much!

BrittMcDanel commented 5 years ago

Hi,

I posted in the socketcluster repo, but would it be possible to get a readymade dll?

Thanks

pickmeup101 commented 5 years ago

Hello Sachin, problem found. :) When the message is bigger than about 300KB, the client will not receive it. Will you please check it out? Thank you! @sacOO7

pickmeup101 commented 5 years ago

Hello Sachin, problem found. :) When the message is bigger than about 300KB, the client will not receive it. Will you please check it out? Thank you! @sacOO7

Find the reason, the server runs out of memory and causes the service restart, so the client can't receive the data. Not the client's problem.