This commit is contained in:
7cc5c4f330d47060 2024-09-19 23:27:19 -04:00
parent 86275ef8ed
commit 223cd5a0aa
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
5 changed files with 18 additions and 19 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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)

View file

@ -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

View file

@ -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) => {