mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge branch 'atp' of https://github.com/birarda/hifi into protocol
This commit is contained in:
commit
d8f4b08ecc
4 changed files with 6 additions and 5 deletions
|
@ -41,7 +41,7 @@ std::unique_ptr<NLPacket> NLPacket::create(PacketType::Value type, qint64 size)
|
|||
packet = std::unique_ptr<NLPacket>(new NLPacket(type, size));
|
||||
}
|
||||
|
||||
packet->open(QIODevice::WriteOnly);
|
||||
packet->open(QIODevice::ReadWrite);
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ bool ReceivedPacketProcessor::process() {
|
|||
quint64 now = usecTimestampNow();
|
||||
quint64 sinceLastWindow = now - _lastWindowAt;
|
||||
|
||||
|
||||
if (sinceLastWindow > USECS_PER_SECOND) {
|
||||
lock();
|
||||
float secondsSinceLastWindow = sinceLastWindow / USECS_PER_SECOND;
|
||||
|
|
|
@ -24,7 +24,7 @@ qint64 Packet::maxPayloadSize(PacketType::Value type) {
|
|||
std::unique_ptr<Packet> Packet::create(PacketType::Value type, qint64 size) {
|
||||
auto packet = std::unique_ptr<Packet>(new Packet(type, size));
|
||||
|
||||
packet->open(QIODevice::WriteOnly);
|
||||
packet->open(QIODevice::ReadWrite);
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ Packet& Packet::operator=(const Packet& other) {
|
|||
_type = other._type;
|
||||
|
||||
_packetSize = other._packetSize;
|
||||
_packet = std::unique_ptr<char>(new char(_packetSize));
|
||||
_packet = std::unique_ptr<char>(new char[_packetSize]);
|
||||
memcpy(_packet.get(), other._packet.get(), _packetSize);
|
||||
|
||||
_payloadStart = _packet.get() + (other._payloadStart - other._packet.get());
|
||||
|
|
|
@ -20,6 +20,8 @@ JurisdictionListener::JurisdictionListener(NodeType_t type) :
|
|||
_nodeType(type),
|
||||
_packetSender(JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
|
||||
{
|
||||
setObjectName("Jurisdiction Listener");
|
||||
|
||||
connect(DependencyManager::get<NodeList>().data(), &NodeList::nodeKilled, this, &JurisdictionListener::nodeKilled);
|
||||
|
||||
// tell our NodeList we want to hear about nodes with our node type
|
||||
|
@ -34,7 +36,7 @@ void JurisdictionListener::nodeKilled(SharedNodePointer node) {
|
|||
|
||||
bool JurisdictionListener::queueJurisdictionRequest() {
|
||||
auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0);
|
||||
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
int nodeCount = 0;
|
||||
|
|
Loading…
Reference in a new issue