Renderer/src/main/java/electrosphere/server/MainServerFunctions.java
austin 8c0a7697d0
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
block synchronization
2024-06-18 18:41:33 -04:00

42 lines
1.3 KiB
Java

package electrosphere.server;
import electrosphere.engine.Globals;
import electrosphere.logger.LoggerInterface;
/**
* Functions that should be fired every server frame
*/
public class MainServerFunctions {
/**
* Calls the main server routines that should fire each frame
*/
public static void simulate(){
//
//Synchronous player message parsing\
Globals.profiler.beginCpuSample("Server synchronous packet parsing");
if(Globals.server != null){
Globals.server.synchronousPacketHandling();
}
Globals.profiler.endCpuSample();
//
//Micro simulation (ie simulating each scene on the server)
Globals.profiler.beginCpuSample("Server micro simulation");
LoggerInterface.loggerEngine.DEBUG("Begin server micro simulation");
if(Globals.realmManager != null){
Globals.realmManager.simulate();
}
//
//Macro simulation (ie simulating the larger world macro data)
LoggerInterface.loggerEngine.DEBUG("Server macro simulation");
if(Globals.macroSimulation != null && Globals.macroSimulation.isReady()){
Globals.macroSimulation.simulate();
}
Globals.profiler.endCpuSample();
}
}