mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08: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 = std::unique_ptr<NLPacket>(new NLPacket(type, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
packet->open(QIODevice::WriteOnly);
|
packet->open(QIODevice::ReadWrite);
|
||||||
|
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@ bool ReceivedPacketProcessor::process() {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
quint64 sinceLastWindow = now - _lastWindowAt;
|
quint64 sinceLastWindow = now - _lastWindowAt;
|
||||||
|
|
||||||
|
|
||||||
if (sinceLastWindow > USECS_PER_SECOND) {
|
if (sinceLastWindow > USECS_PER_SECOND) {
|
||||||
lock();
|
lock();
|
||||||
float secondsSinceLastWindow = sinceLastWindow / USECS_PER_SECOND;
|
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) {
|
std::unique_ptr<Packet> Packet::create(PacketType::Value type, qint64 size) {
|
||||||
auto packet = std::unique_ptr<Packet>(new Packet(type, size));
|
auto packet = std::unique_ptr<Packet>(new Packet(type, size));
|
||||||
|
|
||||||
packet->open(QIODevice::WriteOnly);
|
packet->open(QIODevice::ReadWrite);
|
||||||
|
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ Packet& Packet::operator=(const Packet& other) {
|
||||||
_type = other._type;
|
_type = other._type;
|
||||||
|
|
||||||
_packetSize = other._packetSize;
|
_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);
|
memcpy(_packet.get(), other._packet.get(), _packetSize);
|
||||||
|
|
||||||
_payloadStart = _packet.get() + (other._payloadStart - other._packet.get());
|
_payloadStart = _packet.get() + (other._payloadStart - other._packet.get());
|
||||||
|
|
|
@ -20,6 +20,8 @@ JurisdictionListener::JurisdictionListener(NodeType_t type) :
|
||||||
_nodeType(type),
|
_nodeType(type),
|
||||||
_packetSender(JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
|
_packetSender(JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
|
||||||
{
|
{
|
||||||
|
setObjectName("Jurisdiction Listener");
|
||||||
|
|
||||||
connect(DependencyManager::get<NodeList>().data(), &NodeList::nodeKilled, this, &JurisdictionListener::nodeKilled);
|
connect(DependencyManager::get<NodeList>().data(), &NodeList::nodeKilled, this, &JurisdictionListener::nodeKilled);
|
||||||
|
|
||||||
// tell our NodeList we want to hear about nodes with our node type
|
// 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() {
|
bool JurisdictionListener::queueJurisdictionRequest() {
|
||||||
auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0);
|
auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0);
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
int nodeCount = 0;
|
int nodeCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue