updated connector functionality

This commit is contained in:
DadaMonad
2015-01-30 11:29:05 +00:00
parent 7c842efd52
commit cbcdebf33e
11 changed files with 529 additions and 80 deletions

View File

@@ -55,14 +55,12 @@ adaptConnector = function(connector, engine, HB, execution_listener) {
connector.getStateVector = getStateVector;
connector.getHB = getHB;
connector.applyHB = applyHB;
connector.whenReceiving(function(sender, op) {
connector.receive_handlers.push(function(sender, op) {
if (op.uid.creator !== HB.getUserId()) {
return engine.applyOp(op);
}
});
if (connector._whenBoundToY != null) {
return connector._whenBoundToY();
}
return connector.setIsBoundToY();
};
module.exports = adaptConnector;

View File

@@ -17,7 +17,7 @@ createY = function(connector) {
user_id = connector.id;
} else {
user_id = "_temp";
connector.whenUserIdSet(function(id) {
connector.onUserIdSet(function(id) {
user_id = id;
return HB.resetUserId(id);
});