Fix server management issues and improve overall stability

Major server management fixes:
- Replace Flatpak-specific pkill with universal process tree termination using pstree + process.kill()
- Fix signal format errors (SIGTERM/SIGKILL instead of TERM/KILL strings)
- Add 5-second cooldown after server stop to prevent race conditions with external detection
- Enable Stop Server button for external servers in UI
- Implement proper timeout handling with process tree killing

ContentDB improvements:
- Fix download retry logic and "closed" error by preventing concurrent zip extraction
- Implement smart root directory detection and stripping during package extraction
- Add game-specific timeout handling (8s for VoxeLibre vs 3s for simple games)

World creation fixes:
- Make world creation asynchronous to prevent browser hangs
- Add WebSocket notifications for world creation completion status

Other improvements:
- Remove excessive debug logging
- Improve error handling and user feedback throughout the application
- Clean up temporary files and unnecessary logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Nathan Schneider
2025-08-24 19:17:38 -06:00
parent 3aed09b60f
commit 2d3b1166fe
15 changed files with 851 additions and 536 deletions

View File

@@ -115,10 +115,10 @@ function updateStatusDisplay(status) {
statusText.textContent = 'Starting...';
}
// For external servers, disable control buttons
// For external servers, allow stop but disable start/restart
if (status.isExternal) {
startBtn.disabled = true;
stopBtn.disabled = true;
stopBtn.disabled = false; // Allow stopping external servers
restartBtn.disabled = true;
consoleInputGroup.style.display = 'none';
} else {
@@ -205,9 +205,7 @@ async function loadWorlds() {
if (worlds.length === 0) {
worldSelect.innerHTML =
'<option value="">No worlds found - server will create default world</option>' +
'<option value="" disabled>───────────────────</option>' +
'<option value="" disabled>💡 Create worlds in the Worlds section</option>';
'<option value="" disabled>No worlds found</option>';
} else {
worldSelect.innerHTML = '<option value="" disabled selected>Choose a world to run</option>';
worlds.forEach(world => {
@@ -626,4 +624,4 @@ async function downloadLogs() {
console.error('Download logs error:', error);
addLogEntry('error', 'Failed to download logs: ' + error.message);
}
}
}