UNPKG

teeworlds-econ

Version:
18 lines (14 loc) 512 B
var debug, handleEnterMessage; debug = require('../utils').debug; handleEnterMessage = function(econ, message) { var matches; if (matches = /^\[game\]: team_join player='([0-9]+):(.+?)' team=([0-9-]+)$/.exec(message)) { debug.events('%s:%s econ %s event', econ.server.host, econ.server.port, 'enter'); return econ.emit('enter', { player: matches[2], team: parseInt(matches[3]), client: econ.getClientInfo(parseInt(matches[1])) }); } }; module.exports = handleEnterMessage;