Page 1 of 1

Connect to SFS with Javascript?

Posted: 06 Apr 2010, 04:38
by GoldFire33
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.

Posted: 06 Apr 2010, 05:26
by ThomasLund
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