-
Notifications
You must be signed in to change notification settings - Fork 55
ServerAPI
Greg edited this page Aug 22, 2013
·
21 revisions
Global cloak
object.
Configuration options are given in ServerConfiguration.
Example:
cloak.configure({
roomLife: 5000,
messages: {
foo: function(arg, user) {
console.log('foo from ' + user.id);
}
}
});
Runs the server. Call cloak.configure
first!
Example:
cloak.run();
The same as doing user.message(name, arg)
for every connected user.
Return an array of all rooms.
Create a room. Size is the maximum number of allowed members.
Delete a room. All members are kicked out. If the server is configured to autoJoinLobby
(as by default) the users are added to the lobby.
Stop the game loop, stop accepting new connections, disconnect all users.
All documentation on this wiki is licensed under a Creative Commons Attribution 3.0 Unported License. To attribute simply link to this wiki.