unity webgl connect to smartfoxserver TRIS example

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: unity webgl connect to smartfoxserver TRIS example

Postby Lapo » 13 Mar 2018, 09:29

Hi,
there can be a number of reasons for the problem you've reported.
You may need to activate WebSockets on the server side, for example.

Also, the websocket port is by default 8080, but the example is probably using port 9933, which will not work for websockets.

What SFS2X version are you running?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: unity webgl connect to smartfoxserver TRIS example

Postby Bax » 14 Mar 2018, 08:20

Is the Connector example working inside the Unity Editor? I mean after switching the platform to WebGL in the Build Settings panel.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: unity webgl connect to smartfoxserver TRIS example

Postby Bax » 14 Mar 2018, 11:02

Are you sure web socket is enabled on the server?
If yes, then something must be blocking communication with the server. In fact you can't connect using the Unity Editor too.
What if you switch to standalone build and run the Connector in the Editor? Does it connect to SFS?
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: unity webgl connect to smartfoxserver TRIS example

Postby Bax » 14 Mar 2018, 13:29

I think you should get rid of IIS for the moment.
You should just install SFS2X 2.13 on your server and see if you can connect to it from your development environment (so the Unity Editor).
Deploying the build to a web server (like IIS or other) comes later.
In the Unity's Build Settings panel, choose "standalone" platform. Then just hit the play button, enter your server address and click the connect button. If that works (can you show a screenshot?), then change the Build Settings to the WebGL platform and try again. If now it doesn't work, then maybe SFS is misconfigured? Did you change anything?

Is your server publicly available? If yes, please send us an email with its IP address, so we can check if we can connect to it.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: unity webgl connect to smartfoxserver TRIS example

Postby Bax » 14 Mar 2018, 14:39

Please check the Admin Tool > Server Configurator module > Web server tab.
Make sure the Enable WS/WSS switch is active.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 24 guests