more lastUpdated-ectomy

This commit is contained in:
ZappoMan 2013-12-18 17:03:53 -08:00
parent 1badc8dc5d
commit 8b1c39a471

View file

@ -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;