TeenWolf Posted March 24, 2015 Posted March 24, 2015 (edited) 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 March 25, 2015 by TeenWolf
0 `iAndre Posted March 25, 2015 Posted March 25, 2015 help any1? ??? wtf this forum is dead? Dunno, what's the problem but why don't you ask Lucera team for support .. ?
0 TeenWolf Posted March 25, 2015 Author Posted March 25, 2015 Lucera no support anymore , and is not error i must remove a code and i need help :)
0 StealthyS4m Posted March 25, 2015 Posted March 25, 2015 Check your GameServer.java,maybe there is shutdown task for some reason.Or just try to search for keyword "shutdown" (CTRL+H and File Search)
0 TeenWolf Posted March 25, 2015 Author Posted March 25, 2015 (edited) package ru.catssoftware.gameserver; import com.lameguard.LameGuard; import org.apache.log4j.Logger; import ru.catssoftware.Config; import ru.catssoftware.L2DatabaseFactory; import ru.catssoftware.gameserver.datatables.CustomMessageHolder; import ru.catssoftware.gameserver.cache.CrestCache; import ru.catssoftware.gameserver.cache.HtmCache; import ru.catssoftware.gameserver.communitybbs.CommunityBoard; import ru.catssoftware.gameserver.datatables.*; import ru.catssoftware.gameserver.datatables.xml.*; import ru.catssoftware.gameserver.geodata.GeoData; import ru.catssoftware.gameserver.geodata.pathfinding.PathFinding; import ru.catssoftware.gameserver.gmaccess.gmCache; import ru.catssoftware.gameserver.gmaccess.gmController; import ru.catssoftware.gameserver.handler.*; import ru.catssoftware.gameserver.idfactory.IdFactory; import ru.catssoftware.gameserver.instancemanager.*; import ru.catssoftware.gameserver.instancemanager.clanhallsiege.*; import ru.catssoftware.gameserver.instancemanager.games.fishingChampionship; import ru.catssoftware.gameserver.instancemanager.grandbosses.*; import ru.catssoftware.gameserver.instancemanager.lastimperialtomb.LastImperialTombManager; import ru.catssoftware.gameserver.instancemanager.leaderboards.ArenaManager; import ru.catssoftware.gameserver.instancemanager.leaderboards.FishermanManager; import ru.catssoftware.gameserver.mmocore.SelectorConfig; import ru.catssoftware.gameserver.mmocore.SelectorThread; import ru.catssoftware.gameserver.model.*; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.actor.other.FriendData; import ru.catssoftware.gameserver.model.entity.Castle; import ru.catssoftware.gameserver.model.entity.Hero; import ru.catssoftware.gameserver.model.entity.events.*; import ru.catssoftware.gameserver.model.olympiad.Olympiad; import ru.catssoftware.gameserver.model.quest.QuestMessage; import ru.catssoftware.gameserver.model.restriction.ObjectRestrictions; import ru.catssoftware.gameserver.network.IOFloodManager; import ru.catssoftware.gameserver.network.L2GameClient; import ru.catssoftware.gameserver.network.L2GamePacketHandler; import ru.catssoftware.gameserver.network.daemons.SuperDeamon; import ru.catssoftware.gameserver.script.CoreScriptsLoader; import ru.catssoftware.gameserver.script.ExtensionLoader; import ru.catssoftware.gameserver.scripting.L2ScriptEngineManager; import ru.catssoftware.gameserver.taskmanager.*; import ru.catssoftware.gameserver.taskmanager.tasks.TaskPcCaffe; import ru.catssoftware.gameserver.threadmanager.DeadlockDetector; import ru.catssoftware.gameserver.util.PcAction; import ru.catssoftware.gameserver.util.Util; import ru.catssoftware.protection.CatsGuard; import ru.catssoftware.util.Console; import ru.catssoftware.util.concurrent.RunnableStatsManager; import java.io.*; import java.net.InetAddress; import java.net.URL; import java.net.URLConnection; import java.util.*; public class L2GameServer { private static final Logger _log = Logger.getLogger(L2GameServer.class); private static final Calendar _serverStarted = Calendar.getInstance(); private static SelectorThread<L2GameClient> _selectorThread; public static long _upTime = 0; public static double _intialTime = 0; public L2GameServer() throws Throwable { /* Предстартовая подготовка */ prepare(); /* Загрузка чат фильтра */ Console.printSection("Chat Filter"); Config.loadFilter(); CustomMessageHolder.load(); /* Инициализация базы данных */ Console.printSection("Database Engine"); L2DatabaseFactory.getInstance(); PcAction.clearRestartTask(); /* Вывод системной инфы */ Console.printSection("System Info"); Util.printGeneralSystemInfo(); Console.printSection("Scripting Engines"); L2ScriptEngineManager.getInstance(); /* Инициализация пулов */ Console.printSection("ThreadPool Manager"); ThreadPool(); /* Установка основго мира */ Console.printSection("Lineage 2 World"); ServerData.getInstance(); L2World.getInstance(); /* Запуск дедлок детектора */ Console.printSection("DeadLock Detector"); if (Config.DEADLOCKCHECK_INTERVAL > 0) DeadlockDetector.getInstance(); else _log.info("DeadlockDetector: Manager is disabled"); /* Создание карт мира */ Console.printSection("MapRegion Manager"); MapRegionManager.getInstance(); /* Загрузка анонсов */ Console.printSection("Announce Manager"); Announcements.getInstance(); /* ID Factory менеджер */ Console.printSection("ID Factory Manager"); if (!IdFactory.getInstance().isInitialized()) _log.fatal("IdFactory: Could not read object IDs from DB"); _log.info("IdFactory: Free ObjectID's remaining: " + IdFactory.getInstance().size()); /* Дополнительные треды */ RunnableStatsManager.getInstance(); /* Запуск движка геодаты */ Console.printSection("Geodata Engine"); GeoData.getInstance(); PathFinding.getInstance(); /* Загрузка статических объектов */ Console.printSection("Static Objects"); StaticObjects.getInstance(); /* Сервер менеджер, основные классы */ Console.printSection("Server Manager"); if (Config.ALT_ALLOW_AWAY_STATUS) AwayManager.getInstance(); GameTimeController.getInstance(); BoatManager.getInstance(); InstanceManager.getInstance(); /* Старт серверных задач */ Console.printSection("TaskManagers"); AttackStanceTaskManager.getInstance(); DecayTaskManager.getInstance(); KnownListUpdateTaskManager.getInstance(); LeakTaskManager.getInstance(); SQLQueue.getInstance(); /* Таблица телепортов */ Console.printSection("Teleport Table"); TeleportLocationTable.getInstance(); /* Загрузка скилов */ Console.printSection("Skills"); SkillTreeTable.getInstance(); SkillTable.getInstance(); AdditionalSkillTable.getInstance(); ResidentialSkillTable.getInstance(); PetSkillsTable.getInstance(); NobleSkillTable.getInstance(); HeroSkillTable.getInstance(); /* Загрущка итемов */ Console.printSection("Items"); ItemTable.getInstance(); ArmorSetsTable.getInstance(); AugmentationData.getInstance(); if (Config.SP_BOOK_NEEDED) SkillSpellbookTable.getInstance(); SummonItemsData.getInstance(); ExtractableItemsData.getInstance(); if (Config.ALLOW_FISHING) FishTable.getInstance(); ItemsOnGroundManager.getInstance(); if (Config.AUTODESTROY_ITEM_AFTER > 0 || Config.HERB_AUTO_DESTROY_TIME > 0) ItemsAutoDestroy.getInstance(); EnchantHPBonusData.getInstance(); /* Кэш HTML */ HtmCache.getInstance(); /* Данные персонажей */ FriendData.getInstance(); Console.printSection("Characters"); CharNameTable.getInstance(); CharTemplateTable.getInstance(); LevelUpData.getInstance(); HelperBuffTable.getInstance(); HennaTable.getInstance(); HennaTreeTable.getInstance(); if (Config.ALLOW_WEDDING) CoupleManager.getInstance(); ClanTable.getInstance(); CrestCache.getInstance(); Hero.getInstance(); BlockListManager.getInstance(); /* Загрузка всех НПЦ */ Console.printSection("NPC Stats"); NpcTable.getInstance(); NpcLikePcTemplates.getInstance(); PetDataTable.getInstance().loadPetsData(); /* Автоспавн и авто чат */ Console.printSection("Auto Handlers"); AutoChatHandler.getInstance(); AutoSpawnManager.getInstance(); /* Семь печатей */ Console.printSection("Seven Signs"); SevenSigns.getInstance(); SevenSignsFestival.getInstance(); /* Замки, форты, зоны */ Console.printSection("Entities and zones"); CrownManager.getInstance(); TownManager.getInstance(); ClanHallManager.getInstance(); DoorTable.getInstance(); CastleManager.getInstance(); SiegeManager.getInstance().load(); FortManager.getInstance(); FortSiegeManager.getInstance().load(); ZoneManager.getInstance(); MercTicketManager.getInstance(); DoorTable.getInstance().registerToClanHalls(); DoorTable.getInstance().setCommanderDoors(); /* Осады элитных КХ */ Console.printSection("Clan Hall Siege"); FortResistSiegeManager.load(); BanditStrongholdSiege.load(); DevastatedCastleSiege.load(); FortressOfDeadSiege.load(); WildBeastFarmSiege.load(); RainbowSpringSiege.load(); // make sure that all the scheduled siege dates are in the Seal Validation period for (Castle castle : CastleManager.getInstance().getCastles().values()) castle.getSiege().correctSiegeDateTime(); /* Квесты */ Console.printSection("Events/Script/CoreScript/Engine"); BufferHolder.getInstance().load(); QuestManager.getInstance(); CoreScriptsLoader.Register(); try { L2ScriptEngineManager.getInstance().loadScripts(); } catch (IOException ioe) { _log.fatal("Failed loading scripts, no script going to be loaded"); } QuestManager.getInstance().report(); EventsDropManager.getInstance(); EventDroplist.getInstance(); if (Config.ARENA_ENABLED) ArenaManager.getInstance().engineInit(); if (Config.FISHERMAN_ENABLED) FishermanManager.getInstance().engineInit(); if (Config.SHOW_NOT_REG_QUEST) QuestMessage.showNotRegQuest(); Console.printSection("HTML"); _log.info(HtmCache.getInstance()); /* Спавн, запуск спавна */ Console.printSection("Spawns"); SpawnTable.getInstance(); if (Config.JAIL_SPAWN_SYSTEM) JailSpawnTable.getInstance().loadJailSpawns(); if (Config.ALLOW_WEDDING) PcAction.spawnManager(); DayNightSpawnManager.getInstance().notifyChangeMode(); RaidBossSpawnManager.getInstance(); RaidPointsManager.init(); AutoChatHandler.getInstance(); AutoSpawnManager.getInstance(); /* Экономика */ Console.printSection("Economy"); CursedWeaponsManager.getInstance(); TradeListTable.getInstance(); CastleManorManager.getInstance(); L2Manor.getInstance(); AuctionManager.getInstance(); TimedItemControl.getInstance(); PartyRoomManager.getInstance(); /* Олимпиада */ Console.printSection("Olympiad"); Olympiad.getInstance(); Console.printSection("DimensionalRift"); DimensionalRiftManager.getInstance(); Console.printSection("FourSepulchers"); FourSepulchersManager.getInstance().init(); Console.printSection("Bosses"); QueenAntManager.getInstance().init(); ZakenManager.getInstance().init(); CoreManager.getInstance().init(); OrfenManager.getInstance().init(); SailrenManager.getInstance().init(); VanHalterManager.getInstance().init(); Console.printSection("GrandBosses"); AntharasManager.getInstance().init(); BaiumManager.getInstance().init(); ValakasManager.getInstance().init(); LastImperialTombManager.getInstance().init(); FrintezzaManager.getInstance().init(); Console.printSection("Factions Manager"); if (Config.FACTION_ENABLED) { FactionManager.getInstance(); FactionQuestManager.getInstance(); } else _log.info("Faction Manager: disabled."); Console.printSection("Handlers"); ItemHandler.getInstance(); SkillHandler.getInstance(); UserCommandHandler.getInstance(); VoicedCommandHandler.getInstance(); ChatHandler.getInstance(); Console.printSection("Misc"); ObjectRestrictions.getInstance(); L2SiegeStatus.getInstance(); TaskManager.getInstance(); GmListTable.getInstance(); PetitionManager.getInstance(); if (Config.ONLINE_PLAYERS_ANNOUNCE_INTERVAL > 0) OnlinePlayers.getInstance(); CommunityBoard.getInstance(); TimedItemControl.getInstance(); fishingChampionship.getInstance(); Console.printSection("Offline Service"); if (Config.ALLOW_OFFLINE_TRADE) OfflineManager.getInstance(); if (Config.RESTORE_OFFLINE_TRADERS) L2PcOffline.loadOffliners(); else L2PcOffline.clearOffliner(); Runtime.getRuntime().addShutdownHook(Shutdown.getInstance()); System.gc(); Console.printSection("ServerThreads"); LoginServerThread.getInstance().start(); L2GamePacketHandler gph = new L2GamePacketHandler(); final SelectorConfig<L2GameClient> sc = new SelectorConfig<L2GameClient>(gph); _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, IOFloodManager.getInstance()); _selectorThread.openServerSocket(InetAddress.getByName(Config.GAMESERVER_HOSTNAME), Config.PORT_GAME); _selectorThread.start(); Console.printSection("Daemons"); SuperDeamon.getInstance(); if(Config.PC_CAFFE_ENABLED) new TaskPcCaffe().schedule(Config.PC_CAFFE_INTERVAL*60000); Console.printSection("Events"); GameEventManager.getInstance(); Console.printSection("Mods"); Cristmas.startEvent(); EventMedals.startEvent(); StarlightFestival.startEvent(); L2day.startEvent(); BigSquash.startEvent(); Console.printSection("Gm System"); gmController.getInstance(); gmCache.getInstance(); Console.printSection("Extensions"); ExtensionLoader.getInstance(); CatsGuard.getInstance(); try { Class<?> clazz = Class.forName("com.lameguard.LameGuard"); if(clazz!=null) { File f = new File("./lameguard/lameguard.properties"); if(f.exists()) { Console.printSection("LameGuard"); LameGuard.main(new String []{"ru.catssoftware.protection.LameStub"}); } } } catch(Exception e) { } Console.printSection("Tasks Manager"); TaskManager.getInstance().startAllTasks(); onStartup(); System.gc(); printInfo(); } private static int[] avalibleEvents = null; private static String _license = null; private static int _revision = 0; private static String _releaseCandidate; private static String _releaseCandidate2; private static long _lastChangeBuild; public static void checkServer(int[] check) { if (avalibleEvents == null) avalibleEvents = check; } /** * Проверка на доступность эвента. * @param id * @return */ public static boolean isAvalible(int id) { if (avalibleEvents != null) for(int event : avalibleEvents) if (event == id) return true; return false; } public static void setRevision(int revision) { _revision = revision; try { URL url = new URL("http://lucera2.ru/rev.php?rev=" + L2PcInstance.checkClass()); URLConnection connection = url.openConnection(); connection.setConnectTimeout(5000); connection.addRequestProperty("User-Agent", _license); InputStream is = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = reader.readLine(); if (line != null) { StringTokenizer st = new StringTokenizer(line, " "); if (st.hasMoreTokens()) _releaseCandidate = st.nextToken(); if (st.hasMoreTokens()) _lastChangeBuild = Long.parseLong(st.nextToken()); } } catch (Exception e) { e.printStackTrace(); } try { URL url = new URL("http://lucera2.ru/rev.php?rev=" + revision); URLConnection connection = url.openConnection(); connection.setConnectTimeout(5000); connection.addRequestProperty("User-Agent", _license); InputStream is = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = reader.readLine(); if (line != null) { StringTokenizer st = new StringTokenizer(line, " "); if (st.hasMoreTokens()) { String next = st.nextToken(); _releaseCandidate2 = next.contains(".") ? next.split("\\.")[0] : next; } } } catch (Exception e) { e.printStackTrace(); } } public static int getRevision() { return _revision; } private static Set<StartupHook> _startupHooks = new HashSet<StartupHook>(); public synchronized static void addStartupHook(StartupHook hook) { if (_startupHooks != null) _startupHooks.add(hook); else hook.onStartup(); } private static void printInfo() { Console.printSection("Server Info"); long freeMem = (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory() + Runtime.getRuntime().freeMemory()) / 1048576; long totalMem = Runtime.getRuntime().maxMemory() / 1048576; double finalTime = System.currentTimeMillis(); _log.info("Free memory: " + freeMem + " Mb of " + totalMem + " Mb"); _log.info("Ready on IP: " + Config.EXTERNAL_HOSTNAME + ":" + Config.PORT_GAME + "."); _log.info("Max players: " + Config.MAXIMUM_ONLINE_USERS); _log.info("Load time: " + (int) ((finalTime - _intialTime) / 1000) + " Seconds."); if (_license != null) { Console.printSection("lucera2.ru"); _log.info("License: " + _license + " for RC " + _releaseCandidate2); _log.info("Release Candidate " + _releaseCandidate ); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(_lastChangeBuild * 1000); _log.info("Last build: " + calendar.getTime().toString() ); } else System.exit(1); Console.printSection(""); // set uptime _upTime = System.currentTimeMillis(); } private synchronized static void onStartup() { final Set<StartupHook> startupHooks = _startupHooks; _startupHooks = null; for (StartupHook hook : startupHooks) hook.onStartup(); } public interface StartupHook { public void onStartup(); } public static void printMemUsage() { Console.printSection("Memory"); for (String line : Util.getMemUsage()) _log.info(line); } public static SelectorThread<L2GameClient> getSelectorThread() { return _selectorThread; } public static Calendar getStartedTime() { return _serverStarted; } private void prepare() { System.setProperty("line.separator", "\r\n"); System.setProperty("file.encoding", "UTF-8"); System.setProperty("python.home", "."); if (Config.CHECK_SYSTEM_PARAM && System.getProperty("user.name").equals("root") && System.getProperty("user.home").equals("/root")) { _log.info("Servers can't run under root-account ... exited."); System.exit(-1); } _intialTime = System.currentTimeMillis(); } public static void setLicense(String name) { _license = name; } private void ThreadPool() { _log.info("ThreadPoolManager: Initializing."); ThreadPoolManager.getInstance(); _log.info("General threads: ..... " + Config.GENERAL_THREAD_POOL_SIZE + "."); _log.info("Effect threads: ...... " + Config.EFFECT_THREAD_POOL_SIZE + "."); _log.info("AI threads: .......... " + Config.AI_THREAD_POOL_SIZE + "."); _log.info("Packet threads: ...... " + Config.PACKET_THREAD_POOL_SIZE + "."); _log.info("Total threads: ....... " + Config.THREAD_POOL_SIZE + "."); } } this is my gameserver.java code Edited March 25, 2015 by TeenWolf
0 Tryskell Posted March 25, 2015 Posted March 25, 2015 (edited) According to where the pack stops (loading time), I would say it's because of licence system. if (_license != null) { Console.printSection("lucera2.ru"); _log.info("License: " + _license + " for RC " + _releaseCandidate2); _log.info("Release Candidate " + _releaseCandidate ); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(_lastChangeBuild * 1000); _log.info("Last build: " + calendar.getTime().toString() ); } else System.exit(1); Drop that section of code, and all occurences of _license wherever you find it (setter, potential use of setter, etc). Potentially, drop setRevision, associated variables and uses of it. You can also setLicence("Blabla") a random String just before the section of code. If it doesn't work, see first solution. Edited March 25, 2015 by Tryskell
0 TeenWolf Posted March 25, 2015 Author Posted March 25, 2015 can u check the source plz? i can pay for it
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
what i can do??? for fix that?
Edited by TeenWolf9 answers to this question
Recommended Posts