import { ServerPackets , SERVER_PACKETS } from '@airbattle/protocol' ; import { CONNECTIONS_SEND_PACKETS , RESPONSE_SPECTATE_KILL } from '../../events' ; import { MainConnectionId , PlayerId } from '../../types' ; import { System } from '../system' ; export default class SpectateKillResponse extends System { constructor ( { app } ) { super ( { app } ) ; this . listeners = { [ RESPONSE_SPECTATE_KILL ] : this . onSpectateKill , } ; } param connectionId param playerId param posX param posY onSpectateKill ( connectionId , playerId , posX = 0 , posY = 0 ) { this . emit ( CONNECTIONS_SEND_PACKETS , { c : SERVER_PACKETS . PLAYER_KILL , id : playerId , killer : 0 , posX , posY , } as ServerPackets . PlayerKill , connectionId ) ; } }