Daystodiewebapi.handleLogLine()

Figures out what happened during a log line

Used internally for logging, probably not useful outside this machinepack

Usage

Hover over inputs/exits for more info.

var Daystodiewebapi = require('machinepack-7daystodiewebapi');


// Figures out what happened during a log line

Daystodiewebapi.handleLogLine({

logLine: { date: '2017-11-14', time: '21:48:52', uptime: '25216.950', msg: 'Chat: \'Server\': test', trace: '', type: 'Log' },

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Log line entered was a chat message

chatMessage: function () {

 

},

// A player connected to the server

playerConnected: function () {

 

},

// A player disconnected from the server

playerDisconnected: function () {

 

},

// A player died.

playerDeath: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

logLine

{ date: '2017-11-14',
  time: '21:48:52',
  uptime: '25216.950',
  msg: 'Chat: \'Server\': test',
  trace: '',
  type: 'Log' }

Exits

error

An unexpected error occurred.

chatMessage

Log line entered was a chat message

playerConnected

A player connected to the server

playerDisconnected

A player disconnected from the server

playerDeath

A player died.

success

OK.