fix: packet type

This commit is contained in:
cha0s 2021-01-04 21:16:27 -06:00
parent c908a21f3a
commit 7f00af29e8
3 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ export default class SocketClient extends decorate(Class) {
debug(type);
this.emit(type, ...args);
}));
const Packets = Object.values(packets(this.latus).fromName);
const Packets = Object.values(packets(this.latus).fromType);
for (let i = 0; i < Packets.length; i++) {
const Packet = Packets[i];
const {id} = Packet;

View File

@ -11,7 +11,7 @@ export default {
createSocketServer(httpServer, latus);
},
'@latus/repl/context': (latus) => ({
Packets: packets(latus).fromName,
Packets: packets(latus).fromType,
sockets: latus.config['%sockets'],
}),
'@latus/socket/connect': (socket) => {

View File

@ -22,7 +22,7 @@ export default class ServerSocket extends decorate(Class) {
this.socket.emitPromise = promisify(precalc.emit.bind(precalc));
this.socket.joinPromise = promisify(this.socket.join.bind(this.socket));
this.socket.leavePromise = promisify(this.socket.leave.bind(this.socket));
const Packets = Object.entries(packets(latus).fromName);
const Packets = Object.entries(packets(latus).fromType);
for (let i = 0; i < Packets.length; i++) {
const [name, Packet] = Packets[i];
const {id} = Packet;