Hello,
We have a legacy app that runs on Windows, Mac, and previously the Unty Webplayer. As we've been recently updating it, we've obviously deprecated the webplayer and have been working towards getting it working with WebGL.
Our SFS client connection code works and has been working. It even works in the Unity Editor when WebGL is the current active platform. When I attempt to connect when running the WebGL build through the browser (hosted on one of our test servers), it seems to hang without any error.
Originally it was trying to connect using the standard 9933 socket port, but I've seen attempted to utilize the ws/wss port instead with no luck.
I've attached some screen shots of what settings I have and what I'm seeing on my end.
WebGL Connection issue from Unity C#
WebGL Connection issue from Unity C#
- Attachments
-
- sfsWebServerSettings.png
- (17.41 KiB) Not downloaded yet
-
- sfsWebGL_ConnectionLog.png
- (61.29 KiB) Not downloaded yet
-
- sfsConnection_CodeSnipIt.png
- (52.67 KiB) Not downloaded yet
Re: WebGL Connection issue from Unity C#
Hi,
in order for the SFS2X client API to use websocket you need to call a specific constructor of the SmartFox class, which I don't see in your code snippets.
In short:
More details can be found in the API docs here:
http://docs2x.smartfoxserver.com/api-do ... 0f098f.htm
Are you using this?
Thanks
in order for the SFS2X client API to use websocket you need to call a specific constructor of the SmartFox class, which I don't see in your code snippets.
In short:
Code: Select all
var smartfox = new SmartFox(UseWebSocket.WS_BIN)
More details can be found in the API docs here:
http://docs2x.smartfoxserver.com/api-do ... 0f098f.htm
Are you using this?
Thanks
Re: WebGL Connection issue from Unity C#
Thanks Lapo! I'll give this a try, I'm pretty sure we aren't using that currently.
UPDATE:
Yep, that was it. I had to also upgrade our Client dll to 1.7.x to be able access that constructor since we were still on 1.5.x, but all it's connecting now! Thanks again.
UPDATE:
Yep, that was it. I had to also upgrade our Client dll to 1.7.x to be able access that constructor since we were still on 1.5.x, but all it's connecting now! Thanks again.
Who is online
Users browsing this forum: No registered users and 33 guests