Add Terraria player detection via log parsing
All checks were successful
Deploy GSM / deploy (push) Successful in 27s

- Add getTerrariaPlayers function in ssh.js for PM2 log parsing
- Support German and English join/leave messages
- Update rcon.js to use Terraria log parsing
- Add Terraria to player fetch conditions in servers.js
- Update autoshutdown.js and discordBot.js for Terraria support
- Update config path to tModLoader directory
- Add global error handlers in server.js
- Update CLAUDE.md with deployment rules and Terraria info

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-16 21:38:32 +01:00
parent c010065963
commit df390e63e4
7 changed files with 90 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
import { Rcon } from 'rcon-client';
import { getHytalePlayers } from './ssh.js';
import { getHytalePlayers, getTerrariaPlayers } from './ssh.js';
const rconConnections = new Map();
const playerCache = new Map();
@@ -114,6 +114,10 @@ export async function getPlayers(server) {
// Use log parsing for Hytale (no RCON support)
const data = await getHytalePlayers(server);
result = { online: data.online, max: 32 };
} else if (server.type === 'terraria') {
// Use log parsing for Terraria (no RCON support)
const data = await getTerrariaPlayers(server);
result = { online: data.online, max: 8 };
}
playerCache.set(cacheKey, { data: result, time: Date.now() });
@@ -180,6 +184,10 @@ export async function getPlayerList(server) {
// Use log parsing for Hytale (no RCON support)
const data = await getHytalePlayers(server);
players = data.players || [];
} else if (server.type === 'terraria') {
// Use log parsing for Terraria (no RCON support)
const data = await getTerrariaPlayers(server);
players = data.players || [];
}
const result = { players };