Get a broadcast object giving it a (nick)name and on a specific channel, the callback is used for getting messages of other clients on that channel The function gets 2 arguments (nickName, message) |
|
Returns the current client JSClientInformation object. |
|
Returns an array of JSClientInformation elements describing the clients connected to the server. |
|
/* Returns an array of JSClientInformation elements describing the clients connected to the server filtered by the a client info string. |
|
Returns true if the server is in maintenance mode, false otherwise. |
|
Sends a message to all connected clients. |
|
Sends a message to a specific client, identified by its clientId. |
|
Shuts down all connected clients. |
|
Shuts down a specific client, identified by its clientId. |
|
|
getBroadcaster(name, channelName, callback) |
|
Get a broadcast object giving it a (nick)name and on a specific channel, the callback is used for getting messages of other clients on that channel
The function gets 2 arguments (nickName, message) |
|
|
Parameters The nickname for this user on this channel |
|
The channel name where should be listened to (and send messages to) |
|
The callback when for incomming messages |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var broadcaster = plugins.clientmanager.getBroadcaster("nickname","mychatchannel",callback);
broadcaster.broadcastMessage("Hallo"); |
|
|
|
|
Returns the current client JSClientInformation object. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
Returns an array of JSClientInformation elements describing the clients connected to the server. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Returns an array of JSClientInformation elements describing the clients connected to the server.
var clients = plugins.clientmanager.getConnectedClients();
application.output("There are " + clients.length + " connected clients.");
for (var i = 0; i < clients.length; i++)
application.output("Client has clientId '" + clients[i].getClientID() + "' and has connected from host '" + clients[i].getHostAddress() + "'."); |
|
|
|
|
getConnectedClients(clientInfoFilter) |
|
/*
Returns an array of JSClientInformation elements describing the clients connected to the server filtered by the a client info string.
This way you can ask for a specific set of clients that have a specific information added to there client information. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Returns an array of JSClientInformation elements describing the clients connected to the server.
var clients = plugins.clientmanager.getConnectedClients();
application.output("There are " + clients.length + " connected clients.");
for (var i = 0; i < clients.length; i++)
application.output("Client has clientId '" + clients[i].getClientID() + "' and has connected from host '" + clients[i].getHostAddress() + "'."); |
|
|
|
|
Returns true if the server is in maintenance mode, false otherwise. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Returns true if the server is in maintenance mode, false otherwise.
if (plugins.maintenance.isInMaintenanceMode())
application.output("Server is in maintenance mode.");
else
application.output("Server is not in maintenance mode."); |
|
|
|
|
sendMessageToAllClients(message) |
|
Sends a message to all connected clients. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Sends a message to all connected clients.
plugins.clientmanager.sendMessageToAllClients("Hello, all clients!"); |
|
|
|
|
sendMessageToClient(clientId, message) |
|
Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.
var clients = plugins.clientmanager.getConnectedClients();
for (var i=0; i<clients.length; i++)
plugins.clientmanager.sendMessageToClient(clients[i].getClientId(), "Hello, client " + clients[i].getClientID() + "!"); |
|
|
|
|
Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down.
plugins.clientmanager.shutDownAllClients(); |
|
|
|
|
Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. This method returns immediately, it does not wait until the client shuts down. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. This method returns immediately, it does not wait until the client shuts down.
var clients = plugins.clientmanager.getConnectedClients();
for (var i=0; i<clients.length; i++)
plugins.clientmanager.shutDownClient(clients[i].getClientId()); |
|
|
|
|
|
|