mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 15:52:27 +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;
|
||||
auto data = message.value("data").isObject() ? message.value("data").toObject() : QJsonObject();
|
||||
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:"
|
||||
<< QJsonDocument(message).toJson(QJsonDocument::Compact).left(MAX_DEBUG_DETAIL_LENGTH);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remember this node's type for the reply.
|
||||
_nodeType = to;
|
||||
|
||||
// Find or create a connection.
|
||||
WDCConnection* connection;
|
||||
if (_connectionsByWebSocket.contains(from)) {
|
||||
|
|
|
@ -319,7 +319,7 @@ private:
|
|||
|
||||
QObject* _parent;
|
||||
|
||||
NodeType_t _nodeType;
|
||||
NodeType_t _nodeType { NodeType::Unassigned };
|
||||
|
||||
std::unique_ptr<rtc::Thread> _rtcNetworkThread { nullptr };
|
||||
std::unique_ptr<rtc::Thread> _rtcWorkerThread { nullptr };
|
||||
|
|
Loading…
Reference in a new issue