Files
fibonacci-fold/server/node_modules/mysql2/lib/commands/quit.js
Christian Medina d0e8d36c33
Some checks failed
Deploy to Firebase Hosting on merge / build_and_deploy (push) Has been cancelled
latest changes before server transfer
2025-08-05 15:42:36 -04:00

30 lines
575 B
JavaScript

'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;