server.js
// Subscribe a client to a room
Subscribe a client to a room
Subscribe a client to a room
function subscribe(socket, roomInput) {
  var room = roomInput;
  socket.join(room);
  allClients[socket.id] = room ;
  var project = projects.projects[room];
  if (!project) {
    console.log("made room");
    projects.projects[room] = {};
    projects.projects[room].external_paths = [];
    db.load(room, socket);
  } else { 
    loadFromMemory(room, socket);
  }
}
function subscribe ( socket , roomInput ) { var room = roomInput ; socket . join ( room ) ; allClients [ socket . id ] = room ; var project = projects . projects [ room ] ; if ( ! project ) { console . log ( "made room" ) ; projects . projects [ room ] = { } ; projects . projects [ room ] . external_paths = [ ] ; db . load ( room , socket ) ; } else { loadFromMemory ( room , socket ) ; } }
Subscribe a client to a room
Subscribe a client to a room
// Subscribe the client to the room // Use the view from the default project. This project is the default // one created when paper is instantiated. Nothing is ever written to // this project as each room has its own project. We share the View // object but that just helps it "draw" stuff to the invisible server // canvas. // Project exists in memory, no need to load from database