mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
more lastUpdated-ectomy
This commit is contained in:
parent
1badc8dc5d
commit
8b1c39a471
1 changed files with 5 additions and 17 deletions
|
@ -119,20 +119,12 @@ bool ParticleTreeElement::updateParticle(const Particle& particle) {
|
|||
uint16_t numberOfParticles = _particles.size();
|
||||
for (uint16_t i = 0; i < numberOfParticles; i++) {
|
||||
if (_particles[i].getID() == particle.getID()) {
|
||||
//int difference = _particles[i].getLastUpdated() - particle.getLastUpdated();
|
||||
//bool localOlder = _particles[i].getLastUpdated() < particle.getLastUpdated();
|
||||
|
||||
bool changedOnServer = _particles[i].getLastEdited() < particle.getLastEdited();
|
||||
|
||||
if (changedOnServer /*|| localOlder*/) {
|
||||
|
||||
if (changedOnServer) {
|
||||
if (wantDebug) {
|
||||
/**
|
||||
printf("local particle [id:%d] %s and %s than server particle by %d, particle.isNewlyCreated()=%s\n",
|
||||
printf("local particle [id:%d] %s, particle.isNewlyCreated()=%s\n",
|
||||
particle.getID(), (changedOnServer ? "CHANGED" : "same"),
|
||||
(localOlder ? "OLDER" : "NEWER"),
|
||||
difference, debug::valueOf(particle.isNewlyCreated()) );
|
||||
**/
|
||||
debug::valueOf(particle.isNewlyCreated()) );
|
||||
}
|
||||
|
||||
uint64_t actuallyCreated = particle.getCreated();
|
||||
|
@ -143,13 +135,9 @@ bool ParticleTreeElement::updateParticle(const Particle& particle) {
|
|||
_particles[i].setCreated(actuallyCreated);
|
||||
} else {
|
||||
if (wantDebug) {
|
||||
/**
|
||||
printf(">>> NO CHANGE <<< -- local particle [id:%d] %s and %s than server particle by %d, "
|
||||
"particle.isNewlyCreated()=%s\n",
|
||||
printf(">>> NO CHANGE <<< -- local particle [id:%d] %s particle.isNewlyCreated()=%s\n",
|
||||
particle.getID(), (changedOnServer ? "CHANGED" : "same"),
|
||||
(localOlder ? "OLDER" : "NEWER"),
|
||||
difference, debug::valueOf(particle.isNewlyCreated()) );
|
||||
**/
|
||||
debug::valueOf(particle.isNewlyCreated()) );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue