mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-18 09:10:26 -04:00
fix case hole in onlineModeExceptions
This commit is contained in:
parent
5cc7a8fbee
commit
acccaeefeb
2 changed files with 4 additions and 2 deletions
|
@ -119,6 +119,8 @@ Returns a `Server` instance and starts listening.
|
||||||
This is a plain old JavaScript object. Add a key with the username you want to
|
This is a plain old JavaScript object. Add a key with the username you want to
|
||||||
be exempt from online mode or offline mode (whatever mode the server is in).
|
be exempt from online mode or offline mode (whatever mode the server is in).
|
||||||
|
|
||||||
|
Make sure the entries in this object are all lower case.
|
||||||
|
|
||||||
#### server.maxPlayers
|
#### server.maxPlayers
|
||||||
|
|
||||||
### Not Immediately Obvious Data Type Formats
|
### Not Immediately Obvious Data Type Formats
|
||||||
|
|
4
index.js
4
index.js
|
@ -103,7 +103,7 @@ function createServer(options) {
|
||||||
|
|
||||||
function onHandshake(packet) {
|
function onHandshake(packet) {
|
||||||
client.username = packet.username;
|
client.username = packet.username;
|
||||||
var isException = !!server.onlineModeExceptions[client.username];
|
var isException = !!server.onlineModeExceptions[client.username.toLowerCase()];
|
||||||
var needToVerify = (onlineMode && ! isException) || (! onlineMode && isException);
|
var needToVerify = (onlineMode && ! isException) || (! onlineMode && isException);
|
||||||
var serverId;
|
var serverId;
|
||||||
if (needToVerify) {
|
if (needToVerify) {
|
||||||
|
@ -148,7 +148,7 @@ function createServer(options) {
|
||||||
});
|
});
|
||||||
client.encryptionEnabled = true;
|
client.encryptionEnabled = true;
|
||||||
|
|
||||||
var isException = !!server.onlineModeExceptions[client.username];
|
var isException = !!server.onlineModeExceptions[client.username.toLowerCase()];
|
||||||
var needToVerify = (onlineMode && ! isException) || (! onlineMode && isException);
|
var needToVerify = (onlineMode && ! isException) || (! onlineMode && isException);
|
||||||
var nextStep = needToVerify ? verifyUsername : loginClient;
|
var nextStep = needToVerify ? verifyUsername : loginClient;
|
||||||
nextStep();
|
nextStep();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue