Änderung: Hinzufügung des Taxi-Minispiels und zugehöriger Funktionen
Änderungen: - Integration des Taxi-Minispiels mit neuen Routen und Komponenten im Backend und Frontend. - Erstellung von Modellen und Datenbank-Schemas für das Taxi-Spiel, einschließlich TaxiGameState, TaxiLevelStats und TaxiMap. - Erweiterung der Navigationsstruktur und der Benutzeroberfläche, um das Taxi-Spiel und die zugehörigen Tools zu unterstützen. - Aktualisierung der Übersetzungen für das Taxi-Minispiel in Deutsch und Englisch. Diese Anpassungen erweitern die Funktionalität der Anwendung um ein neues Minispiel und verbessern die Benutzererfahrung durch neue Features und Inhalte.
This commit is contained in:
29
backend/utils/initializeTaxi.js
Normal file
29
backend/utils/initializeTaxi.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// initializeTaxi.js
|
||||
|
||||
import TaxiMapService from '../services/taxiMapService.js';
|
||||
|
||||
const initializeTaxi = async () => {
|
||||
try {
|
||||
console.log('Initializing Taxi game data...');
|
||||
|
||||
const taxiMapService = new TaxiMapService();
|
||||
|
||||
// Initialisiere Map-Typen
|
||||
console.log('Initializing taxi map types...');
|
||||
await taxiMapService.initializeMapTypes();
|
||||
|
||||
// Prüfe ob bereits eine Standard-Map existiert
|
||||
const existingDefaultMap = await taxiMapService.getDefaultMap();
|
||||
if (!existingDefaultMap) {
|
||||
console.log('Creating default taxi map...');
|
||||
await taxiMapService.createDefaultMap();
|
||||
}
|
||||
|
||||
console.log('Taxi game initialization complete.');
|
||||
} catch (error) {
|
||||
console.error('Error initializing Taxi game:', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
export default initializeTaxi;
|
||||
@@ -40,6 +40,7 @@ const createSchemas = async () => {
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS falukant_log');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS chat');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS match3');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS taxi');
|
||||
};
|
||||
|
||||
const initializeDatabase = async () => {
|
||||
|
||||
@@ -13,6 +13,7 @@ import initializeForum from './initializeForum.js';
|
||||
import initializeChat from './initializeChat.js';
|
||||
import initializeMatch3Data from './initializeMatch3.js';
|
||||
import updateExistingMatch3Levels from './updateExistingMatch3Levels.js';
|
||||
import initializeTaxi from './initializeTaxi.js';
|
||||
|
||||
// Normale Synchronisation (nur bei STAGE=dev Schema-Updates)
|
||||
const syncDatabase = async () => {
|
||||
@@ -70,6 +71,9 @@ const syncDatabase = async () => {
|
||||
console.log("Updating existing Match3 levels...");
|
||||
await updateExistingMatch3Levels();
|
||||
|
||||
console.log("Initializing Taxi...");
|
||||
await initializeTaxi();
|
||||
|
||||
console.log('Database synchronization complete.');
|
||||
} catch (error) {
|
||||
console.error('Unable to synchronize the database:', error);
|
||||
@@ -85,19 +89,7 @@ const syncDatabaseForDeployment = async () => {
|
||||
console.log('✅ Deployment-Modus: Schema-Updates sind immer aktiviert');
|
||||
|
||||
console.log("Initializing database schemas...");
|
||||
// Nur Schemas erstellen, keine Model-Synchronisation
|
||||
const { sequelize } = await import('./sequelize.js');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS community');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS logs');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS type');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS service');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS forum');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS falukant_data');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS falukant_type');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS falukant_predefine');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS falukant_log');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS chat');
|
||||
await sequelize.query('CREATE SCHEMA IF NOT EXISTS match3');
|
||||
await initializeDatabase();
|
||||
|
||||
console.log("Synchronizing models with schema updates...");
|
||||
await syncModelsAlways(models);
|
||||
@@ -137,6 +129,9 @@ const syncDatabaseForDeployment = async () => {
|
||||
console.log("Updating existing Match3 levels...");
|
||||
await updateExistingMatch3Levels();
|
||||
|
||||
console.log("Initializing Taxi...");
|
||||
await initializeTaxi();
|
||||
|
||||
console.log('Database synchronization for deployment complete.');
|
||||
} catch (error) {
|
||||
console.error('Unable to synchronize the database for deployment:', error);
|
||||
|
||||
Reference in New Issue
Block a user