smartFoxClient Debug mode not working

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

smartFoxClient Debug mode not working

Post 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.
Fabio Colombini
Brazil
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Post by Lapo »

Hi,
are we talking about Actionscript 3? Java?
What API version?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Post 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);
		}
Fabio Colombini
Brazil
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Post 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.
Fabio Colombini
Brazil
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Post by frcol »

It worked now.
trhough smartFoxClient constructor it does not work.
I must set its property after login:

_smartClient.debug = true;
Fabio Colombini
Brazil
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Post by frcol »

Exactly that.
My config.xml was false :(

Thanks
Fabio Colombini
Brazil
Post Reply