mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
fixed types
This commit is contained in:
parent
aacad00791
commit
34dc1a698e
3 changed files with 11 additions and 11 deletions
|
@ -79,7 +79,7 @@ bool ParticleServer::hasSpecialPacketToSend(Node* node) {
|
||||||
uint64_t deletedParticlesSentAt = nodeData->getLastDeletedParticlesSentAt();
|
uint64_t deletedParticlesSentAt = nodeData->getLastDeletedParticlesSentAt();
|
||||||
|
|
||||||
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
|
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
|
||||||
shouldSendDeletedParticles = tree->hasParitclesDeletedSince(deletedParticlesSentAt);
|
shouldSendDeletedParticles = tree->hasParticlesDeletedSince(deletedParticlesSentAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return shouldSendDeletedParticles;
|
return shouldSendDeletedParticles;
|
||||||
|
@ -99,7 +99,7 @@ int ParticleServer::sendSpecialPacket(Node* node) {
|
||||||
|
|
||||||
// TODO: is it possible to send too many of these packets? what if you deleted 1,000,000 particles?
|
// TODO: is it possible to send too many of these packets? what if you deleted 1,000,000 particles?
|
||||||
while (hasMoreToSend) {
|
while (hasMoreToSend) {
|
||||||
hasMoreToSend = tree->encodeParitclesDeletedSince(deletedParticlesSentAt,
|
hasMoreToSend = tree->encodeParticlesDeletedSince(deletedParticlesSentAt,
|
||||||
outputBuffer, MAX_PACKET_SIZE, packetLength);
|
outputBuffer, MAX_PACKET_SIZE, packetLength);
|
||||||
|
|
||||||
//qDebug() << "sending PACKET_TYPE_PARTICLE_ERASE packetLength:" << packetLength;
|
//qDebug() << "sending PACKET_TYPE_PARTICLE_ERASE packetLength:" << packetLength;
|
||||||
|
@ -118,7 +118,7 @@ int ParticleServer::sendSpecialPacket(Node* node) {
|
||||||
|
|
||||||
void ParticleServer::pruneDeletedParticles() {
|
void ParticleServer::pruneDeletedParticles() {
|
||||||
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
|
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
|
||||||
if (tree->hasAnyDeletedParitcles()) {
|
if (tree->hasAnyDeletedParticles()) {
|
||||||
|
|
||||||
//qDebug() << "there are some deleted particles to consider...";
|
//qDebug() << "there are some deleted particles to consider...";
|
||||||
uint64_t earliestLastDeletedParticlesSent = usecTimestampNow() + 1; // in the future
|
uint64_t earliestLastDeletedParticlesSent = usecTimestampNow() + 1; // in the future
|
||||||
|
@ -132,7 +132,7 @@ void ParticleServer::pruneDeletedParticles() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//qDebug() << "earliestLastDeletedParticlesSent=" << earliestLastDeletedParticlesSent;
|
//qDebug() << "earliestLastDeletedParticlesSent=" << earliestLastDeletedParticlesSent;
|
||||||
tree->forgetParitclesDeletedBefore(earliestLastDeletedParticlesSent);
|
tree->forgetParticlesDeletedBefore(earliestLastDeletedParticlesSent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ void ParticleTree::update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ParticleTree::hasParitclesDeletedSince(uint64_t sinceTime) {
|
bool ParticleTree::hasParticlesDeletedSince(uint64_t sinceTime) {
|
||||||
// we can probably leverage the ordered nature of QMultiMap to do this quickly...
|
// we can probably leverage the ordered nature of QMultiMap to do this quickly...
|
||||||
bool hasSomethingNewer = false;
|
bool hasSomethingNewer = false;
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ bool ParticleTree::hasParitclesDeletedSince(uint64_t sinceTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// sinceTime is an in/out parameter - it will be side effected with the last time sent out
|
// sinceTime is an in/out parameter - it will be side effected with the last time sent out
|
||||||
bool ParticleTree::encodeParitclesDeletedSince(uint64_t& sinceTime, unsigned char* outputBuffer, size_t maxLength,
|
bool ParticleTree::encodeParticlesDeletedSince(uint64_t& sinceTime, unsigned char* outputBuffer, size_t maxLength,
|
||||||
size_t& outputLength) {
|
size_t& outputLength) {
|
||||||
|
|
||||||
bool hasMoreToSend = true;
|
bool hasMoreToSend = true;
|
||||||
|
@ -389,7 +389,7 @@ bool ParticleTree::encodeParitclesDeletedSince(uint64_t& sinceTime, unsigned cha
|
||||||
}
|
}
|
||||||
|
|
||||||
// called by the server when it knows all nodes have been sent deleted packets
|
// called by the server when it knows all nodes have been sent deleted packets
|
||||||
void ParticleTree::forgetParitclesDeletedBefore(uint64_t sinceTime) {
|
void ParticleTree::forgetParticlesDeletedBefore(uint64_t sinceTime) {
|
||||||
_recentlyDeletedParticlesLock.lockForWrite();
|
_recentlyDeletedParticlesLock.lockForWrite();
|
||||||
QMultiMap<uint64_t, uint32_t>::const_iterator iterator = _recentlyDeletedParticleIDs.constBegin();
|
QMultiMap<uint64_t, uint32_t>::const_iterator iterator = _recentlyDeletedParticleIDs.constBegin();
|
||||||
while (iterator != _recentlyDeletedParticleIDs.constEnd()) {
|
while (iterator != _recentlyDeletedParticleIDs.constEnd()) {
|
||||||
|
|
|
@ -46,10 +46,10 @@ public:
|
||||||
void addNewlyCreatedHook(NewlyCreatedParticleHook* hook);
|
void addNewlyCreatedHook(NewlyCreatedParticleHook* hook);
|
||||||
void removeNewlyCreatedHook(NewlyCreatedParticleHook* hook);
|
void removeNewlyCreatedHook(NewlyCreatedParticleHook* hook);
|
||||||
|
|
||||||
bool hasAnyDeletedParitcles() const { return _recentlyDeletedParticleIDs.size() > 0; }
|
bool hasAnyDeletedParticles() const { return _recentlyDeletedParticleIDs.size() > 0; }
|
||||||
bool hasParitclesDeletedSince(uint64_t sinceTime);
|
bool hasParticlesDeletedSince(uint64_t sinceTime);
|
||||||
bool encodeParitclesDeletedSince(uint64_t& sinceTime, unsigned char* packetData, size_t maxLength, size_t& outputLength);
|
bool encodeParticlesDeletedSince(uint64_t& sinceTime, unsigned char* packetData, size_t maxLength, size_t& outputLength);
|
||||||
void forgetParitclesDeletedBefore(uint64_t sinceTime);
|
void forgetParticlesDeletedBefore(uint64_t sinceTime);
|
||||||
|
|
||||||
void processEraseMessage(const QByteArray& dataByteArray, const HifiSockAddr& senderSockAddr, Node* sourceNode);
|
void processEraseMessage(const QByteArray& dataByteArray, const HifiSockAddr& senderSockAddr, Node* sourceNode);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue