Files
Ninjaserver/scripts/test-immediate-achievements.js
2025-09-23 14:13:24 +02:00

49 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Test Script für sofortige Achievements
*
* Testet die sofortige Achievement-Logik für einen einzelnen Spieler
*/
const AchievementSystem = require('../lib/achievementSystem');
require('dotenv').config();
async function testImmediateAchievements() {
console.log('⚡ Starte sofortige Achievement-Test...\n');
try {
const achievementSystem = new AchievementSystem();
// Lade Achievements
console.log('📋 Lade Achievements...');
await achievementSystem.loadAchievements();
// Teste mit einem spezifischen Spieler (Carsten Graf)
const testPlayerId = '313ceee3-8040-44b4-98d2-e63703579e5d';
console.log(`\n🎯 Teste sofortige Achievements für Spieler ${testPlayerId}...`);
const newAchievements = await achievementSystem.checkImmediateAchievements(testPlayerId);
// Zeige Ergebnisse
console.log('\n📊 Sofortige Achievement-Test Ergebnisse:');
console.log(` 🏆 ${newAchievements.length} neue sofortige Achievements vergeben`);
if (newAchievements.length > 0) {
console.log('\n📋 Neue sofortige Achievements:');
newAchievements.forEach(achievement => {
console.log(` ${achievement.icon} ${achievement.name} (+${achievement.points} Punkte)`);
});
} else {
console.log('\n Keine neuen sofortigen Achievements vergeben');
}
console.log('\n✅ Sofortige Achievement-Test erfolgreich abgeschlossen!');
} catch (error) {
console.error('❌ Test fehlgeschlagen:', error);
process.exit(1);
}
}
// Führe Test aus
testImmediateAchievements();