code: function(rpc_method, the_fn, callback, connection_id) {
          var connection, rpc_args, fn_args;
  
          // Make sure we have a connection_id specified
          if (!connection_id && connection_id !== 0) {
              return callback('server not specified');
  
          } else if (!client.state.irc_connections[connection_id]) {
              return callback('not connected to server');
          }
  
          // The server this command is directed to
          connection = client.state.irc_connections[connection_id];
  
          // Get the arguments for the RPC call only (starts at 4)
          rpc_args = Array.prototype.slice.call(arguments, 4);
  
          global.modules.emit('rpc ' + rpc_method, {
              arguments: rpc_args,
              client: client,
              connection: connection
          })
          .then(function() {
              // Listeners expect arguments in a (connection, callback, args..n) format, so preppend
              // the connection + callback
              fn_args = rpc_args.slice(0);
              fn_args.unshift(connection, callback);
  
              the_fn.apply(client, fn_args);
          }, function() {
              // The RPC call was prevented from running by a module
          });
      }
docs: Called for each RPC call addRpcMethod() below prepends the incoming RPC call with the method name and the listener that handles this call, and passes that argument list to moduleEventWrap(). This gives us the chance to wrap all calls with connection_id checks and passing them off to the module system.