mirror of
https://github.com/karl0ss/orvibo-b25-server-kex.git
synced 2025-04-29 12:53:40 +01:00
Add try-catch around packet decryption
This guards against a service crash resulting from an occasional packet decryption error.
This commit is contained in:
parent
4d0c98c97a
commit
ada0b42123
13
Orvibo.js
13
Orvibo.js
@ -147,10 +147,15 @@ Orvibo.prototype.startServer = function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugPacket.packetTypeText() === 'pk') {
|
try {
|
||||||
plugPacket.processPacket(ORVIBO_KEY);
|
if (plugPacket.packetTypeText() === 'pk') {
|
||||||
} else {
|
plugPacket.processPacket(ORVIBO_KEY);
|
||||||
plugPacket.processPacket(socketData.encryptionKey);
|
} else {
|
||||||
|
plugPacket.processPacket(socketData.encryptionKey);
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
logger.log('Failed to parse packet: ' + err);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_PACKET && plugPacket.logPacket('Socket -> ');
|
LOG_PACKET && plugPacket.logPacket('Socket -> ');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user