- 0
This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
TeenWolf
I have L2Lucera2 source:
i build server i start login all right
i start gameserver all right but in 2 sec start auto shutdown.
Look what message gives me:
and i have find this in shutdown.java
public class Shutdown extends Thread { private final static Logger _log = Logger.getLogger(Shutdown.class.getName()); private static Shutdown _instance; private static Shutdown _counterInstance = null; private int _secondsShut; private List<Runnable> _shutdownHandlers; private ShutdownModeType _shutdownMode; public enum ShutdownModeType { SIGTERM("shutdown"), SHUTDOWN("shutdown"), RESTART("restart"), ABORT("Aborting"); private final String _modeText; ShutdownModeType(String modeText) { _modeText = modeText; } public String getText() { return _modeText; } } public Shutdown() { _secondsShut = -1; _shutdownMode = ShutdownModeType.SIGTERM; _shutdownHandlers = new FastList<Runnable>(); } public static boolean isReady() { return _instance!=null; } public Shutdown(int seconds, ShutdownModeType mode) { if (seconds < 0) seconds = 0; _secondsShut = seconds; _shutdownMode = mode; } public static Shutdown getInstance() { if (_instance == null) { _instance = new Shutdown(); try { if(ShutdownModeType.ABORT.ordinal() == 0 || ShutdownModeType.RESTART.ordinal() == 0 || ShutdownModeType.SHUTDOWN.ordinal() == 0 || ShutdownModeType.SIGTERM.ordinal() == 0); } catch(Exception e ) { System.exit(0); } } return _instance; } public static Shutdown getCounterInstance() { return _counterInstance; } /** * Зарегистрировать обработчик "при выходе"<br> * @param r as Runnable - обработчик */ public void registerShutdownHandler(Runnable r) { if(!_shutdownHandlers.contains(r)) _shutdownHandlers.add(r); } /** * Убрать обработчик из цепочки<br> * @param r as Runnable - зарегистрированные ранее разработчик */ public void unregisterShutdownHandler(Runnable r) { if(_shutdownHandlers.contains(r)) _shutdownHandlers.remove(r); } @Override public void run() { if (this == _instance) { saveData(); // Вызов шатдаун-обработчиков. System.out.print("Executing shutdown hooks.."); int nhooks =0, nsuccess = 0; for(Runnable r : _shutdownHandlers) try { nhooks++; r.run(); System.out.print("."); nsuccess++; } catch(Exception e) { } System.out.println(nhooks+" total, "+nsuccess+ " successfully"); try { GameTimeController.getInstance().stopTimer(); } catch (Throwable t) { t.printStackTrace(); } System.out.println("GameTime controller stopped"); try { LoginServerThread.getInstance().interrupt(); } catch (Throwable t) { t.printStackTrace(); } System.out.println("Disconnected from login"); try { L2GameServer.getSelectorThread().shutdown(); } catch (Throwable t) { t.printStackTrace(); } System.out.println("Network disabled"); try { ThreadPoolManager.getInstance().shutdown(); } catch (Throwable t) { t.printStackTrace(); } SQLQueue.getInstance().run(); System.out.println("Disconnected from database"); try { if (_instance._shutdownMode == ShutdownModeType.RESTART) Runtime.getRuntime().halt(2); else Runtime.getRuntime().halt(0); } catch(Exception e) { Runtime.getRuntime().halt(0); } } else { countdown(); _log.info("Shutdown countdown is over. Shutdown or restart NOW!"); switch (_shutdownMode) { case SHUTDOWN: _instance.setMode(ShutdownModeType.SHUTDOWN); System.exit(0); break; case RESTART: _instance.setMode(ShutdownModeType.RESTART); System.exit(2); break; } }what i can do??? for fix that?
Edited by TeenWolf9 answers to this question
Recommended Posts