function sendCommandToClient(command, args, clientId) {
    this._log.trace("Sending " + command + " to " + clientId);

    let client = this._store._remoteClients[clientId];
    if (!client) {
      throw new Error("Unknown remote client ID: '" + clientId + "'.");
    }

    // notDupe compares two commands and returns if they are not equal.
    let notDupe = function(other) {
      return other.command != command || !Utils.deepEquals(other.args, args);
    };

    let action = {
      command: command,
      args: args,
    };

    if (!client.commands) {
      client.commands = [action];
    }
    // Add the new action if there are no duplicates.
    else if (client.commands.every(notDupe)) {
      client.commands.push(action);
    }
    // It must be a dupe. Skip.
    else {
      return;
    }

    this._log.trace("Client " + clientId + " got a new action: " + [command, args]);
    this._tracker.addChangedID(clientId);
  }
/**
   * Sends a command+args pair to a specific client.
   *
   * @param command Command string
   * @param args Array of arguments/data for command
   * @param clientId Client to send command to
   */
Sends a command+args pair to a specific client.
@param command Command string
@param args Array of arguments/data for command
@param clientId Client to send command to
Sends a command + args pair to a specific client . @param command Command string @param args Array of arguments / data for command @param clientId Client to send command to
function sendCommandToClient(command, args, clientId) {
    this._log.trace("Sending " + command + " to " + clientId);
    let client = this._store._remoteClients[clientId];
    if (!client) {
      throw new Error("Unknown remote client ID: '" + clientId + "'.");
    }
    let notDupe = function(other) {
      return other.command != command || !Utils.deepEquals(other.args, args);
    };
    let action = {
      command: command,
      args: args,
    };
    if (!client.commands) {
      client.commands = [action];
    }
    else if (client.commands.every(notDupe)) {
      client.commands.push(action);
    }
    else {
      return;
    }
    this._log.trace("Client " + clientId + " got a new action: " + [command, args]);
    this._tracker.addChangedID(clientId);
  }
function sendCommandToClient ( command , args , clientId ) { this . _log . trace ( "Sending " + command + " to " + clientId ) ; let client = this . _store . _remoteClients [ clientId ] ; if ( ! client ) { throw new Error ( "Unknown remote client ID: '" + clientId + "'." ) ; } let notDupe = function ( other ) { return other . command != command || ! Utils . deepEquals ( other . args , args ) ; } ; let action = { command : command , args : args , } ; if ( ! client . commands ) { client . commands = [ action ] ; } else if ( client . commands . every ( notDupe ) ) { client . commands . push ( action ) ; } else { return ; } this . _log . trace ( "Client " + clientId + " got a new action: " + [ command , args ] ) ; this . _tracker . addChangedID ( clientId ) ; }
Sends a command+args pair to a specific client.
Sends a command + args pair to a specific client .
// notDupe compares two commands and returns if they are not equal. // Add the new action if there are no duplicates. // It must be a dupe. Skip.