File size: 534 Bytes
eee16fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import { ConnectionStateEnum } from '../../../core/enum/ConnectionStateEnum';
import Connection from '../../../core/interface/networking/Connection';
export default class AuthConnection extends Connection {
onHandshakeSuccess() {
this.logger.info('[HANDSHAKE] Finished');
this.setState(ConnectionStateEnum.AUTH);
}
send<T>(packet: T & { pack: () => Buffer; getName: () => string }) {
this.logger.debug(`[OUT][PACKET] name: ${packet.getName()}`);
this.socket.write(packet.pack());
}
}
|