Provides methods to synchronize data and UI elements between users. It keeps all data on the server in channel.properties to synchronize and update newly joined users.
Register ape.planet.ss.js in scripts/main.ape.js
Ape.addEvent('init', function(){ include('framework/mootools.js'); include('framework/userslist.js'); include('examples/nickname.js'); include('ape.planet.ss.js'); });
You need a running APE server and a configured APE Client!
Instantiate APE-Planet, just the same as APE-Client
var planet = new APE.Planet(); planet.load({ 'channel': 'apePlanetDemo', 'connectOptions': { 'name': 'user' + $random(0, 1234567890) } });
Send/synchronize data with other users.
planet.addEvent('ready', function(){ planet.send('foo', { 'bar': 123, 'more': 'this is a string', 'also': [1, 2, 3, 'lala'] }); });
Receive data sent by other users.
planet.addEvent('ready', function(){ planet.addEvent('update', function(key, value){ if (key == 'foo') console.log(value); }); });
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus