INNER CODE UNIT · JavaScript
subscribe
Dannark/BWO · bwo-server/core/game.js:48
function subscribe(observerFunction) {
observers.push(observerFunction)
}
function notifyAll(command) {
for (const observerFunction of observers) {
observerFunction(command)
}
}
const socketList = []
function addSocket(socket) {
socketList.push(socket)
}
function removeSocket(id) {
delete socketList[id]
}
function notifyAllOnRangeOfPlayer(command, playerId, ignoreSelf = false) {