Connect to SFS with Javascript?

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

Moderators: Lapo, Bax

GoldFire33
Posts: 4
Joined: 06 Apr 2010, 04:31

Connect to SFS with Javascript?

Postby GoldFire33 » 06 Apr 2010, 04:38

I'm currently working on a project in Unity with Javascript, and I'd like to setup SFS to handle multiplayer. I've been using Javascript for years now, but I've never even touched C# so I would really rather not have to learn C# at this stage to make me entire game unless it is 100% necessary. Is there a way to connect to SFS using Javascript rather than C#? I've tried to rewrite the simple connection example from the API with Javascript, but it doesn't like the following:

Code: Select all

SFSEvent.onConnection += HandleConnection;


which I changed to:

Code: Select all

SFSEvent.onConnection = Delegate.Combine(HandleConnection);


and get the error: InvalidCastException: Cannot cast from source type to destination type.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 06 Apr 2010, 05:26

I've heard from several people that they've got it working - but its pretty much "on your own" if you use JavaScript. Maybe some of the ppl could try to post a simple example for you.

/Thomas

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 1 guest