function sendCommand(command, args, clientId) {
    let commandData = this._commands[command];
    // Don't send commands that we don't know about.
    if (!commandData) {
      this._log.error("Unknown command to send: " + command);
      return;
    }
    // Don't send a command with the wrong number of arguments.
    else if (!args || args.length != commandData.args) {
      this._log.error("Expected " + commandData.args + " args for '" +
                      command + "', but got " + args);
      return;
    }

    if (clientId) {
      this._sendCommandToClient(command, args, clientId);
    } else {
      for (let id in this._store._remoteClients) {
        this._sendCommandToClient(command, args, id);
      }
    }
  }
/**
   * Validates and sends a command to a client or all clients.
   *
   * Calling this does not actually sync the command data to the server. If the
   * client already has the command/args pair, it won't receive a duplicate
   * command.
   *
   * @param command
   *        Command to invoke on remote clients
   * @param args
   *        Array of arguments to give to the command
   * @param clientId
   *        Client ID to send command to. If undefined, send to all remote
   *        clients.
   */
Validates and sends a command to a client or all clients.
Calling this does not actually sync the command data to the server. If the
client already has the command/args pair, it won't receive a duplicate
command.

@param command
Command to invoke on remote clients
@param args
Array of arguments to give to the command
@param clientId
Client ID to send command to. If undefined, send to all remote
clients.
Validates and sends a command to a client or all clients . Calling this does not actually sync the command data to the server . If the client already has the command / args pair it won ' t receive a duplicate command . @param command Command to invoke on remote clients @param args Array of arguments to give to the command @param clientId Client ID to send command to . If undefined send to all remote clients .
function sendCommand(command, args, clientId) {
    let commandData = this._commands[command];
    if (!commandData) {
      this._log.error("Unknown command to send: " + command);
      return;
    }
    else if (!args || args.length != commandData.args) {
      this._log.error("Expected " + commandData.args + " args for '" +
                      command + "', but got " + args);
      return;
    }
    if (clientId) {
      this._sendCommandToClient(command, args, clientId);
    } else {
      for (let id in this._store._remoteClients) {
        this._sendCommandToClient(command, args, id);
      }
    }
  }
function sendCommand ( command , args , clientId ) { let commandData = this . _commands [ command ] ; if ( ! commandData ) { this . _log . error ( "Unknown command to send: " + command ) ; return ; } else if ( ! args || args . length != commandData . args ) { this . _log . error ( "Expected " + commandData . args + " args for '" + command + "', but got " + args ) ; return ; } if ( clientId ) { this . _sendCommandToClient ( command , args , clientId ) ; } else { for ( let id in this . _store . _remoteClients ) { this . _sendCommandToClient ( command , args , id ) ; } } }
Validates and sends a command to a client or all clients.
Validates and sends a command to a client or all clients .
// Don't send commands that we don't know about. // Don't send a command with the wrong number of arguments.