mirror of
https://github.com/overte-org/overte.git
synced 2025-07-28 21:10:24 +02:00
WebRTC data channel with assignment clients
This commit is contained in:
parent
a3c1d50478
commit
5d15ebb723
2 changed files with 8 additions and 2 deletions
|
@ -452,12 +452,18 @@ void WebRTCDataChannels::onSignalingMessage(const QJsonObject& message) {
|
||||||
const int MAX_DEBUG_DETAIL_LENGTH = 64;
|
const int MAX_DEBUG_DETAIL_LENGTH = 64;
|
||||||
auto data = message.value("data").isObject() ? message.value("data").toObject() : QJsonObject();
|
auto data = message.value("data").isObject() ? message.value("data").toObject() : QJsonObject();
|
||||||
int from = message.value("from").isDouble() ? (quint16)(message.value("from").toInt()) : 0;
|
int from = message.value("from").isDouble() ? (quint16)(message.value("from").toInt()) : 0;
|
||||||
if (from <= 0 || from > MAXUINT16 || !data.contains("description") && !data.contains("candidate")) {
|
auto to = NodeType::fromChar(message.value("to").toString().at(0));
|
||||||
|
|
||||||
|
if (from <= 0 || from > MAXUINT16 || to == NodeType::Unassigned
|
||||||
|
|| !data.contains("description") && !data.contains("candidate")) {
|
||||||
qCWarning(networking_webrtc) << "Unexpected signaling message:"
|
qCWarning(networking_webrtc) << "Unexpected signaling message:"
|
||||||
<< QJsonDocument(message).toJson(QJsonDocument::Compact).left(MAX_DEBUG_DETAIL_LENGTH);
|
<< QJsonDocument(message).toJson(QJsonDocument::Compact).left(MAX_DEBUG_DETAIL_LENGTH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remember this node's type for the reply.
|
||||||
|
_nodeType = to;
|
||||||
|
|
||||||
// Find or create a connection.
|
// Find or create a connection.
|
||||||
WDCConnection* connection;
|
WDCConnection* connection;
|
||||||
if (_connectionsByWebSocket.contains(from)) {
|
if (_connectionsByWebSocket.contains(from)) {
|
||||||
|
|
|
@ -319,7 +319,7 @@ private:
|
||||||
|
|
||||||
QObject* _parent;
|
QObject* _parent;
|
||||||
|
|
||||||
NodeType_t _nodeType;
|
NodeType_t _nodeType { NodeType::Unassigned };
|
||||||
|
|
||||||
std::unique_ptr<rtc::Thread> _rtcNetworkThread { nullptr };
|
std::unique_ptr<rtc::Thread> _rtcNetworkThread { nullptr };
|
||||||
std::unique_ptr<rtc::Thread> _rtcWorkerThread { nullptr };
|
std::unique_ptr<rtc::Thread> _rtcWorkerThread { nullptr };
|
||||||
|
|
Loading…
Reference in a new issue