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,
|
parsed: true,
|
||||||
json: data.json,
|
json: data.json,
|
||||||
type: data.type,
|
type: data.type,
|
||||||
subtype: `chipmunkmod_mcp`,
|
subtype: 'chipmunkmod_mcp',
|
||||||
uuid,
|
uuid,
|
||||||
message,
|
message,
|
||||||
nickname,
|
nickname,
|
||||||
|
|
|
@ -5,7 +5,7 @@ module.exports = {
|
||||||
parsed: true,
|
parsed: true,
|
||||||
json: data.json,
|
json: data.json,
|
||||||
type: data.type,
|
type: data.type,
|
||||||
subtype: `generic_player`,
|
subtype: 'generic_player',
|
||||||
uuid: data.uuid,
|
uuid: data.uuid,
|
||||||
message: data.message,
|
message: data.message,
|
||||||
nickname: data.nickname,
|
nickname: data.nickname,
|
||||||
|
|
|
@ -2,20 +2,20 @@ const parsePlain = require('../../util/chatparse_plain.js')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
parse: (data, b) => {
|
parse: (data, b) => {
|
||||||
if (data.type === 'system' || data.type === 'legacy') {
|
if (data.type === 'system' || data.type === 'legacy') {
|
||||||
let subtype = `generic_system`
|
let subtype = 'generic_system'
|
||||||
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
|
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
|
||||||
const parsed = parsePlain(data.json)
|
const parsed = parsePlain(data.json)
|
||||||
const split = parsed.split(': ')
|
const split = parsed.split(': ')
|
||||||
const chatName = split.splice(0, 1)[0]
|
const chatName = split.splice(0, 1)[0]
|
||||||
const chatNameSplit = chatName.split(' ')
|
const chatNameSplit = chatName.split(' ')
|
||||||
|
|
||||||
let uuid;
|
let uuid
|
||||||
let username;
|
let username
|
||||||
let nickname;
|
let nickname
|
||||||
if(data.uuid){
|
if (data.uuid) {
|
||||||
uuid = data.uuid;
|
uuid = data.uuid
|
||||||
username = b.findRealNameFromUUID(uuid);
|
username = b.findRealNameFromUUID(uuid)
|
||||||
nickname = b.findDisplayName(uuid);
|
nickname = b.findDisplayName(uuid)
|
||||||
} else {
|
} else {
|
||||||
nickname = chatNameSplit[chatNameSplit.length - 1]
|
nickname = chatNameSplit[chatNameSplit.length - 1]
|
||||||
username = b.findRealName(chatName)
|
username = b.findRealName(chatName)
|
||||||
|
|
|
@ -2,7 +2,7 @@ const parsePlain = require('../../util/chatparse_plain.js')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
parse: (data, b) => {
|
parse: (data, b) => {
|
||||||
if (data.type === 'legacy') {
|
if (data.type === 'legacy') {
|
||||||
let subtype = `vanilla_legacy`
|
let subtype = 'vanilla_legacy'
|
||||||
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
|
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
|
||||||
if (data.json.translate === 'chat.type.text') { // Servers without Extras chat
|
if (data.json.translate === 'chat.type.text') { // Servers without Extras chat
|
||||||
let message
|
let message
|
||||||
|
|
|
@ -27,19 +27,18 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const uuid in buffer2) {
|
for (const uuid in buffer2) {
|
||||||
|
|
||||||
if (!b.players[uuid]) b.players[uuid] = { displayName: '', realName: '' }
|
if (!b.players[uuid]) b.players[uuid] = { displayName: '', realName: '' }
|
||||||
let displayName = "";
|
let displayName = ''
|
||||||
let realName = "";
|
let realName = ''
|
||||||
if (buffer2[uuid].displayName){
|
if (buffer2[uuid].displayName) {
|
||||||
displayName = buffer2[uuid].displayName
|
displayName = buffer2[uuid].displayName
|
||||||
b.players[uuid].displayName = buffer2[uuid].displayName
|
b.players[uuid].displayName = buffer2[uuid].displayName
|
||||||
}
|
}
|
||||||
if (buffer2[uuid].realName){
|
if (buffer2[uuid].realName) {
|
||||||
realName = buffer2[uuid].realName
|
realName = buffer2[uuid].realName
|
||||||
b.players[uuid].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) => {
|
b.findUUID = (name) => {
|
||||||
|
|
Loading…
Reference in a new issue