Advertisement
warc222

[Share] Time Load Npc Aka L2Off

Oct 6th, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. Index: java/net/sf/l2j/Config.java
  3. ===================================================================
  4. --- java/net/sf/l2j/Config.java (revision 1)
  5. +++ java/net/sf/l2j/Config.java (working copy)
  6. @@ -650,6 +650,8 @@
  7. public static int ZONE_TOWN;
  8. public static boolean DISABLE_TUTORIAL;
  9.  
  10. + public static long NPC_SERVER_DELAY;
  11. +
  12. // --------------------------------------------------
  13. // Those "hidden" settings haven't configs to avoid admins to fuck their server
  14. // You still can experiment changing values here. But don't say I didn't warn you.
  15. @@ -1258,6 +1260,8 @@
  16. ZONE_TOWN = server.getProperty("ZoneTown", 0);
  17. SERVER_NEWS = server.getProperty("ShowServerNews", false);
  18. DISABLE_TUTORIAL = server.getProperty("DisableTutorial", false);
  19. +
  20. + NPC_SERVER_DELAY = npcs.getProperty("npcServerDelay", 1);
  21. }
  22. else if (Server.serverMode == Server.MODE_LOGINSERVER)
  23. {
  24. Index: java/net/sf/l2j/gameserver/datatables/SpawnTable.java
  25. ===================================================================
  26. --- java/net/sf/l2j/gameserver/datatables/SpawnTable.java (revision 1)
  27. +++ java/net/sf/l2j/gameserver/datatables/SpawnTable.java (working copy)
  28. @@ -23,6 +23,7 @@
  29.  
  30. import net.sf.l2j.Config;
  31. import net.sf.l2j.L2DatabaseFactory;
  32. +import net.sf.l2j.gameserver.ThreadPoolManager;
  33. import net.sf.l2j.gameserver.instancemanager.DayNightSpawnManager;
  34. import net.sf.l2j.gameserver.model.L2Spawn;
  35. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  36. @@ -44,7 +45,7 @@
  37. protected SpawnTable()
  38. {
  39. if (!Config.ALT_DEV_NO_SPAWNS)
  40. - fillSpawnTable();
  41. + ThreadPoolManager.getInstance().scheduleGeneral(new NPCServerTask(), Config.NPC_SERVER_DELAY * 1000);
  42. }
  43.  
  44. public Set<L2Spawn> getSpawnTable()
  45. @@ -188,6 +189,17 @@
  46. fillSpawnTable();
  47. }
  48.  
  49. + class NPCServerTask implements Runnable
  50. + {
  51. + @SuppressWarnings("synthetic-access")
  52. + @Override
  53. + public void run()
  54. + {
  55. + fillSpawnTable();
  56. + _log.info("NPC Server: Task initialization...");
  57. + }
  58. + }
  59. +
  60. private static class SingletonHolder
  61. {
  62. protected static final SpawnTable _instance = new SpawnTable();
  63.  
  64.  
  65. +++ config/server.properties (working copy)
  66.  
  67. +# Enable Npc Server Delay
  68. +npcServerDelay = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement