mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:43:53 +02:00
Merge branch 'atp' of https://github.com/birarda/hifi into protocol
This commit is contained in:
commit
bc1569be6b
21 changed files with 84 additions and 130 deletions
|
@ -58,12 +58,6 @@ Agent::Agent(NLPacket& packet) :
|
|||
{ PacketType::OctreeStats, PacketType::EntityData, PacketType::EntityErase },
|
||||
this, "handleOctreePacket");
|
||||
packetReceiver.registerListener(PacketType::Jurisdiction, this, "handleJurisdictionPacket");
|
||||
|
||||
auto& packetReceiver = DependencyManager::get<NodeList>()->getPacketReceiver();
|
||||
packetReceiver.registerListener(PacketType::BulkAvatarData, this, "processAvatarDataPacket");
|
||||
packetReceiver.registerListener(PacketType::KillAvatar, this, "processKillAvatar");
|
||||
packetReceiver.registerListener(PacketType::AvatarIdentity, this, "processAvatarIdentityPacket");
|
||||
packetReceiver.registerListener(PacketType::AvatarBillboard, this, "processAvatarBillboardPacket");
|
||||
}
|
||||
|
||||
void Agent::handleOctreePacket(QSharedPointer<NLPacket> packet, SharedNodePointer senderNode) {
|
||||
|
@ -199,6 +193,9 @@ void Agent::run() {
|
|||
|
||||
void Agent::aboutToFinish() {
|
||||
_scriptEngine.stop();
|
||||
|
||||
auto& packetReceiver = DependencyManager::get<NodeList>()->getPacketReceiver();
|
||||
packetReceiver.unregisterListener(DependencyManager::get<AvatarHashMap>().data());
|
||||
|
||||
// our entity tree is going to go away so tell that to the EntityScriptingInterface
|
||||
DependencyManager::get<EntityScriptingInterface>()->setEntityTree(NULL);
|
||||
|
|
|
@ -15,13 +15,11 @@
|
|||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
#include <PacketListener.h>
|
||||
|
||||
#include "ThreadedAssignment.h"
|
||||
|
||||
class QSharedMemory;
|
||||
|
||||
class AssignmentClient : public QObject, public PacketListener {
|
||||
class AssignmentClient : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AssignmentClient(Assignment::Type requestAssignmentType, QString assignmentPool,
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
extern const char* NUM_FORKS_PARAMETER;
|
||||
|
||||
|
||||
class AssignmentClientMonitor : public QObject, public PacketListener {
|
||||
class AssignmentClientMonitor : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AssignmentClientMonitor(const unsigned int numAssignmentClientForks, const unsigned int minAssignmentClientForks,
|
||||
|
|
|
@ -341,6 +341,9 @@ void AvatarMixer::broadcastAvatarData() {
|
|||
++_sumIdentityPackets;
|
||||
}
|
||||
});
|
||||
|
||||
// close the current packet so that we're always sending something
|
||||
avatarPacketList.closeCurrentPacket(true);
|
||||
|
||||
// send the avatar data PacketList
|
||||
nodeList->sendPacketList(avatarPacketList, *node);
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <Assignment.h>
|
||||
#include <HTTPSConnection.h>
|
||||
#include <LimitedNodeList.h>
|
||||
#include <PacketListener.h>
|
||||
|
||||
#include "DomainServerSettingsManager.h"
|
||||
#include "DomainServerWebSessionData.h"
|
||||
|
@ -35,7 +34,7 @@
|
|||
typedef QSharedPointer<Assignment> SharedAssignmentPointer;
|
||||
typedef QMultiHash<QUuid, WalletTransaction*> TransactionHash;
|
||||
|
||||
class DomainServer : public QCoreApplication, public HTTPSRequestHandler, public PacketListener {
|
||||
class DomainServer : public QCoreApplication, public HTTPSRequestHandler {
|
||||
Q_OBJECT
|
||||
public:
|
||||
DomainServer(int argc, char* argv[]);
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <OctreeQuery.h>
|
||||
#include <OffscreenUi.h>
|
||||
#include <udt/PacketHeaders.h>
|
||||
#include <PacketListener.h>
|
||||
#include <PhysicalEntitySimulation.h>
|
||||
#include <PhysicsEngine.h>
|
||||
#include <ScriptEngine.h>
|
||||
|
@ -126,11 +125,7 @@ class Application;
|
|||
|
||||
typedef bool (Application::* AcceptURLMethod)(const QString &);
|
||||
|
||||
class Application :
|
||||
public QApplication,
|
||||
public AbstractViewStateInterface,
|
||||
public AbstractScriptingServicesInterface,
|
||||
public PacketListener {
|
||||
class Application : public QApplication, public AbstractViewStateInterface, public AbstractScriptingServicesInterface {
|
||||
Q_OBJECT
|
||||
|
||||
friend class OctreePacketProcessor;
|
||||
|
|
|
@ -13,11 +13,10 @@
|
|||
#define hifi_OctreePacketProcessor_h
|
||||
|
||||
#include <ReceivedPacketProcessor.h>
|
||||
#include <PacketListener.h>
|
||||
|
||||
/// Handles processing of incoming voxel packets for the interface application. As with other ReceivedPacketProcessor classes
|
||||
/// the user is responsible for reading inbound packets and adding them to the processing queue by calling queueReceivedPacket()
|
||||
class OctreePacketProcessor : public ReceivedPacketProcessor, public PacketListener {
|
||||
class OctreePacketProcessor : public ReceivedPacketProcessor {
|
||||
Q_OBJECT
|
||||
public:
|
||||
OctreePacketProcessor();
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <NLPacket.h>
|
||||
#include <MixedProcessedAudioStream.h>
|
||||
#include <RingBufferHistory.h>
|
||||
#include <PacketListener.h>
|
||||
#include <SettingHandle.h>
|
||||
#include <Sound.h>
|
||||
#include <StDev.h>
|
||||
|
@ -81,7 +80,7 @@ typedef glm::quat (*AudioOrientationGetter)();
|
|||
|
||||
class NLPacket;
|
||||
|
||||
class AudioClient : public AbstractAudioInterface, public Dependency, public PacketListener {
|
||||
class AudioClient : public AbstractAudioInterface, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
public:
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
#include <AudioStreamStats.h>
|
||||
#include <Node.h>
|
||||
#include <NLPacket.h>
|
||||
#include <PacketListener.h>
|
||||
|
||||
class MixedProcessedAudioStream;
|
||||
|
||||
class AudioIOStats : public QObject, public PacketListener {
|
||||
class AudioIOStats : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AudioIOStats(MixedProcessedAudioStream* receivedAudioStream);
|
||||
|
|
|
@ -21,12 +21,11 @@
|
|||
#include <DependencyManager.h>
|
||||
#include <NLPacket.h>
|
||||
#include <Node.h>
|
||||
#include <PacketListener.h>
|
||||
|
||||
#include "AvatarData.h"
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
class AvatarHashMap : public QObject, public Dependency, public PacketListener {
|
||||
class AvatarHashMap : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
||||
|
@ -36,14 +35,15 @@ public:
|
|||
|
||||
public slots:
|
||||
bool isAvatarInRange(const glm::vec3 & position, const float range);
|
||||
|
||||
private slots:
|
||||
void sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& oldUUID);
|
||||
|
||||
void processAvatarDataPacket(QSharedPointer<NLPacket> packet, SharedNodePointer sendingNode);
|
||||
void processAvatarIdentityPacket(QSharedPointer<NLPacket> packet, SharedNodePointer sendingNode);
|
||||
void processAvatarBillboardPacket(QSharedPointer<NLPacket> packet, SharedNodePointer sendingNode);
|
||||
void processKillAvatar(QSharedPointer<NLPacket> packet, SharedNodePointer sendingNode);
|
||||
|
||||
private slots:
|
||||
void sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& oldUUID);
|
||||
|
||||
protected:
|
||||
AvatarHashMap();
|
||||
|
||||
|
|
|
@ -14,12 +14,10 @@
|
|||
|
||||
#include <OctreeEditPacketSender.h>
|
||||
|
||||
#include <PacketListener.h>
|
||||
|
||||
#include "EntityItem.h"
|
||||
|
||||
/// Utility for processing, packing, queueing and sending of outbound edit voxel messages.
|
||||
class EntityEditPacketSender : public OctreeEditPacketSender, public PacketListener {
|
||||
class EntityEditPacketSender : public OctreeEditPacketSender {
|
||||
Q_OBJECT
|
||||
public:
|
||||
EntityEditPacketSender();
|
||||
|
|
|
@ -22,14 +22,13 @@
|
|||
#include "HifiSockAddr.h"
|
||||
#include "NetworkPeer.h"
|
||||
#include "NLPacket.h"
|
||||
#include "PacketListener.h"
|
||||
|
||||
const unsigned short DEFAULT_DOMAIN_SERVER_PORT = 40102;
|
||||
const unsigned short DEFAULT_DOMAIN_SERVER_DTLS_PORT = 40103;
|
||||
const quint16 DOMAIN_SERVER_HTTP_PORT = 40100;
|
||||
const quint16 DOMAIN_SERVER_HTTPS_PORT = 40101;
|
||||
|
||||
class DomainHandler : public QObject, public PacketListener {
|
||||
class DomainHandler : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
DomainHandler(QObject* parent = 0);
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "NLPacket.h"
|
||||
#include "udt/PacketHeaders.h"
|
||||
#include "PacketReceiver.h"
|
||||
#include "PacketListener.h"
|
||||
#include "NLPacketList.h"
|
||||
#include "UUIDHasher.h"
|
||||
|
||||
|
@ -74,7 +73,7 @@ namespace PingType {
|
|||
const PingType_t Symmetric = 3;
|
||||
}
|
||||
|
||||
class LimitedNodeList : public QObject, public Dependency, public PacketListener {
|
||||
class LimitedNodeList : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
public:
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// PacketListener.cpp
|
||||
// libraries/networking/src
|
||||
//
|
||||
// Created by Stephen Birarda on 07/14/15.
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "PacketListener.h"
|
||||
|
||||
#include "NodeList.h"
|
||||
|
||||
PacketListener::~PacketListener() {
|
||||
auto limitedNodelist = DependencyManager::get<LimitedNodeList>();
|
||||
if (limitedNodelist) {
|
||||
limitedNodelist->getPacketReceiver().unregisterListener(this);
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
//
|
||||
// PacketListener.h
|
||||
// libraries/networking/src
|
||||
//
|
||||
// Created by Stephen Birarda on 07/14/15.
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_PacketListener_h
|
||||
#define hifi_PacketListener_h
|
||||
|
||||
#pragma once
|
||||
|
||||
class PacketListener {
|
||||
public:
|
||||
virtual ~PacketListener();
|
||||
};
|
||||
|
||||
#endif // hifi_PacketListener_h
|
|
@ -24,7 +24,7 @@ PacketReceiver::PacketReceiver(QObject* parent) :
|
|||
qRegisterMetaType<QSharedPointer<NLPacket>>();
|
||||
}
|
||||
|
||||
bool PacketReceiver::registerListenerForTypes(const QSet<PacketType::Value>& types, PacketListener* listener, const char* slot) {
|
||||
bool PacketReceiver::registerListenerForTypes(const QSet<PacketType::Value>& types, QObject* listener, const char* slot) {
|
||||
QSet<PacketType::Value> nonSourcedTypes;
|
||||
QSet<PacketType::Value> sourcedTypes;
|
||||
|
||||
|
@ -36,14 +36,13 @@ bool PacketReceiver::registerListenerForTypes(const QSet<PacketType::Value>& typ
|
|||
}
|
||||
}
|
||||
|
||||
QObject* object = dynamic_cast<QObject*>(listener);
|
||||
Q_ASSERT(object);
|
||||
Q_ASSERT(listener);
|
||||
|
||||
if (nonSourcedTypes.size() > 0) {
|
||||
QMetaMethod nonSourcedMethod = matchingMethodForListener(*nonSourcedTypes.begin(), object, slot);
|
||||
QMetaMethod nonSourcedMethod = matchingMethodForListener(*nonSourcedTypes.begin(), listener, slot);
|
||||
if (nonSourcedMethod.isValid()) {
|
||||
foreach(PacketType::Value type, nonSourcedTypes) {
|
||||
registerVerifiedListener(type, object, nonSourcedMethod);
|
||||
registerVerifiedListener(type, listener, nonSourcedMethod);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
|
@ -51,10 +50,10 @@ bool PacketReceiver::registerListenerForTypes(const QSet<PacketType::Value>& typ
|
|||
}
|
||||
|
||||
if (sourcedTypes.size() > 0) {
|
||||
QMetaMethod sourcedMethod = matchingMethodForListener(*sourcedTypes.begin(), object, slot);
|
||||
QMetaMethod sourcedMethod = matchingMethodForListener(*sourcedTypes.begin(), listener, slot);
|
||||
if (sourcedMethod.isValid()) {
|
||||
foreach(PacketType::Value type, sourcedTypes) {
|
||||
registerVerifiedListener(type, object, sourcedMethod);
|
||||
registerVerifiedListener(type, listener, sourcedMethod);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
|
@ -66,7 +65,7 @@ bool PacketReceiver::registerListenerForTypes(const QSet<PacketType::Value>& typ
|
|||
|
||||
|
||||
void PacketReceiver::registerDirectListenerForTypes(const QSet<PacketType::Value>& types,
|
||||
PacketListener* listener, const char* slot) {
|
||||
QObject* listener, const char* slot) {
|
||||
// just call register listener for types to start
|
||||
bool success = registerListenerForTypes(types, listener, slot);
|
||||
if (success) {
|
||||
|
@ -79,14 +78,13 @@ void PacketReceiver::registerDirectListenerForTypes(const QSet<PacketType::Value
|
|||
}
|
||||
}
|
||||
|
||||
bool PacketReceiver::registerListener(PacketType::Value type, PacketListener* listener, const char* slot) {
|
||||
QObject* object = dynamic_cast<QObject*>(listener);
|
||||
Q_ASSERT(object);
|
||||
bool PacketReceiver::registerListener(PacketType::Value type, QObject* listener, const char* slot) {
|
||||
Q_ASSERT(listener);
|
||||
|
||||
QMetaMethod matchingMethod = matchingMethodForListener(type, object, slot);
|
||||
QMetaMethod matchingMethod = matchingMethodForListener(type, listener, slot);
|
||||
|
||||
if (matchingMethod.isValid()) {
|
||||
registerVerifiedListener(type, object, matchingMethod);
|
||||
registerVerifiedListener(type, listener, matchingMethod);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -156,21 +154,19 @@ void PacketReceiver::registerVerifiedListener(PacketType::Value type, QObject* o
|
|||
}
|
||||
|
||||
// add the mapping
|
||||
_packetListenerMap[type] = ObjectMethodPair(object, slot);
|
||||
_packetListenerMap[type] = ObjectMethodPair(QPointer<QObject>(object), slot);
|
||||
|
||||
_packetListenerLock.unlock();
|
||||
|
||||
}
|
||||
|
||||
void PacketReceiver::unregisterListener(PacketListener* listener) {
|
||||
QObject* listenerObject = dynamic_cast<QObject*>(listener);
|
||||
|
||||
void PacketReceiver::unregisterListener(QObject* listener) {
|
||||
_packetListenerLock.lock();
|
||||
|
||||
auto it = _packetListenerMap.begin();
|
||||
|
||||
while (it != _packetListenerMap.end()) {
|
||||
if (it.value().first == listenerObject) {
|
||||
if (it.value().first == listener) {
|
||||
// this listener matches - erase it
|
||||
it = _packetListenerMap.erase(it);
|
||||
} else {
|
||||
|
@ -181,7 +177,7 @@ void PacketReceiver::unregisterListener(PacketListener* listener) {
|
|||
_packetListenerLock.unlock();
|
||||
|
||||
_directConnectSetMutex.lock();
|
||||
_directlyConnectedObjects.remove(listenerObject);
|
||||
_directlyConnectedObjects.remove(listener);
|
||||
_directConnectSetMutex.unlock();
|
||||
}
|
||||
|
||||
|
@ -268,6 +264,8 @@ void PacketReceiver::processDatagrams() {
|
|||
}
|
||||
|
||||
_packetListenerLock.lock();
|
||||
|
||||
bool listenerIsDead = false;
|
||||
|
||||
auto it = _packetListenerMap.find(packet->getType());
|
||||
|
||||
|
@ -301,27 +299,33 @@ void PacketReceiver::processDatagrams() {
|
|||
|
||||
static const QByteArray QSHAREDPOINTER_NODE_NORMALIZED = QMetaObject::normalizedType("QSharedPointer<Node>");
|
||||
static const QByteArray SHARED_NODE_NORMALIZED = QMetaObject::normalizedType("SharedNodePointer");
|
||||
|
||||
if (metaMethod.parameterTypes().contains(SHARED_NODE_NORMALIZED)) {
|
||||
success = metaMethod.invoke(listener.first,
|
||||
connectionType,
|
||||
Q_ARG(QSharedPointer<NLPacket>,
|
||||
QSharedPointer<NLPacket>(packet.release())),
|
||||
Q_ARG(SharedNodePointer, matchingNode));
|
||||
|
||||
} else if (metaMethod.parameterTypes().contains(QSHAREDPOINTER_NODE_NORMALIZED)) {
|
||||
success = metaMethod.invoke(listener.first,
|
||||
connectionType,
|
||||
Q_ARG(QSharedPointer<NLPacket>,
|
||||
QSharedPointer<NLPacket>(packet.release())),
|
||||
Q_ARG(QSharedPointer<Node>, matchingNode));
|
||||
|
||||
|
||||
// one final check on the QPointer before we go to invoke
|
||||
if (listener.first) {
|
||||
if (metaMethod.parameterTypes().contains(SHARED_NODE_NORMALIZED)) {
|
||||
success = metaMethod.invoke(listener.first,
|
||||
connectionType,
|
||||
Q_ARG(QSharedPointer<NLPacket>,
|
||||
QSharedPointer<NLPacket>(packet.release())),
|
||||
Q_ARG(SharedNodePointer, matchingNode));
|
||||
|
||||
} else if (metaMethod.parameterTypes().contains(QSHAREDPOINTER_NODE_NORMALIZED)) {
|
||||
success = metaMethod.invoke(listener.first,
|
||||
connectionType,
|
||||
Q_ARG(QSharedPointer<NLPacket>,
|
||||
QSharedPointer<NLPacket>(packet.release())),
|
||||
Q_ARG(QSharedPointer<Node>, matchingNode));
|
||||
|
||||
} else {
|
||||
success = metaMethod.invoke(listener.first,
|
||||
connectionType,
|
||||
Q_ARG(QSharedPointer<NLPacket>,
|
||||
QSharedPointer<NLPacket>(packet.release())));
|
||||
}
|
||||
} else {
|
||||
success = metaMethod.invoke(listener.first,
|
||||
connectionType,
|
||||
Q_ARG(QSharedPointer<NLPacket>,
|
||||
QSharedPointer<NLPacket>(packet.release())));
|
||||
listenerIsDead = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
emit dataReceived(NodeType::Unassigned, packet->getDataSize());
|
||||
|
||||
|
@ -335,7 +339,17 @@ void PacketReceiver::processDatagrams() {
|
|||
<< listener.first << "::" << qPrintable(listener.second.methodSignature());
|
||||
}
|
||||
|
||||
} else {
|
||||
listenerIsDead = true;
|
||||
}
|
||||
|
||||
if (listenerIsDead) {
|
||||
qDebug().nospace() << "Listener for packet" << packet->getType()
|
||||
<< " (" << qPrintable(nameForPacketType(packet->getType())) << ")"
|
||||
<< " has been destroyed. Removing from listener map.";
|
||||
it = _packetListenerMap.erase(it);
|
||||
}
|
||||
|
||||
} else {
|
||||
qWarning() << "No listener found for packet type " << nameForPacketType(packet->getType());
|
||||
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
#include <QtCore/QMetaMethod>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtCore/QSet>
|
||||
|
||||
#include "NLPacket.h"
|
||||
#include "udt/PacketHeaders.h"
|
||||
|
||||
class OctreePacketProcessor;
|
||||
class PacketListener;
|
||||
|
||||
class PacketReceiver : public QObject {
|
||||
Q_OBJECT
|
||||
|
@ -40,9 +40,9 @@ public:
|
|||
|
||||
void resetCounters() { _inPacketCount = 0; _inByteCount = 0; }
|
||||
|
||||
bool registerListenerForTypes(const QSet<PacketType::Value>& types, PacketListener* listener, const char* slot);
|
||||
bool registerListener(PacketType::Value type, PacketListener* listener, const char* slot);
|
||||
void unregisterListener(PacketListener* listener);
|
||||
bool registerListenerForTypes(const QSet<PacketType::Value>& types, QObject* listener, const char* slot);
|
||||
bool registerListener(PacketType::Value type, QObject* listener, const char* slot);
|
||||
void unregisterListener(QObject* listener);
|
||||
|
||||
public slots:
|
||||
void processDatagrams();
|
||||
|
@ -55,14 +55,14 @@ signals:
|
|||
private:
|
||||
// this is a brutal hack for now - ideally GenericThread / ReceivedPacketProcessor
|
||||
// should be changed to have a true event loop and be able to handle our QMetaMethod::invoke
|
||||
void registerDirectListenerForTypes(const QSet<PacketType::Value>& types, PacketListener* listener, const char* slot);
|
||||
void registerDirectListenerForTypes(const QSet<PacketType::Value>& types, QObject* listener, const char* slot);
|
||||
|
||||
bool packetVersionMatch(const NLPacket& packet);
|
||||
|
||||
QMetaMethod matchingMethodForListener(PacketType::Value type, QObject* object, const char* slot) const;
|
||||
void registerVerifiedListener(PacketType::Value type, QObject* listener, const QMetaMethod& slot);
|
||||
|
||||
using ObjectMethodPair = std::pair<QObject*, QMetaMethod>;
|
||||
using ObjectMethodPair = std::pair<QPointer<QObject>, QMetaMethod>;
|
||||
|
||||
QMutex _packetListenerLock;
|
||||
QHash<PacketType::Value, ObjectMethodPair> _packetListenerMap;
|
||||
|
|
|
@ -14,11 +14,9 @@
|
|||
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
#include "PacketListener.h"
|
||||
|
||||
#include "Assignment.h"
|
||||
|
||||
class ThreadedAssignment : public Assignment, public PacketListener {
|
||||
class ThreadedAssignment : public Assignment {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ThreadedAssignment(NLPacket& packet);
|
||||
|
|
|
@ -32,7 +32,7 @@ const QSet<PacketType::Value> NON_SOURCED_PACKETS = QSet<PacketType::Value>()
|
|||
<< DomainServerAddedNode
|
||||
<< ICEServerPeerInformation << ICEServerQuery << ICEServerHeartbeat
|
||||
<< ICEPing << ICEPingReply
|
||||
<< AssignmentClientStatus;
|
||||
<< AssignmentClientStatus << StopNode;
|
||||
|
||||
int arithmeticCodingValueFromBuffer(const char* checkValue) {
|
||||
if (((uchar) *checkValue) < 255) {
|
||||
|
|
|
@ -42,7 +42,7 @@ std::unique_ptr<Packet> PacketList::createPacketWithExtendedHeader() {
|
|||
// add the extended header to the front of the packet
|
||||
if (packet->write(_extendedHeader) == -1) {
|
||||
qDebug() << "Could not write extendedHeader in PacketList::createPacketWithExtendedHeader"
|
||||
<< "- make sure that _extendedHeader is not larger than the payload capacity.";
|
||||
<< "- make sure that _extendedHeader is not larger than the payload capacity.";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) {
|
|||
|
||||
// match the thread name to our object name
|
||||
_thread->setObjectName(objectName());
|
||||
_thread->setPriority(priority);
|
||||
|
||||
// when the worker thread is started, call our engine's run..
|
||||
connect(_thread, SIGNAL(started()), this, SLOT(threadRoutine()));
|
||||
|
@ -44,6 +43,8 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) {
|
|||
|
||||
// Starts an event loop, and emits _thread->started()
|
||||
_thread->start();
|
||||
|
||||
_thread->setPriority(priority);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue