Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in Unity #21

Open
pickmeup101 opened this issue Aug 15, 2018 · 34 comments
Open

Errors in Unity #21

pickmeup101 opened this issue Aug 15, 2018 · 34 comments

Comments

@pickmeup101
Copy link

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 pickmeup101 changed the title Errors when using in unity Errors when using in Unity Aug 15, 2018
@pickmeup101 pickmeup101 changed the title Errors when using in Unity Errors in Unity Aug 15, 2018
@sacOO7
Copy link
Owner

sacOO7 commented Aug 15, 2018

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

  1. SocketCluster for Unity3D #4
  2. dotnet 3.5 support unity 5 #15

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

@sacOO7
Copy link
Owner

sacOO7 commented Aug 15, 2018

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
Copy link
Owner

sacOO7 commented Aug 16, 2018

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

@pickmeup101
Copy link
Author

@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
Copy link
Owner

sacOO7 commented Aug 16, 2018

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
Copy link
Owner

sacOO7 commented Aug 16, 2018

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
Copy link
Author

pickmeup101 commented Aug 16, 2018

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
Copy link
Author

pickmeup101 commented Aug 16, 2018

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

@sacOO7
Copy link
Owner

sacOO7 commented Aug 16, 2018

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
Copy link
Owner

sacOO7 commented Aug 16, 2018

Need to reproduce on my local env.

@pickmeup101
Copy link
Author

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

@sacOO7
Copy link
Owner

sacOO7 commented Aug 17, 2018

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
Copy link
Author

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
Copy link
Author

pickmeup101 commented Aug 18, 2018

@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
Copy link
Owner

sacOO7 commented Aug 18, 2018 via email

@pickmeup101
Copy link
Author

pickmeup101 commented Aug 19, 2018

@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
Copy link
Owner

sacOO7 commented Aug 19, 2018 via email

@pickmeup101
Copy link
Author

pickmeup101 commented Aug 19, 2018

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

@sacOO7
Copy link
Owner

sacOO7 commented Aug 19, 2018 via email

@pickmeup101
Copy link
Author

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
Copy link
Owner

sacOO7 commented Aug 19, 2018

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

@pickmeup101
Copy link
Author

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
Copy link
Owner

sacOO7 commented Aug 20, 2018

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
Copy link
Owner

sacOO7 commented Aug 20, 2018

It also seems an old issue... #4

@sacOO7
Copy link
Owner

sacOO7 commented Aug 20, 2018

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

@pickmeup101
Copy link
Author

pickmeup101 commented Aug 20, 2018

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
Copy link
Owner

sacOO7 commented Aug 22, 2018

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

@pickmeup101
Copy link
Author

@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
Copy link
Owner

sacOO7 commented Sep 9, 2018

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

@sacOO7
Copy link
Owner

sacOO7 commented Sep 9, 2018

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

@pickmeup101
Copy link
Author

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
Copy link

Hi,

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

Thanks

@pickmeup101
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants