mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 06:03:33 -04:00
Kick client when he is using the wrong version of the client, fix #209
This commit is contained in:
parent
f7e50721e8
commit
fdc24cbeed
@ -114,7 +114,7 @@ class Client extends EventEmitter
|
|||||||
|
|
||||||
end(reason) {
|
end(reason) {
|
||||||
this._endReason = reason;
|
this._endReason = reason;
|
||||||
this.socket.end();
|
if(this.socket) this.socket.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
setEncryption(sharedSecret) {
|
setEncryption(sharedSecret) {
|
||||||
|
@ -146,6 +146,10 @@ function createServer(options) {
|
|||||||
} else if(packet.nextState == 2) {
|
} else if(packet.nextState == 2) {
|
||||||
client.state = states.LOGIN;
|
client.state = states.LOGIN;
|
||||||
}
|
}
|
||||||
|
if(client.protocolVersion!=version.version)
|
||||||
|
{
|
||||||
|
client.end("Wrong protocol version, expected : "+version.version+" and you are using : "+client.protocolVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEncryptionKeyResponse(packet) {
|
function onEncryptionKeyResponse(packet) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user