User variables for user only
- Flying_Banana
- Posts: 42
- Joined: 04 May 2014, 07:03
Re: User variables for user only
Not intentionally gravedigging but - is there progress on this? I also find this very convenient (as I'd like to sync things from server to user that other users need not to know) I'm just wondering should I leave this for later in hope that the next update will contain this feature?
Re: User variables for user only
How should this work?
Server --> Client only or also the other way around?
If clients can override server's values there could be some cheating involved.
One way to work around the issue could be to use the ReadOnly filter as explained here:
viewtopic.php?p=66625#p66625
We're thinking about building this feature as a System Controller filter instead of modifying the client/server API, as this would avoid breaking the compatibility of the API with previous versions of the server.
In other words, one could add a specific PrivateUserVariable filter in his Extension and provide the names of the variables to be treated as "private". The filter will detect those and update only the owner, instead of everyone.
The analysis is not done yet, so I am just thinking out loud
Server --> Client only or also the other way around?
If clients can override server's values there could be some cheating involved.
One way to work around the issue could be to use the ReadOnly filter as explained here:
viewtopic.php?p=66625#p66625
We're thinking about building this feature as a System Controller filter instead of modifying the client/server API, as this would avoid breaking the compatibility of the API with previous versions of the server.
In other words, one could add a specific PrivateUserVariable filter in his Extension and provide the names of the variables to be treated as "private". The filter will detect those and update only the owner, instead of everyone.
The analysis is not done yet, so I am just thinking out loud
- Flying_Banana
- Posts: 42
- Joined: 04 May 2014, 07:03
Re: User variables for user only
I was thinking of it being just server to user really. I realised that to prevent cheating I have to filter every user input with an extension. Having private user variables as a flag could be useful to relay data easily. I have to say, by far the user variables design is the best I've worked with so far! (I've had enough with blocks, callbacks, and fetches! I want the data now! )
Well then I think it is the time I start to look at filters! (But I still think a private flag would be so very convenient!)
Well then I think it is the time I start to look at filters! (But I still think a private flag would be so very convenient!)
Re: User variables for user only
The problem with the "private" flag is that it impacts the server and client API in a way that it makes it no longer possibile to mix up older clients with new server or viceversa.
In other words, if we release new client API we must force developers to upgrade their servers too.
At the moment I am thinking of a way to work around this issue by providing a filter that allows the same result using a slightly different system. Instead of flagging variables with a private flag you tell the server-side filter which names represent the private User Vars.
In terms of coding it shouldn't be more painful than flagging each variable.
The filter idea would also speed up the process as we don't have to worry about backward compatibility and run tons of tests. Maybe at a later time we could introduce the feature via the "private" flag. If we choose to do so, users of the previous system (filter) will be able to keep the filter if they want or update their code to the new system.
Another nice-to-have option could be a Zone-level config setting saying if the server can accept changes of private UserVars from clients or not, with a default value of false.
How does that sound?
In other words, if we release new client API we must force developers to upgrade their servers too.
At the moment I am thinking of a way to work around this issue by providing a filter that allows the same result using a slightly different system. Instead of flagging variables with a private flag you tell the server-side filter which names represent the private User Vars.
In terms of coding it shouldn't be more painful than flagging each variable.
The filter idea would also speed up the process as we don't have to worry about backward compatibility and run tons of tests. Maybe at a later time we could introduce the feature via the "private" flag. If we choose to do so, users of the previous system (filter) will be able to keep the filter if they want or update their code to the new system.
Another nice-to-have option could be a Zone-level config setting saying if the server can accept changes of private UserVars from clients or not, with a default value of false.
How does that sound?
Re: User variables for user only
Great for me
- Flying_Banana
- Posts: 42
- Joined: 04 May 2014, 07:03
Re: User variables for user only
Alright, I'll check the filters and try a workaround.
That being said, since this is a server thing, shouldn't it not affect users who don't upgrade though? Because servers that don't upgrade will never worry about this flag, and client api will never have to worry about the flag either because it never receives a flagged variable.
I guess unless someone tries to code in the new api but still use an older version of api on the actual server - but that's just silly...
That being said, since this is a server thing, shouldn't it not affect users who don't upgrade though? Because servers that don't upgrade will never worry about this flag, and client api will never have to worry about the flag either because it never receives a flagged variable.
I guess unless someone tries to code in the new api but still use an older version of api on the actual server - but that's just silly...
Re: User variables for user only
Good point, if it's a server-side thing only, both flag-system and filter-system will work equally well.
There's even a third route which is extending SFSUserVariable to SFSPrivateUserVariable, to differentiate which variables should behave normally and which should be treated as private.
There's even a third route which is extending SFSUserVariable to SFSPrivateUserVariable, to differentiate which variables should behave normally and which should be treated as private.
- tdanylchuk
- Posts: 10
- Joined: 17 Jun 2016, 13:12
Re: User variables for user only
Hello,
Same issue I have. But sending variables via push extension response is not a case for me since user need to have up-to-date data even if he had been disconnected...
So my question: Is there any updates on "todo list"???
I might have over 1k users in one single room and they will receive variable updates per second. So each client instance will de-serialize all unneeded events...
BR, Taras
Same issue I have. But sending variables via push extension response is not a case for me since user need to have up-to-date data even if he had been disconnected...
So my question: Is there any updates on "todo list"???
I might have over 1k users in one single room and they will receive variable updates per second. So each client instance will de-serialize all unneeded events...
BR, Taras
Re: User variables for user only
tdanylchuk wrote:Hello,
Same issue I have. But sending variables via push extension response is not a case for me since user need to have up-to-date data even if he had been disconnected...
Sorry, I am not following. What is "push extension response"?
Also the part about having up to data when the user is confusing. If the user is disconnected it goes without saying that no updates will be possible.
I might have over 1k users in one single room and they will receive variable updates per second. So each client instance will de-serialize all unneeded events...
For what reasons are these 1K users in a Room? What feature of the Room are you using?
More often than not when you need to cram so many users in a Room but you don't want broadcast updates, you don't need a Room to begin with, which is perfectly fine.
Please clarify.
Thanks
- tdanylchuk
- Posts: 10
- Joined: 17 Jun 2016, 13:12
Re: User variables for user only
but you don't want broadcast updates
I'm actually broadcasting messages over all users in one room and also via groupId(isGlobal = true) for room group. But these are ROOM variables, as for my case I need to have personal user's variable update, so no other users know them in joined room.
BR, Taras
Re: User variables for user only
Ok, thanks for the clarification.
We don't have a timeline for this particular feature, although I think it should be included in the next release (2.12).
You can already implement this via Extension calls, by sending those values via SFSObject directly to the client(s).
Hope it helps
We don't have a timeline for this particular feature, although I think it should be included in the next release (2.12).
You can already implement this via Extension calls, by sending those values via SFSObject directly to the client(s).
Hope it helps
- tdanylchuk
- Posts: 10
- Joined: 17 Jun 2016, 13:12
Re: User variables for user only
Thank you, good changes are coming up in new release
By the way, I'm sending variables via extension response now, but I want send them in my custom wrapper like:
But instead of converting to byte array I want to put SFSArray in my custom object, in this case error message occures in log.
So question is - Why can't I use SFSArray and SFSObject in my custom classes? Only SerializableSFSType and primitives...
PS: BTW when this version will be released? Because I need to have this state in user variables in case of reconnect...
BR, Taras.
By the way, I'm sending variables via extension response now, but I want send them in my custom wrapper like:
Code: Select all
byte[] variables;
CustomObject data = CustomObject(variables);
SFSObject sfsObject = new SFSObject();
sfsObject.putClass("data", data);
But instead of converting to byte array I want to put SFSArray in my custom object, in this case error message occures in log.
So question is - Why can't I use SFSArray and SFSObject in my custom classes? Only SerializableSFSType and primitives...
PS: BTW when this version will be released? Because I need to have this state in user variables in case of reconnect...
BR, Taras.
Re: User variables for user only
Sorry you can't mix SFSObject/SFSArray with your own classes.
Instead just use any standard collection, such as List or Set. They do the same work that SFSArray does by the way
We don't have a release date for the release at the moment. There is still a lot of to do as we're also working on some major updates.
Cheers
Instead just use any standard collection, such as List or Set. They do the same work that SFSArray does by the way
We don't have a release date for the release at the moment. There is still a lot of to do as we're also working on some major updates.
Cheers
- tdanylchuk
- Posts: 10
- Joined: 17 Jun 2016, 13:12
Re: User variables for user only
Thank you again for your feedback.
To bad that I can't mix these stuff...
It's very easy to use - user variable convert to SFSArray and send it, instead of converting to byte array (double conversion).
And by the way, JSON transition doesn't work properly for custom objects, other primitives work fine i guess.
BR, Taras.
To bad that I can't mix these stuff...
It's very easy to use - user variable convert to SFSArray and send it, instead of converting to byte array (double conversion).
And by the way, JSON transition doesn't work properly for custom objects, other primitives work fine i guess.
BR, Taras.
Who is online
Users browsing this forum: No registered users and 104 guests