This commit is contained in:
Louis Mazin 2025-12-09 20:01:39 +01:00
parent 0b47c63ac1
commit 6928b7af55

View File

@ -14,7 +14,6 @@ let connectionTimestamp = null;
const parseLogMessage = (log) => {
// Format réel de log Palworld:
// [2025-12-09 13:28:23] [CHAT] <LouisMazin> !link X2NMAY
console.log(log)
const linkRegex = /\[.*?\]\s*\[CHAT\]\s*<(.+?)>\s*!lier\s+([A-Z0-9]{6})/i;
const match = log.match(linkRegex);
@ -31,11 +30,9 @@ const parseLogMessage = (log) => {
needsSteamId: true
};
}
console.log(log);
// Détecter les déconnexions: [2025-12-09 18:55:19] [LOG] Nami left the server. (User id: gdk_2535420062888893)
const disconnectRegex = /\[.*?\]\s*\[LOG\]\s*(.+?)\s+left the server\.\s*\(User id:\s*(.+?)\)/i;
const disconnectMatch = log.match(disconnectRegex);
console.log(disconnectMatch);
if (disconnectMatch) {
const playerName = disconnectMatch[1].trim();
const userId = disconnectMatch[2].trim();