Skip to content

Commit

Permalink
fix heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
reitowo committed Jun 2, 2024
1 parent 365f72f commit 951f904
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/room_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void RoomServer::startReceiveNotify() {
qDebug() << "notify thread exited";
}));
notifyThread->start();
startNatTypeDetect();
}

void RoomServer::startNatTypeDetect() {
Expand Down Expand Up @@ -121,9 +122,9 @@ void RoomServer::createRoom(const vts::server::ReqCreateRoom& req) {
}

this->roomId = rsp.roomid();
startReceiveNotify();
startNatTypeDetect();
emit room->onRoomInfoSucceed(rsp);

startReceiveNotify();
});
CollabRoom::connect(worker, &QThread::finished, worker, &QThread::deleteLater);
worker->setParent(room);
Expand Down Expand Up @@ -153,7 +154,6 @@ void RoomServer::joinRoom(const std::string& peerId, const std::string& roomId,
}

startReceiveNotify();
startNatTypeDetect();
emit room->onRoomInfoSucceed(rsp);
});
CollabRoom::connect(worker, &QThread::finished, worker, &QThread::deleteLater);
Expand Down
11 changes: 10 additions & 1 deletion ui/windows/collabroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ CollabRoom::CollabRoom(bool isServer, QString roomId, QWidget *parent) :
qDebug() << "Using Room Endpoint" << roomEndpoint;

this->roomId = roomId;
localPeerId = QUuid::createUuid().toString(QUuid::WithoutBraces);

localPeerId = QSysInfo::machineUniqueId();
if (localPeerId.isEmpty()) {
localPeerId = QSysInfo::bootUniqueId();
}
if (localPeerId.isEmpty()) {
localPeerId = QUuid::createUuid().toString(QUuid::WithoutBraces);
}

useDxCapture = settings.value("useDxCapture", false).toBool();
qDebug() << "sender is" << (useDxCapture ? "dx" : "spout");
Expand Down Expand Up @@ -410,6 +417,8 @@ void CollabRoom::roomInfoSucceed(const vts::server::RspRoomInfo &info) {

show();
activateWindow();

isRoomInfoReady = true;
}

void CollabRoom::roomInfoFailed(const string &error) {
Expand Down
2 changes: 2 additions & 0 deletions ui/windows/collabroom.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ private slots:

bool isServer;
bool useDxCapture;
bool isRoomInfoReady;

QString roomId;
QString localPeerId;

Expand Down

0 comments on commit 951f904

Please sign in to comment.