forked from incompl/cloak
-
Notifications
You must be signed in to change notification settings - Fork 0
Clientapi
Greg edited this page Aug 29, 2013
·
3 revisions
Configuration options are given in ClientConfiguration.
Example:
cloak.configure({
messages: {
bar: function(arg) {
console.log('bar from server');
}
},
serverEvents: {
begin: function() {
console.log('begin');
}
}
});
cloak.run('http://localhost:8090');
Sends a message to the server. The message handler on the server gets called if there is one for this message name.
returns true or false
The callback's argument is the array of all rooms.
Join room based on the room ID. The callback's argument is an object with a success property that is true or false.
Leave the room you're currently in. You may automatically join the lobby based on server config. You may also be unable to leave if you're in the lobby, again based on server config.
All documentation on this wiki is licensed under a Creative Commons Attribution 3.0 Unported License. To attribute simply link to this wiki.