Hi Orthonormal,
Values you place into the magic pocket get automatically synced across clients and the server and are available to all of them. If you run your example and then open the console in Chrome, for instance, you would be able to type "now.foo" and see that it has the value "bar".
You can place variables in only one client's this.now pocket if you want, but really if you want to have values that are only known to the server you should keep them in a different server variable outside of the now magic pockets.
Hope that helps!
Ian Serlin
Owner Useful IO LLC
On Fri, Jun 15, 2012 at 7:17 AM, Orthonormal
<s.cov...@gmail.com> wrote:
// Server side
everyone.now.setValue = function() {
this.now.foo = 'bar';
}
// Client side
<script>
now.ready(function(){
now.setValue();
});
Is the client able to get the value of foo without me allowing him to?
Example: If this was a poker game, I might sync an array containing everyone's cards in the magic pocket. Would a player be able to cheat and retrieve the values in the array in order to know what cards everyone is holding?