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

steffjm
Posts: 6
Joined: 12 Mar 2018, 09:23

unity webgl connect to smartfoxserver TRIS example

Postby steffjm » 12 Mar 2018, 21:57

hi,
sorry for my english.

I need compil for webgl in unity.
this ok but in the example TRIS , I can't connect to smartfoxserver. the application start well with panel connection but
127.0.0.1 and ip server adress not works
webgl application and samrtfoxserver are on the same computer.

it works well when i compil for standalone application

how can i do this for webgl please ?

thanks
User avatar
Lapo
Site Admin
Posts: 20044
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
steffjm
Posts: 6
Joined: 12 Mar 2018, 09:23

Re: unity webgl connect to smartfoxserver TRIS example

Postby steffjm » 13 Mar 2018, 13:26

hi, I did open ports in firewall to 9933,8080,8443,8884

in the example tris detect webgl and assign 8080 websocket

i have the same problem with example 01 connector.

I don't have put example webgl in SFS2X folder, only in www root site , right ?

i'm using SFS2X 2.13.1

I'm using bitnami to have php mysql and apache. i put example compiled in htdocs ( www of apache )
thanks for help me
sorry for my bad english
User avatar
Bax
Site Admin
Posts: 4385
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
steffjm
Posts: 6
Joined: 12 Mar 2018, 09:23

Re: unity webgl connect to smartfoxserver TRIS example

Postby steffjm » 14 Mar 2018, 10:00

it didn't works in editor but editor is not on server and i have put ip server not 127.0.0.1 but websocket is really 8080
do i try install unity3d on server to test ?

thanks for your help
User avatar
Bax
Site Admin
Posts: 4385
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
steffjm
Posts: 6
Joined: 12 Mar 2018, 09:23

Re: unity webgl connect to smartfoxserver TRIS example

Postby steffjm » 14 Mar 2018, 12:16

in standalone it works well but it use tcp 9933
may i do a mistake
i have server 12 r2
iis installed and websocket enabled in option of iis
firewall have ports open 9933,8080,8443,8843

i had try with iis, bitnami, mamp
but nothing works
i'm sure i do something wrong
i'm not expert in server
User avatar
Bax
Site Admin
Posts: 4385
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
steffjm
Posts: 6
Joined: 12 Mar 2018, 09:23

Re: unity webgl connect to smartfoxserver TRIS example

Postby steffjm » 14 Mar 2018, 14:18

I have reinstalled server 12
no iis installed
i did any change on sfx.
just install 2.13.0 and update to 2.13.1
and install sfx admintool
IP 93.115.96.127

testing standalone ok (joind printscreen),

test webgl don't works

Image

Image
thanks a lot
User avatar
Bax
Site Admin
Posts: 4385
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
steffjm
Posts: 6
Joined: 12 Mar 2018, 09:23

Re: unity webgl connect to smartfoxserver TRIS example

Postby steffjm » 14 Mar 2018, 14:54

yes it's working..

i did see this tab but switch is too small and i din't see it not very well
thanks a lot for you help
have a good day !

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 1 guest