Show Clients Their OUT and IN Packets in Realtime?

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Show Clients Their OUT and IN Packets in Realtime?

Postby coolboy714cp » 27 May 2015, 05:44

Is it possible to have 2 textboxes on the stage, where one displays the content of the packet the current user is receiving, and the other displays the content of the packet last sent to the server? How would I go about doing something like this?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Show Clients Their OUT and IN Packets in Realtime?

Postby Lapo » 27 May 2015, 07:18

Hi,
sorry no, we don't provide this sort of stats on the client side.

To be honest I am not even sure about how useful this could be, but that's just my opinion.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Show Clients Their OUT and IN Packets in Realtime?

Postby coolboy714cp » 27 May 2015, 08:09

Is it possible to alter your SFS2X Flash AS3 API Source, specifically, the logger, to meet my needs, or is it prohibited or even possible?

Thanks,
-CoolBoy714CP
- - http://sfs-tutorials.blogspot.com/ will be updated soon!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Show Clients Their OUT and IN Packets in Realtime?

Postby Lapo » 27 May 2015, 09:39

Can you give me some details about what you would like to change?
Depending on your needs there may be ways that don't even need to touch the sources.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Show Clients Their OUT and IN Packets in Realtime?

Postby coolboy714cp » 27 May 2015, 17:19

I would have to find out some way to retrieve the content of each packet like what is displayed in the debug messages and make it public so I can display it in a text box on the stage. Unless there is already someway to do this without changing anything?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Show Clients Their OUT and IN Packets in Realtime?

Postby Lapo » 28 May 2015, 07:39

Yes there is.
You can add a listener to the SmartFox API's logger and receive the debug messages in your code.
Like this:

Code: Select all

var sfs:SmartFox = new SmartFox(true) // activate debug
sfs.logger.addEventListener(LoggerEvent.INFO, onLogEvent)

...
...

private function onLogEvent(evt:LoggerEvent):void
{
   var logMessage:String = evt.params.message
   // do something with the message
}


Word of caution: depending on what your application does there can be many of these log events per second. If you print a ton of stuff on screen you may end up slowing down your application quite significantly.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 14 guests