import { ServerPackets , SERVER_MESSAGE_TYPES , SERVER_PACKETS } from '@airbattle/protocol' ; import { CONNECTIONS_SEND_PACKETS , RESPONSE_SERVER_MESSAGE } from '../../events' ; import { MainConnectionId } from '../../types' ; import { System } from '../system' ; export default class ServerMessageResponse extends System { constructor ( { app } ) { super ( { app } ) ; this . listeners = { [ RESPONSE_SERVER_MESSAGE ] : this . onServerMessage , } ; } param connectionId param text param type param duration onServerMessage ( connectionId , text , type , duration ) { this . emit ( CONNECTIONS_SEND_PACKETS , { c : SERVER_PACKETS . SERVER_MESSAGE , type , duration , text , } as ServerPackets . ServerMessage , connectionId ) ; } }