API v1.2.5 released

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

API v1.2.5 released

Postby Bax » 26 Jun 2013, 09:09

We just released a minor update of the C# API, version 1.2.5.
You can get the new version and read the release notes here: http://www.smartfoxserver.com/download/sfs2x#p=client

IMPORTANT
Due to inconsistencies with the other APIs we distribute, we had to make some refactorings in this version, which are described in the release notes. Sorry for the inconvenient. Also please note that now the API DLL filename is SmartFox2X.dll.
Paolo Bax
The SmartFoxServer Team
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

Re: API v1.2.5 released

Postby Jake-GR » 07 Jul 2013, 01:04

Thank you for the PasswordUtil class!
Doing some research for my next two videos, and that should help instead of writing my own.

One question that I couldn't get from the docs, is the md5 hash that it generates consistent with PHP5?
I have seen some 3rd party utilities that create a different hash than php, which would cause conflicts with a web-based sign-up/login as well.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: API v1.2.5 released

Postby Lapo » 07 Jul 2013, 08:46

It's difficult to say, the best idea is to check by running the same string through PHP and C# and compare the result.
Lapo
--
gotoAndPlay()
...addicted to flash games
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

Re: API v1.2.5 released

Postby Jake-GR » 07 Jul 2013, 17:57

Giving an update, passed the same string "SmartFox2X" through both PHP and SF class...

ec17f34ff439421db1ad314a4e0264e9 (php)
ec17f34ff439421db1ad314a4e0264e9 (sfs)

As you can see it is indeed compatible!
Zeitcatcher
Posts: 2
Joined: 08 Jul 2013, 03:35

Re: API v1.2.5 released

Postby Zeitcatcher » 09 Jul 2013, 01:22

After updating from the previous version I began receiving the following error each time I stop the game in UnityPlayer:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
Sfs2X.Bitswarm.BitSwarmClient.ReleaseResources ()
Sfs2X.Bitswarm.BitSwarmClient.Disconnect (System.String reason)
Sfs2X.SmartFox.HandleClientDisconnection (System.String reason)
Sfs2X.SmartFox.Disconnect ()


I checked the changelog, but it doesn't seem that refactoring affected anything of what I was using, so I'm not sure what changes lead to this error message. Here's the function that calls SmartFox.Disconnect():

Code: Select all

public void OnApplicationQuit() {
      ConnectionManager.instance.OnSave();
      smartFox.Send(new LogoutRequest());
      smartFox.Disconnect();
      s_Instance = null;
}


Thanks!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: API v1.2.5 released

Postby Lapo » 09 Jul 2013, 06:52

Hi,
yes it is strange. In the latest update we didn't touch the Class file from which the exception is raised.

I see one strange thing with your code though.
On application quite you should call sfs.Disconnect() you don't have time to send a LogoutRequest, nor it is useful when you're disconnecting.
I don't know if that might be the cause of the problem but you can certainly remove it and try without it

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Zeitcatcher
Posts: 2
Joined: 08 Jul 2013, 03:35

Re: API v1.2.5 released

Postby Zeitcatcher » 10 Jul 2013, 02:06

Lapo wrote:On application quite you should call sfs.Disconnect() you don't have time to send a LogoutRequest, nor it is useful when you're disconnecting.
I don't know if that might be the cause of the problem but you can certainly remove it and try without it


Thanks, unfortunately that didn't resolve the issue. Any idea what behavior on my side could potentially cause something like this? I wonder what BitSwarmClient.ReleaseResources () does, maybe that would help me understand what I could potentially be doing wrong.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: API v1.2.5 released

Postby Lapo » 10 Jul 2013, 09:01

I was able to recreate the problem, which came a little as surprise since the specific file that causes the issue hasn't been touched since April 2013 :shock: (which means it was the same in the previous version where the error doesn't occur)

In any case we'll release an update very shortly, I'll post when it's ready for download. Meanwhile you can use a try/catch around the Disconnect() call to avoid that the rest of your code isn't executed.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: API v1.2.5 released

Postby Lapo » 10 Jul 2013, 09:23

Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 14 guests