mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
fix case hole in onlineModeExceptions
This commit is contained in:
parent
5cc7a8fbee
commit
acccaeefeb
@ -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
|
||||
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
|
||||
|
||||
### Not Immediately Obvious Data Type Formats
|
||||
|
4
index.js
4
index.js
@ -103,7 +103,7 @@ function createServer(options) {
|
||||
|
||||
function onHandshake(packet) {
|
||||
client.username = packet.username;
|
||||
var isException = !!server.onlineModeExceptions[client.username];
|
||||
var isException = !!server.onlineModeExceptions[client.username.toLowerCase()];
|
||||
var needToVerify = (onlineMode && ! isException) || (! onlineMode && isException);
|
||||
var serverId;
|
||||
if (needToVerify) {
|
||||
@ -148,7 +148,7 @@ function createServer(options) {
|
||||
});
|
||||
client.encryptionEnabled = true;
|
||||
|
||||
var isException = !!server.onlineModeExceptions[client.username];
|
||||
var isException = !!server.onlineModeExceptions[client.username.toLowerCase()];
|
||||
var needToVerify = (onlineMode && ! isException) || (! onlineMode && isException);
|
||||
var nextStep = needToVerify ? verifyUsername : loginClient;
|
||||
nextStep();
|
||||
|
Loading…
x
Reference in New Issue
Block a user