mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
commit
c9b6ad8dbe
@ -25,6 +25,7 @@ Server.prototype.listen = function(port, host) {
|
||||
var client = new Client(true);
|
||||
client._end = client.end;
|
||||
client.end = function end(endReason) {
|
||||
endReason='{"text":"'+endReason+'"}';
|
||||
if(client.state === states.PLAY) {
|
||||
client.write('kick_disconnect', {reason: endReason});
|
||||
} else if(client.state === states.LOGIN) {
|
||||
|
@ -439,7 +439,7 @@ describe("client", function() {
|
||||
});
|
||||
var gotKicked = false;
|
||||
client.on([states.LOGIN, 0x00], function(packet) {
|
||||
assert.strictEqual(packet.reason, '"Failed to verify username!"');
|
||||
assert.ok(packet.reason.indexOf('"Failed to verify username!"')!=-1);
|
||||
gotKicked = true;
|
||||
});
|
||||
client.on('end', function() {
|
||||
@ -498,7 +498,7 @@ describe("mc-server", function() {
|
||||
var count = 2;
|
||||
server.on('connection', function(client) {
|
||||
client.on('end', function(reason) {
|
||||
assert.strictEqual(reason, "LoginTimeout");
|
||||
assert.strictEqual(reason, '{"text":"LoginTimeout"}');
|
||||
server.close();
|
||||
});
|
||||
});
|
||||
@ -527,7 +527,7 @@ describe("mc-server", function() {
|
||||
var count = 2;
|
||||
server.on('connection', function(client) {
|
||||
client.on('end', function(reason) {
|
||||
assert.strictEqual(reason, "KeepAliveTimeout");
|
||||
assert.strictEqual(reason, '{"text":"KeepAliveTimeout"}');
|
||||
server.close();
|
||||
});
|
||||
});
|
||||
@ -682,7 +682,7 @@ describe("mc-server", function() {
|
||||
var count = 2;
|
||||
server.on('login', function(client) {
|
||||
client.on('end', function(reason) {
|
||||
assert.strictEqual(reason, 'ServerShutdown');
|
||||
assert.strictEqual(reason, '{"text":"ServerShutdown"}');
|
||||
resolve();
|
||||
});
|
||||
client.write('login', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user