Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Does this work with Unity3D? #4

Open
bcjordan opened this issue Jan 18, 2019 · 13 comments
Open

Does this work with Unity3D? #4

bcjordan opened this issue Jan 18, 2019 · 13 comments

Comments

@bcjordan
Copy link

Would love docs on this if it's possible (would be happy to contrib docs on it if someone has steps for it!)

@cmuentes
Copy link
Contributor

That's a great question! We honestly haven't tried it in Unity, we were using it for a microservice we were building for one of our products. Try it and let us know!

@cmuentes
Copy link
Contributor

@bcjordan ☝️

@HugoZenitConcept
Copy link

HugoZenitConcept commented Jan 21, 2019

I've tested this morning.

You need a version of Unity that supports .NET 4.x. You also need to copy System.Net.Http.dll into your project.

When it connects, it seems to be truncating the room name so it can't properly connect.

I'll test further later today.

P.S. : Also needed to add Newtonsoft.Json.dll to the project

@bcjordan
Copy link
Author

Very cool, thanks @cmuentes. It's possible this will become one of the most reliable Socket.io plugins for Unity, could lead to quite a bit of usage and cool projects coming out of it. I had found workarounds to make some others work but each had significant drawbacks. May be worth putting together a Unity Asset Store package to make install easy!

@cmuentes
Copy link
Contributor

cmuentes commented Jan 21, 2019

I've tested this morning.

You need a version of Unity that supports .NET 4.x. You also need to copy System.Net.Http.dll into your project.

When it connects, it seems to be truncating the room name so it can't properly connect.

I'll test further later today.

P.S. : Also needed to add Newtonsoft.Json.dll to the project

@HugoZenitConcept ibm.socket-io.client has a reference to Newtonsoft.Json.dll. Is the project correctly restoring on your machine? Let me know what you find with the room name. Also what version of socket.io you tested against (I've tested this library against 2.1.1 and wrote unit tests accordingly for that version).

image

@cmuentes
Copy link
Contributor

Very cool, thanks @cmuentes. It's possible this will become one of the most reliable Socket.io plugins for Unity, could lead to quite a bit of usage and cool projects coming out of it. I had found workarounds to make some others work but each had significant drawbacks. May be worth putting together a Unity Asset Store package to make install easy!

@bcjordan I will look into this for sure. I realized after getting approval from IBM to release this project that there seems to be a need among Unity projects. Please share if you can; thanks!

@HugoZenitConcept
Copy link

Very cool, thanks @cmuentes. It's possible this will become one of the most reliable Socket.io plugins for Unity, could lead to quite a bit of usage and cool projects coming out of it. I had found workarounds to make some others work but each had significant drawbacks. May be worth putting together a Unity Asset Store package to make install easy!

@bcjordan I will look into this for sure. I realized after getting approval from IBM to release this project that there seems to be a need among Unity projects. Please share if you can; thanks!

It sure is nice but the need for .NET 4.x is gonna be a deal breaker for a lot of Unity devs.

I am getting an error with the room request (SocketMediator.cs around line 150) about not receiving the response. On the server side, I'm getting a socket.io parser error. This is with version 2.2.0. I'll test with 2.1.1 when I have some spare time.

@bcjordan
Copy link
Author

I think Unity will be moving towards 4.x in the not-too-distant-future (e.g. looks like you can select it in 2018.x), so even if it's not possible to get this going under 3.5 it could still grow in to being the go-to!

@Domihk
Copy link

Domihk commented Feb 13, 2019

I have landed here looking all around about using sockets in Unity and this looks so promising!

Has anyone been capable of run it? Or tested selecting the .Net 4.x in the 2018 Unity versions as bcjordan suggested?

It seems that previous versions of Unity can run Net 4.x (just a click) as indicated here: https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017

I think Unity will be moving towards 4.x in the not-too-distant-future (e.g. looks like you can select it in 2018.x), so even if it's not possible to get this going under 3.5 it could still grow in to being the go-to!

@AugusDogus
Copy link

Just curious if you were ever able to do some more tests @HugoZenitConcept

@HugoZenitConcept
Copy link

Just curious if you were ever able to do some more tests @HugoZenitConcept

Hi!

We ended up switching to https://github.com/sta/websocket-sharp

@cyraid
Copy link

cyraid commented Oct 6, 2019

Unity is working on a DOTS version Netcode. It should be production ready sometime next year (possibly Q3?). If you're just starting with it and plan on releasing your game on or later than Q3 2020, you can work with it while it changes.

Blog: https://blogs.unity3d.com/2019/06/13/navigating-unitys-multiplayer-netcode-transition/
Github: https://github.com/Unity-Technologies/multiplayer

@akashagarwal7
Copy link

Hi @HugoZenitConcept, I have been using the same library that you mentioned. Unfortunately on Windows 10 Pro, I get issues with delays between socket messages (usually about 5s delay). Have you faced something similar?

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

No branches or pull requests

7 participants