INNER CODE UNIT · JavaScript

notifyAll

Dannark/BWO · bwo-server/core/game.js:52

    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) {
        //console.log(`> notifyAllOnRangeOfPlayer:`, command, `(${state.statistics.msgRecived}) `)
        var type = command.type;
        var allPlayers = getAllPlayersAround(playerId, ignoreSelf);
        command.action == undefined? delete command.action: null;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…