mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2024-11-14 19:04:59 -05:00
Change quit reasons to json as is now required in 1.9
This commit is contained in:
parent
74e4d415fb
commit
6bad0f8461
2 changed files with 5 additions and 4 deletions
|
@ -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.strictEqual(packet.reason, '{"text":"Failed to verify username!"}');
|
||||
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…
Reference in a new issue