Lint
This commit is contained in:
parent
86275ef8ed
commit
223cd5a0aa
5 changed files with 18 additions and 19 deletions
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
parsed: true,
|
||||
json: data.json,
|
||||
type: data.type,
|
||||
subtype: `chipmunkmod_mcp`,
|
||||
subtype: 'chipmunkmod_mcp',
|
||||
uuid,
|
||||
message,
|
||||
nickname,
|
||||
|
|
|
@ -5,7 +5,7 @@ module.exports = {
|
|||
parsed: true,
|
||||
json: data.json,
|
||||
type: data.type,
|
||||
subtype: `generic_player`,
|
||||
subtype: 'generic_player',
|
||||
uuid: data.uuid,
|
||||
message: data.message,
|
||||
nickname: data.nickname,
|
||||
|
|
|
@ -2,20 +2,20 @@ const parsePlain = require('../../util/chatparse_plain.js')
|
|||
module.exports = {
|
||||
parse: (data, b) => {
|
||||
if (data.type === 'system' || data.type === 'legacy') {
|
||||
let subtype = `generic_system`
|
||||
let subtype = 'generic_system'
|
||||
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
|
||||
const parsed = parsePlain(data.json)
|
||||
const split = parsed.split(': ')
|
||||
const chatName = split.splice(0, 1)[0]
|
||||
const chatNameSplit = chatName.split(' ')
|
||||
|
||||
let uuid;
|
||||
let username;
|
||||
let nickname;
|
||||
if(data.uuid){
|
||||
uuid = data.uuid;
|
||||
username = b.findRealNameFromUUID(uuid);
|
||||
nickname = b.findDisplayName(uuid);
|
||||
let uuid
|
||||
let username
|
||||
let nickname
|
||||
if (data.uuid) {
|
||||
uuid = data.uuid
|
||||
username = b.findRealNameFromUUID(uuid)
|
||||
nickname = b.findDisplayName(uuid)
|
||||
} else {
|
||||
nickname = chatNameSplit[chatNameSplit.length - 1]
|
||||
username = b.findRealName(chatName)
|
||||
|
|
|
@ -2,7 +2,7 @@ const parsePlain = require('../../util/chatparse_plain.js')
|
|||
module.exports = {
|
||||
parse: (data, b) => {
|
||||
if (data.type === 'legacy') {
|
||||
let subtype = `vanilla_legacy`
|
||||
let subtype = 'vanilla_legacy'
|
||||
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
|
||||
if (data.json.translate === 'chat.type.text') { // Servers without Extras chat
|
||||
let message
|
||||
|
|
|
@ -27,19 +27,18 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
for (const uuid in buffer2) {
|
||||
|
||||
if (!b.players[uuid]) b.players[uuid] = { displayName: '', realName: '' }
|
||||
let displayName = "";
|
||||
let realName = "";
|
||||
if (buffer2[uuid].displayName){
|
||||
let displayName = ''
|
||||
let realName = ''
|
||||
if (buffer2[uuid].displayName) {
|
||||
displayName = buffer2[uuid].displayName
|
||||
b.players[uuid].displayName = buffer2[uuid].displayName
|
||||
}
|
||||
if (buffer2[uuid].realName){
|
||||
}
|
||||
if (buffer2[uuid].realName) {
|
||||
realName = buffer2[uuid].realName
|
||||
b.players[uuid].realName = buffer2[uuid].realName
|
||||
}
|
||||
b.emit("playerdata",uuid,displayName,realName)
|
||||
}
|
||||
b.emit('playerdata', uuid, displayName, realName)
|
||||
}
|
||||
})
|
||||
b.findUUID = (name) => {
|
||||
|
|
Loading…
Reference in a new issue