javascript/features/death_match/death_match_manager.js
// The player wants to join the death match.
The player wants to join the death match.
The player wants to join the death match .
goToDmZone(player, zone) {
        const zoneInfo = DeathMatchLocation.getById(zone);
        this.restoreDefaultPlayerStatus(player);
        player.activity = Player.PLAYER_ACTIVITY_JS_DM_ZONE;
        this.playersInDeathMatch_.set(player, zone);
        this.playerStats_.set(player, player.stats.snapshot());
        this.setPlayerTeam(player, zone);
        const targetLagCompensationMode = zoneInfo.lagShot ? 0 : 2;
        if (player.syncedData.lagCompensationMode !== targetLagCompensationMode)
            player.syncedData.lagCompensationMode = targetLagCompensationMode;
        player.sendMessage(Message.DEATH_MATCH_INSTRUCTION_LEAVE);
        player.sendMessage(Message.DEATH_MATCH_INSTRUCTION_STATS);
        this.announce_().announceToPlayers(Message.DEATH_MATCH_TELEPORTED, player.name, zone);
        player.respawn(); 
    }
goToDmZone ( player , zone ) { const zoneInfo = DeathMatchLocation . getById ( zone ) ; this . restoreDefaultPlayerStatus ( player ) ; player . activity = Player . PLAYER_ACTIVITY_JS_DM_ZONE ; this . playersInDeathMatch_ . set ( player , zone ) ; this . playerStats_ . set ( player , player . stats . snapshot ( ) ) ; this . setPlayerTeam ( player , zone ) ; const targetLagCompensationMode = zoneInfo . lagShot ? 0 : 2 ; if ( player . syncedData . lagCompensationMode !== targetLagCompensationMode ) player . syncedData . lagCompensationMode = targetLagCompensationMode ; player . sendMessage ( Message . DEATH_MATCH_INSTRUCTION_LEAVE ) ; player . sendMessage ( Message . DEATH_MATCH_INSTRUCTION_STATS ) ; this . announce_ ( ) . announceToPlayers ( Message . DEATH_MATCH_TELEPORTED , player . name , zone ) ; player . respawn ( ) ; }
The player wants to join the death match.
The player wants to join the death match .
// This will call onPlayerSpawn and spawn the player on the right spot.