mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-04 18:33:32 -04:00
Merge pull request #340 from deathcap/connection-lost
Log when connection lost in client_echo example
This commit is contained in:
commit
77d4583d06
1 changed files with 3 additions and 0 deletions
|
@ -18,6 +18,9 @@ client.on('connect', function() {
|
|||
client.on('disconnect', function(packet) {
|
||||
console.log('disconnected: '+ packet.reason);
|
||||
});
|
||||
client.on('end', function(err) {
|
||||
console.log('Connection lost');
|
||||
});
|
||||
client.on('chat', function(packet) {
|
||||
var jsonMsg = JSON.parse(packet.message);
|
||||
if(jsonMsg.translate == 'chat.type.announcement' || jsonMsg.translate == 'chat.type.text') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue