admitPeer method

void admitPeer(
  1. String peerId
)

Admit a Peer to the room who is in the lobby

Implementation

void admitPeer(String peerId) {
  if (!checkPermission(permissionTypeCheck: PermissionType.admin)) {
    return;
  }
  try {
    removeLobbyPeer(peerId);

    socket.publish(Request_Request.acceptLobbyPeer, {'peerId': peerId});
  } catch (error) {
    logger.e("🔴 Error accepting peer", error: error);
  }
}