Why are server-only attributes sent to the client?

All Union Platform questions, comments, feature requests, and bug reports.

Why are server-only attributes sent to the client?

Postby Armand » Sat 15 Feb 2014 04:38

I always assumed that server_only attributes exist only on the server and are never sent to the client. In fact, they seem to be more like "client read-only", e.g. the client receives them but can't save.

Sample code:
account.setAttribute(MY_ATTR, "value", Attribute.SCOPE_GLOBAL, Attribute.FLAG_PERSISTENT | Attribute.FLAG_SERVER_ONLY);

I have a bunch of attributes that only need to live on the server (they are used to save statistics in the account, like how many games were played within the last 24 hours, the country as determined via GeoIP and so on). Sending them to the client only generates additional traffic.

If you need to keep their behaviour as it is, then maybe you can add a "true" server-only attribute type that is never sent to the client.
Armand
 
Posts: 11
Joined: Mon 12 Mar 2012 04:10

Re: Why are server-only attributes sent to the client?

Postby toby » Tue 20 May 2014 22:36

You can probably accomplish what you want by just using
"global" or "static" server variables rather than attributes.

The contents of those never leave the server unless you transfer
them to an attribute or put them in a message. You can log their values
to a file or do whatever you like to view them.
toby
 
Posts: 162
Joined: Sun 24 Jun 2012 14:18


Return to Union Platform

Online

Users browsing this forum: No registered users and 5 guests