fixed doSync bug, fixed connection problems, improved p2p sync method - still

there are some cases that may lead to inconsistencies. Currently, only the master-slave method is a reliable sync method
This commit is contained in:
DadaMonad
2015-02-05 10:46:40 +00:00
parent 58a479be9b
commit 3eb933400a
21 changed files with 631 additions and 330 deletions

View File

@@ -88,10 +88,18 @@ module.exports = function(HB) {
};
Operation.prototype.getUid = function() {
var map_uid;
if (this.uid.noOperation == null) {
return this.uid;
} else {
return this.uid.alt;
if (this.uid.alt != null) {
map_uid = this.uid.alt.cloneUid();
map_uid.sub = this.uid.sub;
map_uid.doSync = false;
return map_uid;
} else {
return void 0;
}
}
};

View File

@@ -66,17 +66,16 @@ module.exports = function(HB) {
};
MapManager.prototype.retrieveSub = function(property_name) {
var event_properties, event_this, map_uid, rm, rm_uid;
var event_properties, event_this, rm, rm_uid;
if (this.map[property_name] == null) {
event_properties = {
name: property_name
};
event_this = this;
map_uid = this.cloneUid();
map_uid.sub = property_name;
rm_uid = {
noOperation: true,
alt: map_uid
sub: property_name,
alt: this
};
rm = new types.ReplaceManager(event_properties, event_this, rm_uid);
this.map[property_name] = rm;