Page 1 of 1

Java Android Version bug FOUND

Posted: 26 Aug 2009, 18:36
by croco
Hi all,

It seems the SFS API does not callback the userVariablesUpdate :( :(

Has you can see below the message Command .... is mine indicating which event i receive.

As you can see onUserCountChange message is received and i'm called by SFS aPI ;)

but for userVariablesUpdate i received well ;) but i'm not called by the SFS API :(

Thanks for your help.

uffer is required.
I/ ( 1213): Command ......... onUserCountChange
I/SmartFoxClient( 1213): [ RECEIVED ]: <msg t='sys'><body action='uCount' r='24' u='0' s='0'></body></msg>, (len: 67)
I/global ( 1213): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
I/ ( 1213): Command ......... onUserCountChange
I/SmartFoxClient( 1213): [ RECEIVED ]: <msg t='sys'><body action='uVarsUpdate' r='24'><user id='0' /><vars><var n='state' t='s'><![CDATA[AVAILABLE]]></var></vars></body></msg>, (len: 136)
I/global ( 1213): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.

Posted: 26 Aug 2009, 19:18
by croco
Hi all, Hi Lapo,

I found the SFS Bug

in the syshandler you deal on the bad element to find the user

On the body it's better ;)

An other thing with the current code i should have been raised with a NullPointer but i don't have it :( Does the errors handling is correct .

I'm used with java code so no problem for me but for unused developper they can ask for a week if the error is in their code or in the SFS ;)

Hope this help.

Croco

public void handleUserVarsUpdate(IXMLElement xmlData)
{
IXMLElement body = xmlData.getFirstChildNamed("body");
IXMLElement user = xmlData.getFirstChildNamed("user");
....
}

public void handleUserVarsUpdate(IXMLElement xmlData)
{
IXMLElement body = xmlData.getFirstChildNamed("body");
IXMLElement user = body.getFirstChildNamed("user");
....
}

Posted: 27 Aug 2009, 05:57
by Lapo
Please, remember to post in the proper section.
There is a dedicated Java/Android section, I've moved the post there.

Thanks for the feedback.

Posted: 27 Aug 2009, 07:09
by Lapo
It looks like you are using an older version of the API.
Please make sure to download the latest release, we have made quite a few updates and fixes recently.

http://www.smartfoxserver.com/labs/API/

Posted: 29 Aug 2009, 10:04
by croco
Hi lapo,
Yeah the bug comes on the latest version :(
I had to patch the source code from the link repository you mention
Hope this Help.

Croco

Posted: 30 Aug 2009, 08:59
by patso
Hi croco,

in it.gotoandplay.smartfoxclient.handlers.SysHandler you have

Code: Select all

    public void handleUserVarsUpdate(IXMLElement xmlData)
    {
        IXMLElement body = xmlData.getFirstChildNamed("body");
        IXMLElement user = body.getFirstChildNamed("user");
Is this the current content of the zip file you download from the API page? If not can you check what is the SysHandler.java last modification date? Maybe you see a cached file.

Posted: 31 Aug 2009, 09:17
by Lapo
Hi Croco,
the latest download has fixed that bug. Please check the suggestion from Patso. If you are under a proxy and you cannot access the latest update we can send it via email.

Let us know

Posted: 07 Sep 2009, 07:52
by croco
Hi patso, Lapo,

I checked you are right it's fixed and i got a ghost version ;)

anyway it's good to know debugging SFS ;)

sorry to have afraid you with that old bug!

Regards.

Croco

Posted: 07 Sep 2009, 07:54
by croco
Lapo wrote:Hi Croco,
the latest download has fixed that bug. Please check the suggestion from Patso. If you are under a proxy and you cannot access the latest update we can send it via email.

Let us know
thanks Lapo for your support !

I checked my FF options and got the last version now ;)

Cool

Croco