Page 1 of 1

smartFoxClient Debug mode not working

Posted: 23 Mar 2015, 22:50
by frcol
I´ve already set

_smartfox = new SmartFoxClient(true);

Put listener to
_smartfox.addEventListener(SFSEvent.onDebugMessage, smartfox_onDebugMessage);

But it´s not working, it not send any debug message.

Re: smartFoxClient Debug mode not working

Posted: 24 Mar 2015, 09:27
by Lapo
Hi,
are we talking about Actionscript 3? Java?
What API version?

Thanks

Re: smartFoxClient Debug mode not working

Posted: 24 Mar 2015, 15:21
by frcol
Sorry,

Plataform: Flash AS3
SFS 1.6.9
OpenSpace 2.0

Code: Select all

_smartfox = new SmartFoxClient(true);

_smartfox.addEventListener(SFSEvent.onDebugMessage, smartfox_onDebugMessage);
			
function smartfox_onDebugMessage(evt:SFSEvent):void
		{
			trace("[SFS debug] "+evt.params.message);
		}

Re: smartFoxClient Debug mode not working

Posted: 25 Mar 2015, 11:10
by Lapo
I have tested with the AS3 API and it works just fine.

The code I am using:

Code: Select all

sfs = new SmartFoxClient(true);

sfs.addEventListener(SFSEvent.onConnection, onConnection);
// ...
// ...
sfs.addEventListener(SFSEvent.onDebugMessage, onDebug);

function onConnection(evt:SFSEvent):void
{
	var success:Boolean = evt.params.success;
	
	if (success)
	{
		debugTrace("Connection successfull!");
		// Attempt to log in "simpleChat" Zone as a guest user
		sfs.login("test", "", "");
	}
	else
	{
		debugTrace("Connection failed!");	
	}
}

// ...
// ...

function onDebug(evt:SFSEvent)
{
	trace("DEBUG:: " + evt.params.message)
}
which is basically the AS3 template found in the SmartFox examples.

Hope it helps

Re: smartFoxClient Debug mode not working

Posted: 25 Mar 2015, 12:51
by frcol
It´s very strange because it was working before.
Somehow, it stoped working.

Is there any other place that it can be set to not send the debugMessages? Config?
Another wayt is i if in some part of the code there is a remove listener, but is not the case.

I need it because I must see the communication between SFS and client to move NPC by extension. Is there another way to see these communications?

thanks Lapo.

Re: smartFoxClient Debug mode not working

Posted: 25 Mar 2015, 14:58
by Lapo
Can you try to setup a new project with just the necessary code to connect and login?
Maybe something is wrong with your current project, although I am not able to guess what it is.

The only other way to see the debug is to run the project in the Flash Editor (or in Flex debug mode)

cheers

Re: smartFoxClient Debug mode not working

Posted: 27 Mar 2015, 12:59
by frcol
It worked now.
trhough smartFoxClient constructor it does not work.
I must set its property after login:

_smartClient.debug = true;

Re: smartFoxClient Debug mode not working

Posted: 27 Mar 2015, 14:38
by Lapo
Are you perhaps using an external .xml config for your connection?
If so make sure you don't have the <debug> flag set different from the constructor, otherwise it will override it.

That's the only explanation that comes to mind, otherwise it just works. In my test I only used the flag in the constructor.

cheers

Re: smartFoxClient Debug mode not working

Posted: 27 Mar 2015, 17:04
by frcol
Exactly that.
My config.xml was false :(

Thanks