Hi,
simple question, but can't find the answer to it:
Is a user variable, set as private by server, for user read-only? Or can the user change the value illegal? I am thinking about assign functionality only for a few users set by a variable boolean.
private user variables
-
- Posts: 33
- Joined: 28 Sep 2018, 19:47
Re: private user variables
Hi,
no, private variables can be changed by their owner.
They could, if they send a SetUserVariableRequest from client side.
There are two possible ways to deny changes:
1) Use a SystemController filter:
http://docs2x.smartfoxserver.com/Advanc ... er-filters
2) Use an Extension instead.
This way you can initialize Users with certain game values that will be read-only on the client side.
Hope it helps
no, private variables can be changed by their owner.
Or can the user change the value illegal?
They could, if they send a SetUserVariableRequest from client side.
There are two possible ways to deny changes:
1) Use a SystemController filter:
http://docs2x.smartfoxserver.com/Advanc ... er-filters
2) Use an Extension instead.
This way you can initialize Users with certain game values that will be read-only on the client side.
Hope it helps
-
- Posts: 33
- Joined: 28 Sep 2018, 19:47
Re: private user variables
I see.
But I can make, in case of an extension, the user variable hidden and private so the user will never know which name this variable has and then I can at least do some server stuff like send all user extra content with a certain variable value?
I think I will create a class for the user properties on the server anyway.
But I can make, in case of an extension, the user variable hidden and private so the user will never know which name this variable has and then I can at least do some server stuff like send all user extra content with a certain variable value?
I think I will create a class for the user properties on the server anyway.
Re: private user variables
Lapo wrote:There are two possible ways to deny changes:
1) Use a SystemController filter:
http://docs2x.smartfoxserver.com/Advanc ... er-filters
2) Use an Extension instead.
This way you can initialize Users with certain game values that will be read-only on the client side.
A third alternative would be to remove the SetUserVariables permission with the User Privilege Manager. This would block all user variable changes from clients, so it depends on the use-case if it's suitable.
Who is online
Users browsing this forum: Bing [Bot] and 137 guests