Hello, I am trying to add certain degree of security for an application.
And noticed that when you go into the ZoneAdmin->Zone->User (while a user is connected)
You can see their IP, Region and Program they are running from (in my case Unity / net#) (or similar).
But I did not find any way from the server to get that string or code.
Is it possible or is something only the Admin program can do because it check the TCP IP Packet and is not an info the smartfox gives?
I tried to check by the user methods and parameters, and the ones inside them. but if it was there was unable to found (not even searching online).
So is it possible or i am wasting time?
If it is possible how?
Thank you.
Identify Client application name
Re: Identify Client application name
Hi,
it's not directly exposed but you can get it via this:
We could add this as a method on the User object for more convenience.
Also, keep in mind that you can change the "client type" from client side, in case you need to identify different versions of the same client or different client Apps.
See the client side API --> SmartFox.setClientDetails(...)
Cheers
it's not directly exposed but you can get it via this:
Code: Select all
String appType = (String) user.getSession().getSystemProperty(SFSConstants.SESSION_CLIENT_TYPE);We could add this as a method on the User object for more convenience.
Also, keep in mind that you can change the "client type" from client side, in case you need to identify different versions of the same client or different client Apps.
See the client side API --> SmartFox.setClientDetails(...)
Cheers
Re: Identify Client application name
Thank you so much, I arrived to the Session but was unable to pass the correct parameters to that function.
any place were i can know what parameters to pass in order to get anything else?
...
Never mind found they are in SFSConstants.
Just to say but, will be great if you put in the program the help to be seen into the methods will help a lot. In case you do not get what i mean is.
Something like this:
Doing that it is a LOT explanation and in this case will be good to include the possible types. and what each of then do
but when i try this in my viewer it gives garbage like:Javadoc not found ...
and only shows me the method name and other things. Is something configured wrong or i need something else than the jar file to get the help too?
Thanks even if now another question.
any place were i can know what parameters to pass in order to get anything else?
...
Never mind found they are in SFSConstants.
Just to say but, will be great if you put in the program the help to be seen into the methods will help a lot. In case you do not get what i mean is.
Something like this:
Code: Select all
/**
* Given a sfsobject and the key, returns an int[] of that key intArray
* If there is none for any reason (or empty) gives null as return
* <p>
*
* @param obj An ISFSObject, can be null but then will give null.
* @param key the key to check inside the SFSObject.
* @return int[] the int array.
*/
static public int[] getIntArray(ISFSObject obj, String key) {
return getIntArray(obj, key, null);
}Doing that it is a LOT explanation and in this case will be good to include the possible types. and what each of then do
but when i try this in my viewer it gives garbage like:Javadoc not found ...
and only shows me the method name and other things. Is something configured wrong or i need something else than the jar file to get the help too?
Thanks even if now another question.
Re: Identify Client application name
You need to download the javadoc and add it your IDE:
https://www.smartfoxserver.com/download#p=extras
Cheers
https://www.smartfoxserver.com/download#p=extras
Cheers
Re: Identify Client application name
Thanks a lot!