Problem about unity 5 WebGL build

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

Moderators: Lapo, Bax

Post Reply
PatrickActivate
Posts: 4
Joined: 25 May 2015, 02:46

Problem about unity 5 WebGL build

Post by PatrickActivate »

Hi, i have a project uses smartfoxserver 2x, previously the project is build based on WebPlayer platform, everything works perfectly, recently my boss ask me to port the project to WebGL, here came the problem.

I tried to:

Updated unity from 5.0.0 to 5.0.2f1

Updated the server api from 2.9 to 2.10

Reconfigured the SmartFoxServer by using admin tool: activated the WebSocket Protocol under "HTML5 WebSockets" tab, and made sure the port is 8888.

Updated c# client api to 1.6.0:
-Replaced the old SmartFox2x.dll with the SmartFox2x.dll located in "Unity" folder, set the plugin platform to all platform except WebGL.
-Created a new folder named "WebGL" and put "SmartFox2x.dll" and "SFSWebSockets.jslib" into the folder, and then set the two files's platform to WebGL.
-Changed the smartfox object constructor from "new SmartFox ()" to "new SmartFox (Sfs2X.Util.UseWebSocket.WS)".
-Changed the connection port to 8888.

then i built the project, output it as WebGL files, put to the webserver, then tried to run.

When i clicked login button in my client application, this error occurs in the web console: "WebSocket connection to 'ws://175.138.67.209:8888/websocket' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED , [SFS - ERROR] [WebSocketLayer] Connection error: Abnormal disconnection.".

then i tired to click again, this error prompt out on the top of browser: "Uncaught RangeError: Maximum call stack size exceeded", then i check the web console, this error occurs " exception thrown: RangeError: Maximum call stack size exceeded,RangeError: Maximum call stack size exceeded".

can anyone help me? i need to solve this issue urgently, thanks.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem about unity 5 WebGL build

Post by Lapo »

Hi,
the first thing that comes to mind is that port 8888 is not open to the world.
In fact if you try to telnet it, it won't respond. Sounds like a firewall problem :)

Make sure it's open and reachable from outside.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
PatrickActivate
Posts: 4
Joined: 25 May 2015, 02:46

Re: Problem about unity 5 WebGL build

Post by PatrickActivate »

asked my colleague to check the 8888 port on the server, and enabled it, it works, thanks for the reply :D
Post Reply