Page 1 of 1

API v1.2.5 released

Posted: 26 Jun 2013, 09:09
by Bax
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.

Re: API v1.2.5 released

Posted: 07 Jul 2013, 01:04
by Jake-GR
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.

Re: API v1.2.5 released

Posted: 07 Jul 2013, 08:46
by Lapo
It's difficult to say, the best idea is to check by running the same string through PHP and C# and compare the result.

Re: API v1.2.5 released

Posted: 07 Jul 2013, 17:57
by Jake-GR
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!

Re: API v1.2.5 released

Posted: 09 Jul 2013, 01:22
by Zeitcatcher
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!

Re: API v1.2.5 released

Posted: 09 Jul 2013, 06:52
by Lapo
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

Re: API v1.2.5 released

Posted: 10 Jul 2013, 02:06
by Zeitcatcher
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.

Re: API v1.2.5 released

Posted: 10 Jul 2013, 09:01
by Lapo
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

Re: API v1.2.5 released

Posted: 10 Jul 2013, 09:23
by Lapo