Unity3D SmartFoxClient.dll and LoginGUI.cs examples for MMO

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

Moderators: Lapo, Bax

aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

Unity3D SmartFoxClient.dll and LoginGUI.cs examples for MMO

Postby aiaustin » 19 May 2011, 19:23

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.
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

Postby aiaustin » 20 May 2011, 09:50

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?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 May 2011, 07:20

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
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

1.2.7 -> 2.X

Postby aiaustin » 24 May 2011, 09:08

Thanks Thomas, I will look at changing the SmartFox server I am trying from 1.x to 2.x.
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

SFS2X Unity3D Examples and Conversion from SFS1.x

Postby aiaustin » 25 May 2011, 07:43

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.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 25 May 2011, 10:28

Ouch - thanks!!

Will get that fixed

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 21 guests