package electrosphere.engine.loadingthreads;

import electrosphere.engine.Globals;
import electrosphere.logger.LoggerInterface;
import electrosphere.server.terrain.generation.OverworldChunkGenerator;
import electrosphere.server.terrain.manager.ServerTerrainManager;

public class ServerLoading {
    

    protected static void loadMainGameServer(Object[] params){
//initialize the terrain manager (server only)
//                if(Globals.RUN_SERVER){
//                    initServerGameTerrainManager();
//                }
        
        //TODO: Globals.serverTerrainManager = new ServerTerrainManager(2000,50,100,randomDampener,0);
        // Globals.serverTerrainManager = new ServerTerrainManager(2000,50,0.0f,0, new OverworldChunkGenerator());
        // SaveUtils.loadSave(Globals.currentSaveName);
        // LoadingUtils.initTerrainDataCellManager();
        //TODO: set spawnpoint
        //TODO: Globals.serverWorldData = ServerWorldData.createGameWorld(Globals.serverTerrainManager);
        //TODO: Globals.dataCellManager = new DataCellManager(Globals.serverWorldData);
//                    Globals.serverWorldData = ServerWorldData.createGameWorld(Globals.serverTerrainManager);
//                    Globals.dataCellManager = new DataCellManager(Globals.serverWorldData);
        LoggerInterface.loggerEngine.INFO("run server: " + Globals.RUN_SERVER + " run client: " + Globals.RUN_CLIENT);
        //init authentication
        LoadingUtils.initAuthenticationManager();
        //initialize the server thread (server only)
        LoadingUtils.initServerThread();
        //initialize the "virtual" objects simulation
        LoadingUtils.initMacroSimulation();
        //initialize the "real" objects simulation
        LoadingUtils.initMicroSimulation();
        //init game specific stuff (ie different skybox colors)
        LoadingUtils.initGameGraphicalEntities();
        //set simulations to ready if they exist
        LoadingUtils.setSimulationsToReady();
        //log
        LoggerInterface.loggerEngine.INFO("[Server]Finished loading main world");
    }

}
