Unity3D crashing while SFS connection still active.

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

CrociDB
Posts: 2
Joined: 28 Mar 2011, 18:52

Unity3D crashing while SFS connection still active.

Postby CrociDB » 01 Apr 2011, 14:57

Hey,

I'm working on a webgame on Unity3D and I'm using SFS 1.6.9 for simple data transfer with my server. I had no problem developing on a Mac, but then when I tested my game on a PC running Windows 7, I noticed that the game crashes when I try to close my browser or leave that page when connection is still active. If I Disconnect from the server before leaving the game page, everything is fine.

I tried in some other machines with Windows 7 and all three major browsers for Windows (Chrome, Firefox and IE) and I still got the same problem. Sometimes it unfreezes after a while. Also ran a few tests with Flash and nothing weird happened.

I am catching the event of login and leaving (USER_LOST, USER_EXIT, ROOM_LOST, LOGOUT) on my extension. Am I doing anything wrong?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 02 Apr 2011, 00:20

Are you using the 1.2.7 plugin? Unity 2.x or 3.x?

(Unity 2.x has a very nasty way of handling socket close that is very often crashing the browser by random. Fixed in Unity 3)
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
CrociDB
Posts: 2
Joined: 28 Mar 2011, 18:52

Postby CrociDB » 04 Apr 2011, 14:14

3.x.

I did a little workaround catching the event of leaving the page on JavaScript and sending a message to unity to close the socket. That's working now, but I want to make that the right way.

What might I be doing wrong?

Thanks.

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 25 guests