mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-10 21:30:24 -04:00
Fix a scope leak which caused tests to fail. Fixes #20
This commit is contained in:
parent
ebc6af6a7e
commit
4a7b1e48cd
1 changed files with 2 additions and 1 deletions
3
index.js
3
index.js
|
@ -101,6 +101,7 @@ function createServer(options) {
|
|||
|
||||
function onHandshake(packet) {
|
||||
client.username = packet.username;
|
||||
var serverId;
|
||||
if (onlineMode) {
|
||||
serverId = crypto.randomBytes(4).toString('hex');
|
||||
} else {
|
||||
|
@ -110,7 +111,7 @@ function createServer(options) {
|
|||
client.verifyToken = crypto.randomBytes(4);
|
||||
var publicKeyStrArr = serverKey.toPublicPem("utf8").split("\n");
|
||||
var publicKeyStr = "";
|
||||
for (i=1;i<publicKeyStrArr.length - 2;i++) {
|
||||
for (var i=1;i<publicKeyStrArr.length - 2;i++) {
|
||||
publicKeyStr += publicKeyStrArr[i]
|
||||
}
|
||||
client.publicKey = new Buffer(publicKeyStr,'base64');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue