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(); } }