This commit is contained in:
2026-01-07 02:41:37 +01:00
parent 4194f68968
commit 2bb4dd723c
15 changed files with 2753 additions and 12 deletions

View File

@@ -132,12 +132,12 @@ export async function getPlayerList(server) {
}
} else if (server.type === 'zomboid') {
const response = await sendRconCommand(server, 'players');
// Format: "Players connected (X):" or "Players connected (X): Player1, Player2"
const colonIndex = response.indexOf(':');
if (colonIndex !== -1) {
const playerPart = response.substring(colonIndex + 1).trim();
if (playerPart) {
players = playerPart.split(',').map(p => p.trim()).filter(p => p);
// Format: "Players connected (X): \n-Player1\n-Player2\n-Player3"
const lines = response.split('\n');
for (const line of lines) {
const trimmed = line.trim();
if (trimmed.startsWith('-')) {
players.push(trimmed.substring(1));
}
}
} else if (server.type === 'vrising') {