changeClientId method

Future<bool> changeClientId()
inherited

Implementation

Future<bool> changeClientId() async {
  bool result = false;
  if (_localClientId == true && isVirtualId) {
    String? temp = _clientId;
    _clientId = null;
    String clientId = await getClientId();
    if (clientId != null) {
      result = await AppP2PApi().clientChangeId(_clientPtr!, clientId);
      if (result == true) {
        temp = _serviceParam;
        _serviceParam = null;
        _serviceParam = await getServiceParam();
        if (_serviceParam == null) {
          _serviceParam = temp;
        }
      }
    } else {
      _clientId = temp;
    }
  }
  return result;
}