b2c715bd by Jabis Sevón

room creation

1 parent 33970cbd
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
22 return; 22 return;
23 } 23 }
24 to = setTimeout(flush, opt.wait || 1); 24 to = setTimeout(flush, opt.wait || 1);
25 var id = at['#'] 25 //var id = at['#']
26 ctx.on('in', {"@": id, ok:1}) 26 //ctx.on('in', {"@": id, ok:1})
27 }); 27 });
28 ctx.on('get', function(at){ 28 ctx.on('get', function(at){
29 console.log("get at",at,disk); 29 //console.log("get at",at,disk);
30 this.to.next(at); 30 this.to.next(at);
31 var lex = at.get, soul, data, opt, u; 31 var lex = at.get, soul, data, opt, u;
32 //setTimeout(function(){ 32 //setTimeout(function(){
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
47 47
48 var wait; 48 var wait;
49 var flush = function(){ 49 var flush = function(){
50 console.log("flushing",to); 50 //console.log("flushing",to);
51 if(wait){ return } 51 if(wait){ return }
52 wait = true; 52 wait = true;
53 clearTimeout(to); 53 clearTimeout(to);
......
...@@ -47,10 +47,9 @@ server.on("upgrade", async function(request, socket, head) { ...@@ -47,10 +47,9 @@ server.on("upgrade", async function(request, socket, head) {
47 let pathname = parsed.pathname || "/gun"; 47 let pathname = parsed.pathname || "/gun";
48 if (debug) console.log("Got WS request", pathname); 48 if (debug) console.log("Got WS request", pathname);
49 49
50 let roomname = pathname.split().slice(1).join("");
51 console.log("roomname",roomname);
52 var gun = { gun: false, server: false }; 50 var gun = { gun: false, server: false };
53 if (pathname) { 51 if (pathname) {
52 let roomname = pathname.split("").slice(1).join("");
54 if (lru.has(pathname)) { 53 if (lru.has(pathname)) {
55 // Existing Node 54 // Existing Node
56 if (debug) console.log("Recycle id", pathname); 55 if (debug) console.log("Recycle id", pathname);
...@@ -106,9 +105,10 @@ server.on("upgrade", async function(request, socket, head) { ...@@ -106,9 +105,10 @@ server.on("upgrade", async function(request, socket, head) {
106 }); 105 });
107 } else { 106 } else {
108 ;(async ()=>{ 107 ;(async ()=>{
108 Object.assign(obj,{passwordProtected:false});
109 let roomnode = g.get("rtcmeeting").get(roomname).put(obj); 109 let roomnode = g.get("rtcmeeting").get(roomname).put(obj);
110 let rack = await roomnode.then(); 110 let rack = await roomnode.then();
111 console.log("room created",ack); 111 console.log("room created",rack);
112 })() 112 })()
113 } 113 }
114 } 114 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!