How to get the client type from the Server Side?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
foxboy
Posts: 110
Joined: 12 May 2011, 02:47
Location: Optimal Solution Pte. Ltd.

How to get the client type from the Server Side?

Postby foxboy » 14 Apr 2013, 11:32

I want to know what kind of device my client is using to access the server. I found that the latest version of SFS2X is logging this info on smartfox.log:

14 Apr 2013 | 14:04:09,616 | INFO | pool-1-thread-4 | v2.api.SFSApi | | User login: { Zone: MyZone}, ( User Name: TestUser, Id: 0, Priv: 0, Sess: 127.0.0.1:50287 ) , Type: FlashPlayer:PlugIn:WIN 11,7,700,179

I tried extracting it using user.getSession() but I couldn't find that information.

Is there a way how to do this?
"Dream it, I'll code it..."
Lead Developer
Optimal Solution Pte. Ltd.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to get the client type from the Server Side?

Postby Lapo » 14 Apr 2013, 15:15

Hi,
you will need to use this code to obtain the client type string:

Code: Select all

String theClient = user.getSession().getSystemProperty(SFSConstants.SESSION_CLIENT_TYPE);


cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
foxboy
Posts: 110
Joined: 12 May 2011, 02:47
Location: Optimal Solution Pte. Ltd.

Re: How to get the client type from the Server Side?

Postby foxboy » 14 Apr 2013, 17:01

Lapo wrote:Hi,
you will need to use this code to obtain the client type string:

Code: Select all

String theClient = user.getSession().getSystemProperty(SFSConstants.SESSION_CLIENT_TYPE);


cheers


Works like a charm! :D
Thanks Lapo.
"Dream it, I'll code it..."
Lead Developer
Optimal Solution Pte. Ltd.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 111 guests