Implement configuration-based mod management and fix navigation spacing
## Major Features Added
### Configuration-Based Mod Management
- Implement proper Luanti mod system using load_mod_* entries in world.mt
- Add mod enable/disable via configuration instead of file copying
- Support both global mods (config-enabled) and world mods (physically installed)
- Clear UI distinction with badges: "Global (Enabled)", "World Copy", "Missing"
- Automatic registry verification to sync database with filesystem state
### Game ID Alias System
- Fix minetest_game/minetest technical debt with proper alias mapping
- Map minetest_game → minetest for world.mt files (matches Luanti internal behavior)
- Reference: c9d4c33174/src/content/subgames.cpp (L21)
### Navigation Improvements
- Fix navigation menu spacing and text overflow issues
- Change "Configuration" to "Config" for better fit
- Implement responsive font sizing with clamp() for better scaling
- Even distribution of nav buttons across full width
### Package Registry Enhancements
- Add verifyAndCleanRegistry() to automatically remove stale package entries
- Periodic verification (every 5 minutes) to keep registry in sync with filesystem
- Fix "already installed" errors for manually deleted packages
- Integration across dashboard, ContentDB, and installation workflows
## Technical Improvements
### Mod System Architecture
- Enhanced ConfigParser to handle load_mod_* entries in world.mt files
- Support for both configuration-based and file-based mod installations
- Proper mod type detection and management workflows
- Updated world details to show comprehensive mod information
### UI/UX Enhancements
- Responsive navigation with proper text scaling
- Improved mod management interface with clear action buttons
- Better visual hierarchy and status indicators
- Enhanced error handling and user feedback
### Code Quality
- Clean up gitignore to properly exclude runtime files
- Add package-lock.json for consistent dependency management
- Remove excess runtime database and log files
- Add .claude/ directory to gitignore
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -307,6 +307,7 @@ class ServerManager extends EventEmitter {
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
killProcessRecursive(pid, signal, callback) {
|
||||
const { spawn } = require('child_process');
|
||||
@@ -502,68 +503,39 @@ class ServerManager extends EventEmitter {
|
||||
|
||||
async createWorld(worldName, gameId = 'minetest_game') {
|
||||
try {
|
||||
const executableInfo = await this.findMinetestExecutable();
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
const worldPath = paths.getWorldPath(worldName);
|
||||
|
||||
// Create world using Luanti --world command
|
||||
// This will initialize the world properly with the correct structure
|
||||
const createWorldArgs = [
|
||||
'--world', worldPath,
|
||||
'--gameid', gameId,
|
||||
'--server',
|
||||
'--go', // Skip main menu
|
||||
'--quiet' // Reduce output
|
||||
];
|
||||
|
||||
this.addLogLine('info', `Creating world "${worldName}" with game "${gameId}"`);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const createProcess = spawn(executableInfo.command, [...executableInfo.args, ...createWorldArgs], {
|
||||
cwd: paths.minetestDir,
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
timeout: 30000 // 30 second timeout
|
||||
});
|
||||
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
|
||||
createProcess.stdout.on('data', (data) => {
|
||||
stdout += data.toString();
|
||||
});
|
||||
|
||||
createProcess.stderr.on('data', (data) => {
|
||||
stderr += data.toString();
|
||||
});
|
||||
|
||||
// Stop the server after a short time - we just want to initialize the world
|
||||
// Complex games like VoxeLibre/MineCLone2 need more time to initialize
|
||||
const timeout = gameId === 'mineclone2' || gameId.includes('clone') || gameId.includes('voxel') ? 8000 : 3000;
|
||||
this.addLogLine('info', `Using ${timeout}ms timeout for game: ${gameId}`);
|
||||
|
||||
setTimeout(() => {
|
||||
if (createProcess && !createProcess.killed) {
|
||||
createProcess.kill('SIGTERM');
|
||||
}
|
||||
}, timeout);
|
||||
|
||||
createProcess.on('close', (code) => {
|
||||
this.addLogLine('info', `World creation process finished with code: ${code}`);
|
||||
|
||||
// Check if world directory was created successfully
|
||||
if (fsSync.existsSync(worldPath)) {
|
||||
this.addLogLine('info', `World "${worldName}" created successfully`);
|
||||
resolve({ success: true, worldPath });
|
||||
} else {
|
||||
this.addLogLine('error', `World directory not created: ${worldPath}`);
|
||||
reject(new Error(`Failed to create world directory: ${worldPath}`));
|
||||
}
|
||||
});
|
||||
|
||||
createProcess.on('error', (error) => {
|
||||
this.addLogLine('error', `World creation failed: ${error.message}`);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
// Map game ID for world creation (e.g., minetest_game -> minetest)
|
||||
const worldGameId = paths.mapGameIdForWorldCreation(gameId);
|
||||
if (worldGameId !== gameId) {
|
||||
this.addLogLine('info', `Mapping game ID: ${gameId} -> ${worldGameId} for world.mt`);
|
||||
}
|
||||
|
||||
// Create world directory
|
||||
await fs.mkdir(worldPath, { recursive: true });
|
||||
|
||||
// Create only world.mt file - let Luanti create everything else
|
||||
const worldMtContent = `enable_damage = true
|
||||
creative_mode = false
|
||||
mod_storage_backend = sqlite3
|
||||
auth_backend = sqlite3
|
||||
player_backend = sqlite3
|
||||
backend = sqlite3
|
||||
gameid = ${worldGameId}
|
||||
world_name = ${worldName}
|
||||
server_announce = false
|
||||
`;
|
||||
|
||||
const worldMtPath = path.join(worldPath, 'world.mt');
|
||||
await fs.writeFile(worldMtPath, worldMtContent, 'utf8');
|
||||
|
||||
this.addLogLine('info', `World "${worldName}" created successfully`);
|
||||
|
||||
return { success: true, worldPath };
|
||||
|
||||
} catch (error) {
|
||||
this.addLogLine('error', `Failed to create world: ${error.message}`);
|
||||
|
Reference in New Issue
Block a user