33 lines
703 B
JavaScript
33 lines
703 B
JavaScript
|
|
export const construct = (redisCnx) => {
|
|
}
|
|
|
|
export const methods = {
|
|
|
|
handleLifecycleEvent(msg) {
|
|
const srv = this.observerSrv
|
|
if(!srv) return
|
|
|
|
if(msg.eventType === 'onYourMarks') {
|
|
srv.onYourMarks()
|
|
return
|
|
}
|
|
|
|
if(msg.eventType === 'bigBang') {
|
|
srv.onBigBang()
|
|
}
|
|
},
|
|
|
|
dispatchArenaMessage(msg, chan) {
|
|
const observer = this.config.observer
|
|
if(!observer || !this.observerSrv) return(false)
|
|
|
|
if(this.matchesChan(chan, observer.lifecycle?.arenaChannel ?? 'arena:lifecycle')) {
|
|
this.handleLifecycleEvent(msg)
|
|
return(true)
|
|
}
|
|
return(false)
|
|
},
|
|
|
|
}
|