From 4bfb870fbbaa3eeefc04e6535af50360ff8ffc0a Mon Sep 17 00:00:00 2001 From: Alexander Zielonka Date: Sun, 11 Jan 2026 20:58:11 +0100 Subject: [PATCH] Add Palworld player count and list support via RCON - Add ShowPlayers RCON command handling for Palworld servers - Update SSH access documentation with jump host instructions Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 7 ++++++- gsm-backend/services/rcon.js | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 46870ab..e9ec5b5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -40,7 +40,12 @@ The homelab consists of: **Domain**: zeasy.dev with subdomains managed via Cloudflare DDNS (gsm.zeasy.dev, factorio.zeasy.dev, palworld.zeasy.dev, pz.zeasy.dev) -**SSH Access**: The monitor server (.30) has SSH key access to Proxmox and all game servers for remote management. +**SSH Access**: Zugriff auf Server erfolgt über den Pi als Jump-Host: +```bash +ssh alex@192.168.2.10 # Erst auf den Pi +ssh root@192.168.2.XX # Dann zum Zielserver (z.B. .53 für Palworld) +``` +Oder in einem Befehl: `ssh alex@192.168.2.10 "ssh root@192.168.2.53 'befehl'"` ## Language Note diff --git a/gsm-backend/services/rcon.js b/gsm-backend/services/rcon.js index 73e4643..9099b12 100644 --- a/gsm-backend/services/rcon.js +++ b/gsm-backend/services/rcon.js @@ -87,6 +87,11 @@ export async function getPlayers(server) { // Count lines that contain player info const lines = response.split('\n').filter(l => l.trim() && !l.includes('listusers')); result = { online: lines.length, max: null }; + } else if (server.type === 'palworld') { + const response = await sendRconCommand(server, 'ShowPlayers'); + // Format: "name,playeruid,steamid\nPlayer1,123,765...\nPlayer2,456,765..." + const lines = response.split('\n').filter(l => l.trim() && !l.toLowerCase().startsWith('name,')); + result = { online: lines.length, max: null }; } playerCache.set(cacheKey, { data: result, time: Date.now() }); @@ -145,6 +150,16 @@ export async function getPlayerList(server) { // Parse player names from listusers output const lines = response.split('\n').filter(l => l.trim() && !l.includes('listusers')); players = lines.map(l => l.trim()).filter(p => p); + } else if (server.type === 'palworld') { + const response = await sendRconCommand(server, 'ShowPlayers'); + // Format: "name,playeruid,steamid\nPlayer1,123,765...\nPlayer2,456,765..." + const lines = response.split('\n').filter(l => l.trim() && !l.toLowerCase().startsWith('name,')); + for (const line of lines) { + const parts = line.split(','); + if (parts.length >= 1 && parts[0].trim()) { + players.push(parts[0].trim()); + } + } } const result = { players };