import { useUserinfoStore } from "@/stores/UserinfoStore" import { EngineContext } from '@/composables/useEngine' export function start(this: EngineContext): void { if (this.isActive && !this.shouldStop) { console.warn('attempt to start already running engine!') return } if (useUserinfoStore().isAdmin) { console.debug('user is admin, engine not started') return } this.isActive = true this.shouldStop = false this.isConnected.value = true this.fetchUpdate() console.log('start engine') } export function stop(this: EngineContext): void { if (this.isActive) { this.shouldStop = true this.isConnected.value = true console.log('shut down engine') } }