INNER CODE UNIT · JavaScript

removeSocket

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

    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;
        
        for (const skt of socketList) {
            if (allPlayers[skt.id] != undefined) {
                delete command.type
                skt.emit(type, command)
                
                state.statistics.msgSent ++
            }
        }
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…