/
astafievk
/
source_code
Обзор
Документация
Войти
/
astafievk
/
source_code
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Api/node_modules/mysql2/lib/commands/quit.js
29 строк
575 B
astafievK
source code
21 июн 2024, 21:02
21 июн 2024, 21:02
37a1d03
Код
Авторство
О чём код?
'use strict'; const Command = require('./command.js'); const CommandCode = require('../constants/commands.js'); const Packet = require('../packets/packet.js'); class Quit extends Command { constructor(callback) { super(); this.onResult = callback; } start(packet, connection) { connection._closing = true; const quit = new Packet( 0, Buffer.from([1, 0, 0, 0, CommandCode.QUIT]), 0, 5 ); if (this.onResult) { this.onResult(); } connection.writePacket(quit); return null; } } module.exports = Quit;