Read multiple packets per chunk
This commit is contained in:
parent
0403ace046
commit
61b667ac49
3 changed files with 10 additions and 6 deletions
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -9,7 +9,7 @@
|
|||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bufferstuff": "^1.3.4",
|
||||
"bufferstuff": "^1.4.2",
|
||||
"hsconsole": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -563,9 +563,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/bufferstuff": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/bufferstuff/-/bufferstuff-1.3.4.tgz",
|
||||
"integrity": "sha512-oBaMs5roIpkG242dWSoS38BWeVxlpTKVhRTRnGmZy5/6H+XU6YJMGa6jmPl7ychEnOqpuSA8wiq2k12zPt4BDA=="
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/bufferstuff/-/bufferstuff-1.4.2.tgz",
|
||||
"integrity": "sha512-iCULTXTrD9O4C06u+gjgQ3RtVNXAfxoBmQbAh1nMRO7QENVNuC/UvbFk25x/PDMA9yhdkJtfLo2dwxSJvEjlSg=="
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.2",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/tgpholly/mc-beta-server#readme",
|
||||
"dependencies": {
|
||||
"bufferstuff": "^1.3.4",
|
||||
"bufferstuff": "^1.4.2",
|
||||
"hsconsole": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -83,7 +83,11 @@ export class MPClient {
|
|||
case Packet.Animation: this.handlePacketAnimation(new PacketAnimation().readData(reader)); break;
|
||||
case Packet.EntityAction: this.handlePacketEntityAction(new PacketEntityAction().readData(reader)); break;
|
||||
case Packet.DisconnectKick: this.handleDisconnectKick(); break;
|
||||
default: Console.printWarn(`UNIMPLEMENTED PACKET: ${Packet[packetId]}`); break;
|
||||
default: return Console.printWarn(`UNIMPLEMENTED PACKET: ${Packet[packetId]}`);
|
||||
}
|
||||
|
||||
if (reader.readOffset < reader.length - 1) {
|
||||
this.handlePacket(reader);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue