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

User avatar
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

smartFoxClient Debug mode not working

Postby frcol » 23 Mar 2015, 22:50

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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Postby Lapo » 24 Mar 2015, 09:27

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

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

Re: smartFoxClient Debug mode not working

Postby frcol » 24 Mar 2015, 15:21

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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Postby Lapo » 25 Mar 2015, 11:10

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
User avatar
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Postby frcol » 25 Mar 2015, 12:51

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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Postby Lapo » 25 Mar 2015, 14:58

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
User avatar
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Postby frcol » 27 Mar 2015, 12:59

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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClient Debug mode not working

Postby Lapo » 27 Mar 2015, 14:38

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
User avatar
frcol
Posts: 99
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: smartFoxClient Debug mode not working

Postby frcol » 27 Mar 2015, 17:04

Exactly that.
My config.xml was false :(

Thanks
Fabio Colombini
Brazil

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 36 guests