Page 1 of 1

Unity3D SmartFoxClient.dll and LoginGUI.cs examples for MMO

Posted: 19 May 2011, 19:23
by aiaustin
I am using the SFS version of the Unity3D Island Demo which when a few lines are commented out works fine in SFS Server 1.5.5 Basic and 1.6.9 Pro. This has a SmartFoxClienrt.dll and LoginGUI.cs that seem to work. But in othere exmaples I have tried when I do a web build I get a problem connecting to the server. On looking round at forums and googling this others seem to have had the problem.. and they suggested a different SmartFoxClient.dll and a policy prefetch line of

Security.PrefetchSocketPolicy(serverIP, Convert.ToInt32(serverPort));

had to be added at the end of Awake() in LoginGUI.cs

This then worked to get a Simple MMO demo going. An example Forum entry on this is at

viewtopic.php?p=41732

BUT... when I try to replace the .dll with what looks like an identical version from the current Unity .net API download it crashes the browser.

Can SFS inform us of the definitive location for the correct SmartFoxClient.dll to use, and whether the policy prefetch line is required.

Posted: 20 May 2011, 09:50
by aiaustin
Thanks for moving the post to the more appropriate forum area. I see a number of comments about the web player fix over a long period. But can still not figure out which version we are officially meant to use. Can you advise?

I also see a great deal of sensitivity as I amend the IP number in LoginGUI.cs examples between a specific IP and 127.0.0.1 - sometimes it fails to connect JUST after such an edit. Or making the IP number a public variable so it shows and can be changed in the editor inspector also makes it fail to connect. Odd. Anyone else seeing such an issue?

Posted: 24 May 2011, 07:20
by ThomasLund
The unreleased 1.2.7 is the one to use with Unity 3+

If you do webplayer with that, then you have to prefetch the security policy. Also beware that things are very sensitive to closing down your connections properly - else Unity webplayer will crash around your ears.

All focus these days are on 2x in general though, so thats why there is so little traffic here.

/T

1.2.7 -> 2.X

Posted: 24 May 2011, 09:08
by aiaustin
Thanks Thomas, I will look at changing the SmartFox server I am trying from 1.x to 2.x.

SFS2X Unity3D Examples and Conversion from SFS1.x

Posted: 25 May 2011, 07:43
by aiaustin
Thomas. this is not quite the right place to report this. but as i test out SFS2X I note that one of the Unity3D examples has the old port 9339 in it rather than the new SFS2X default port of 9933. That threw me, as I was using the SFSTris example for my tests. The other two examples Connector and Lobby - already have the correct port in them when I checked. Thanks.

Posted: 25 May 2011, 10:28
by ThomasLund
Ouch - thanks!!

Will get that fixed

/Thomas