session Id to distinguish participants without player name

citations
Fabien Benetou 9 months ago
parent 20dca36947
commit 898464c29b
  1. 6
      index.html

@ -98,11 +98,12 @@ function manualAnimate(selector="#biggu"){
)
}
let sessionId = self.crypto.randomUUID()
// see https://biggu-backend-collab.glitch.me/ to insure steps are done correctly
function shareLiveEvent(eventName, eventData, server='https://biggu-backend-collab.glitch.me/'){
if (!eventName) return
let data = {}
data.eventName = eventName
let data = { eventName, sessionId }
if (eventData) data.eventData = eventData
let playername = AFRAME.utils.getUrlParameter('playername')
if (playername) data.playername = playername
@ -197,6 +198,7 @@ AFRAME.registerComponent('start-with-supervision', {
const server='https://biggu-backend-collab.glitch.me'
// CORS enabled needed
const source = new EventSource(server+'/events');
shareLiveEvent('connected')
source.addEventListener('message', message => {
console.log('Got', message);

Loading…
Cancel
Save