sacOO7 / SocketclusterClientDotNet

C# client for socketcluster framework in node.js

Home Page:http://socketcluster.io/#!/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors in Unity

pickmeup101 opened this issue · 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.

Hi @pickmeup101 , will look into it 👍 .
Meanwhile this will help you

  1. #4
  2. #15

Please go through those issues. You will find useful information for sure 👍

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.

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

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

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 ..

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.

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.

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

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.

Need to reproduce on my local env.

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

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 👍 .

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 :)

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

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

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.

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

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.

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.

It also seems an old issue... #4

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

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?

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

@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

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

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

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!

Hi,

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

Thanks

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

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.