fix case hole in onlineModeExceptions

This commit is contained in:
Andrew Kelley 2013-02-03 18:53:34 -05:00
parent 5cc7a8fbee
commit acccaeefeb
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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();