From d799adf9c0037a79d3233a1b4f60e8d8fe879c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Dietrich?= Date: Tue, 16 Jan 2024 22:13:23 +0100 Subject: [PATCH] automatic update --- docs/{index.6605109c.js => index.36aac70f.js} | 2 +- docs/{index.7fd13e38.js => index.d3d2c257.js} | 2 +- docs/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename docs/{index.6605109c.js => index.36aac70f.js} (99%) rename docs/{index.7fd13e38.js => index.d3d2c257.js} (99%) diff --git a/docs/index.6605109c.js b/docs/index.36aac70f.js similarity index 99% rename from docs/index.6605109c.js rename to docs/index.36aac70f.js index 8d5c6ce..c503788 100644 --- a/docs/index.6605109c.js +++ b/docs/index.36aac70f.js @@ -3476,7 +3476,7 @@ if(a[i]._gridId!==o._id){--d<1&&(eO(s)&&s(m.slice(0)),o._hasListeners(h)&&o._emi d.connected=!0,d.update("connected")}),this.p2pt.on("peerconnect",function(e){//console.warn('Peer connected : ' + peer.id, peer) d.peers[e.id]={peer:e,id:null},d.publishSetup(e.id)}),this.p2pt.on("peerclose",function(e){//console.warn('Peer disconnected : ' + peer) var t,n=null===(t=i.peers[e.id])||void 0===t?void 0:t.id;delete d.peers[e.id],n&&(n.startsWith("Station")?i.doc.transact(function(){var e=i.doc.getMap("users");e.delete(n),e.forEach(function(t,r){t.room===n&&(t.room="Lobby",e.set(r,t))}),i.doc.getMap("rooms").delete(n)}):i.doc.getMap("users").delete(n))}),this.p2pt.on("msg",function(e,t){// console.log(`Got message from ${peer.id} : ${JSON.stringify(msg)}`) -switch(t.topic){case"setup":var n=t.data,r=n.data,o=n.timestamp;od.timestamp.config&&(d.timestamp.config=o,d.data=r,d.update("setup"));break;case"setup-update":var a=t.data,s=a.data,c=a.timestamp;c>d.timestamp.config&&(d.timestamp.config=c,d.data=s,d.update("setup"));break;case"room":d.update("message",t.data.msg);break;case"room-join":if(t.id===i.peerID)break;i.peers[e.id]?d.peers[e.id].id=t.id:d.peers[e.id]={peer:e,id:t.id};var f=(0,u.decode)(t.data.config);t.data.timestampd.timestamp.config&&(d.timestamp.config=o,d.data=r,d.update("setup"));break;case"setup-update":var a=t.data,s=a.data,c=a.timestamp;c>d.timestamp.config&&(d.timestamp.config=c,d.data=s,d.update("setup"));break;case"room":d.update("message",t.data.msg);break;case"room-join":if(t.id===i.peerID)break;i.peers[e.id]?d.peers[e.id].id=t.id:d.peers[e.id]={peer:e,id:t.id};var f=(0,u.decode)(t.data.config);t.data.timestamp0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.doc.getMap("rooms"),r=this.doc.getMap("users");if(e&&(n.set("Lobby",d),t>0))for(var i=1;i<=t;i++)n.set("Room "+i,d);this.stationID&&(n.set(this.stationID,d),this.userSettings.room=this.stationID),r.set(this.peerID,this.userSettings);var o=this;this.observer=function(e){o.stationID?r.has(o.peerID)&&n.has(o.stationID)?(o.update("room"),o.enterClassroom("room-update")):o.doc.transact(function(){n.set(o.stationID,d),r.set(o.peerID,o.userSettings)}):r.has(o.peerID)?(o.update("room"),o.enterClassroom("room-update")):r.set(o.peerID,o.userSettings)},n.observe(this.observer),r.observe(this.observer)}},{key:"enterClassroom",value:function(e){this.broadcast({topic:e,data:{config:(0,u.encode)(l.encodeStateAsUpdate(this.doc)),timestamp:this.timestamp.join}})}}]),e}/* diff --git a/docs/index.7fd13e38.js b/docs/index.d3d2c257.js similarity index 99% rename from docs/index.7fd13e38.js rename to docs/index.d3d2c257.js index e3e0c54..cab183d 100644 --- a/docs/index.7fd13e38.js +++ b/docs/index.d3d2c257.js @@ -3548,7 +3548,7 @@ this.update("message",e.data.msg)}else for(let t in this.peers)try{this.p2pt.sen r.connected=!0,r.update("connected")}),this.p2pt.on("peerconnect",e=>{//console.warn('Peer connected : ' + peer.id, peer) r.peers[e.id]={peer:e,id:null},r.publishSetup(e.id)}),this.p2pt.on("peerclose",e=>{var t;//console.warn('Peer disconnected : ' + peer) let n=null===(t=this.peers[e.id])||void 0===t?void 0:t.id;delete r.peers[e.id],n&&(n.startsWith("Station")?this.doc.transact(()=>{let e=this.doc.getMap("users");e.delete(n),e.forEach((t,r)=>{t.room===n&&(t.room="Lobby",e.set(r,t))}),this.doc.getMap("rooms").delete(n)}):this.doc.getMap("users").delete(n))}),this.p2pt.on("msg",(e,t)=>{// console.log(`Got message from ${peer.id} : ${JSON.stringify(msg)}`) -switch(t.topic){case"setup":{let{data:e,timestamp:n}=t.data;nr.timestamp.config&&(r.timestamp.config=n,r.data=e,r.update("setup"));break}case"setup-update":{let{data:e,timestamp:n}=t.data;n>r.timestamp.config&&(r.timestamp.config=n,r.data=e,r.update("setup"));break}case"room":r.update("message",t.data.msg);break;case"room-join":{if(t.id===this.peerID)break;this.peers[e.id]?r.peers[e.id].id=t.id:r.peers[e.id]={peer:e,id:t.id};let n=(0,a.decode)(t.data.config);t.data.timestampr.timestamp.config&&(r.timestamp.config=n,r.data=e,r.update("setup"));break}case"setup-update":{let{data:e,timestamp:n}=t.data;n>r.timestamp.config&&(r.timestamp.config=n,r.data=e,r.update("setup"));break}case"room":r.update("message",t.data.msg);break;case"room-join":{if(t.id===this.peerID)break;this.peers[e.id]?r.peers[e.id].id=t.id:r.peers[e.id]={peer:e,id:t.id};let n=(0,a.decode)(t.data.config);t.data.timestampEdrys - Lite \ No newline at end of file +Edrys - Lite \ No newline at end of file