Packet Handling and the associated Plugins class only perform game logic via events
- (x) PluginHandler no longer spins up threads, but instead add a new subclass of GameTickEvent to the Server's EventHandler.
- (x) ServerEventHandler.addEvent will add GameStateEvents to a separate bucket and process that bucket first. This is to retain compatibility with current code, but does not necessarily need to be run before other types of Events.
- EventHandler will use multiple threads (cores*2) to process events from the queue. Both EventHandler queues will block until completion of all Events.
- (x) GameStateEvent and GameNotifyEvent add to profiling info generated by ServerEventHandler
- (x) GameLogger.java Thread.sleep() is converted to a thread executor service.
- (x) Thread.sleep() should not be called anywhere.
- Functions.sleep() should not exist at all. Delays should be done by waiting until the next invocation of the event.
- Server.post() should be removed
- GameStateUpdate.executeWalkToActions may need to occur at the beginning of the tick rather than the end.
Executor constructor to create the thread pools to perform Event work: new ThreadPoolExecutor(nThreads, nThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new NamedThreadFactory(threadName)); Then call executor.prestartAllCoreThreads
Use executor.invokeAll to block until all tasks are completed.