mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 13:45:37 -04:00
Add packets to protocol and threshold to client
This commit is contained in:
parent
ba4d871984
commit
cfa30d9e1d
@ -30,6 +30,7 @@ function Client(isServer) {
|
|||||||
this.encryptionEnabled = false;
|
this.encryptionEnabled = false;
|
||||||
this.cipher = null;
|
this.cipher = null;
|
||||||
this.decipher = null;
|
this.decipher = null;
|
||||||
|
this.compressionThreshold = -1;
|
||||||
this.packetsToParse = {};
|
this.packetsToParse = {};
|
||||||
this.on('newListener', function(event, listener) {
|
this.on('newListener', function(event, listener) {
|
||||||
var direction = this.isServer ? 'toServer' : 'toClient';
|
var direction = this.isServer ? 'toServer' : 'toClient';
|
||||||
|
@ -58,6 +58,9 @@ var packets = {
|
|||||||
success: {id: 0x02, fields: [
|
success: {id: 0x02, fields: [
|
||||||
{ name: "uuid", type: "string" },
|
{ name: "uuid", type: "string" },
|
||||||
{ name: "username", type: "string" }
|
{ name: "username", type: "string" }
|
||||||
|
]},
|
||||||
|
compress: { id: 0x03, fields: [
|
||||||
|
{ name: "threshold", type: "varint"}
|
||||||
]}
|
]}
|
||||||
},
|
},
|
||||||
toServer: {
|
toServer: {
|
||||||
@ -534,6 +537,9 @@ var packets = {
|
|||||||
]},
|
]},
|
||||||
kick_disconnect: {id: 0x40, fields: [
|
kick_disconnect: {id: 0x40, fields: [
|
||||||
{ name: "reason", type: "string" }
|
{ name: "reason", type: "string" }
|
||||||
|
]},
|
||||||
|
compress: { id: 0x46, fields: [
|
||||||
|
{ name: "threshold", type: "varint"}
|
||||||
]}
|
]}
|
||||||
},
|
},
|
||||||
toServer: {
|
toServer: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user