command method

bool command(
  1. Map<String, dynamic> command
)

Do something on this connection, as a command map the host built itself.

Returns false when the engine could not read the map: an unknown type, a missing field, or a field of the wrong shape. Every named command below builds its own map, so only this one can be handed something unreadable.

if (!client.command({'type': 'join', 'channel': '#obby', 'key': null})) {
  print('the engine could not read that command');
}

Implementation

bool command(Map<String, dynamic> command) {
  _alive();
  final json = jsonEncode(command).toNativeUtf8();
  try {
    return _bindings.command(_handle, json);
  } finally {
    calloc.free(json);
  }
}