cree.js
function(user, stage, method){
		switch (method) {
			case 'withinRooms':
			
				var room = user.getRoom();
				if(stageCount(stage, room) == room.size) {
					console.log("Finished syncronising in " + room.name + ". Enough members in stage " + stage);
					
					// Once all members are present start experiment
					for(var key in room.getMembers(true)) {
						user = cloak.getUser(room.getMembers(true)[key].id);
						nextStage(user);
					}
				}
				break;
				
			case 'acrossRooms':
			default:
				if(stageCount(stage) == members.length) {
					console.log("Finished syncronising. Enough members in stage " + stage);

					// Once all members are present start experiment
					for(var key in members) {
						user = cloak.getUser(members[key]);
						nextStage(user);
					}
				}
				break;
		}
	}
function(user, stage, method){
		switch (method) {
			case 'withinRooms':
			
				var room = user.getRoom();
				if(stageCount(stage, room) == room.size) {
					console.log("Finished syncronising in " + room.name + ". Enough members in stage " + stage);
					
					// Once all members are present start experiment
					for(var key in room.getMembers(true)) {
						user = cloak.getUser(room.getMembers(true)[key].id);
						nextStage(user);
					}
				}
				break;
				
			case 'acrossRooms':
			default:
				if(stageCount(stage) == members.length) {
					console.log("Finished syncronising. Enough members in stage " + stage);

					// Once all members are present start experiment
					for(var key in members) {
						user = cloak.getUser(members[key]);
						nextStage(user);
					}
				}
				break;
		}
	}
function ( user , stage , method ) { switch ( method ) { case 'withinRooms' : var room = user . getRoom ( ) ; if ( stageCount ( stage , room ) == room . size ) { console . log ( "Finished syncronising in " + room . name + ". Enough members in stage " + stage ) ; // Once all members are present start experiment for ( var key in room . getMembers ( true ) ) { user = cloak . getUser ( room . getMembers ( true ) [ key ] . id ) ; nextStage ( user ) ; } } break ; case 'acrossRooms' : default : if ( stageCount ( stage ) == members . length ) { console . log ( "Finished syncronising. Enough members in stage " + stage ) ; // Once all members are present start experiment for ( var key in members ) { user = cloak . getUser ( members [ key ] ) ; nextStage ( user ) ; } } break ; } }
Syncronise user stages. E.g. wait for other users to catch up to the waiting stage.
Syncronise user stages . E . g . wait for other users to catch up to the waiting stage .