Deedlit

mytp spellbook max slots configurable, scripting engine conf

Oct 19th, 2011
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 11.93 KB | None | 0 0
  1. --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    Mon Jan 19 23:26:36 1970
  2. +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    Mon Jan 19 23:26:36 1970
  3. @@ -14143,11 +14143,11 @@
  4.         {
  5.             idlist.add(tpbookmark.get(count)._id);
  6.             count++;
  7.         }
  8.        
  9. -       for(int i=1; i<10; i++)
  10. +       for(int i=1; i<(isGM() ? Config.ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS_GM : Config.ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS); i++)
  11.         {
  12.             if(!idlist.contains(i))
  13.             {
  14.                 id = i;
  15.                 break;
  16. --- java/com/l2jserver/gameserver/scripting/L2ScriptEngineManager.java  Mon Jan 19 23:26:36 1970
  17. +++ java/com/l2jserver/gameserver/scripting/L2ScriptEngineManager.java  Mon Jan 19 23:26:36 1970
  18. @@ -72,35 +72,35 @@
  19.     // TODO move to config file
  20.     /**
  21.      * Informs(logs) the scripts being loaded.<BR>
  22.      * Apply only when executing script from files.<BR>
  23.      */
  24. -   private final boolean VERBOSE_LOADING = false;
  25. +   //private final boolean VERBOSE_LOADING = false;
  26.    
  27.     /**
  28.      * If the script engine supports compilation the script is compiled before execution.<BR>
  29.      */
  30. -   private final boolean ATTEMPT_COMPILATION = true;
  31. +   //private final boolean ATTEMPT_COMPILATION = true;
  32.    
  33.     /**
  34.      * Use Compiled Scripts Cache.<BR>
  35.      * Only works if ATTEMPT_COMPILATION is true.<BR>
  36.      * DISABLED DUE ISSUES (if a superclass file changes subclasses are not recompiled where they should)
  37.      */
  38. -   private final boolean USE_COMPILED_CACHE = false;
  39. +   //private final boolean USE_COMPILED_CACHE = false;
  40.    
  41.     /**
  42.      * Clean an previous error log(if such exists) for the script being loaded before trying to load.<BR>
  43.      * Apply only when executing script from files.<BR>
  44.      */
  45. -   private final boolean PURGE_ERROR_LOG = true;
  46. +   //private final boolean PURGE_ERROR_LOG = true;
  47.    
  48.     private L2ScriptEngineManager()
  49.     {
  50.         ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
  51.         List<ScriptEngineFactory> factories = scriptEngineManager.getEngineFactories();
  52. -       if (USE_COMPILED_CACHE)
  53. +       if (Config.USE_COMPILED_CACHE)
  54.         {
  55.             _cache = this.loadCompiledScriptCache();
  56.         }
  57.         else
  58.         {
  59. @@ -281,11 +281,11 @@
  60.         {
  61.             for (File file : dir.listFiles())
  62.             {
  63.                 if (file.isDirectory() && recurseDown && maxDepth > currentDepth)
  64.                 {
  65. -                   if (VERBOSE_LOADING)
  66. +                   if (Config.VERBOSE_LOADING)
  67.                     {
  68.                         _log.info("Entering folder: " + file.getName());
  69.                     }
  70.                     this.executeAllScriptsInDirectory(file, recurseDown, maxDepth, currentDepth + 1);
  71.                 }
  72. @@ -330,11 +330,11 @@
  73.         return _cache;
  74.     }
  75.    
  76.     public CompiledScriptCache loadCompiledScriptCache()
  77.     {
  78. -       if (USE_COMPILED_CACHE)
  79. +       if (Config.USE_COMPILED_CACHE)
  80.         {
  81.             File file = new File(SCRIPT_FOLDER, "CompiledScripts.cache");
  82.             if (file.isFile())
  83.             {
  84.                 ObjectInputStream ois = null;
  85. @@ -406,26 +406,26 @@
  86.    
  87.     public void executeScript(ScriptEngine engine, File file) throws FileNotFoundException, ScriptException
  88.     {
  89.         BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
  90.        
  91. -       if (VERBOSE_LOADING)
  92. +       if (Config.VERBOSE_LOADING)
  93.         {
  94.             _log.info("Loading Script: " + file.getAbsolutePath());
  95.         }
  96.        
  97. -       if (PURGE_ERROR_LOG)
  98. +       if (Config.PURGE_ERROR_LOG)
  99.         {
  100.             String name = file.getAbsolutePath() + ".error.log";
  101.             File errorLog = new File(name);
  102.             if (errorLog.isFile())
  103.             {
  104.                 errorLog.delete();
  105.             }
  106.         }
  107.        
  108. -       if (engine instanceof Compilable && ATTEMPT_COMPILATION)
  109. +       if (engine instanceof Compilable && Config.ATTEMPT_COMPILATION)
  110.         {
  111.             ScriptContext context = new SimpleScriptContext();
  112.             context.setAttribute("mainClass", getClassForFile(file).replace('/', '.').replace('\\', '.'), ScriptContext.ENGINE_SCOPE);
  113.             context.setAttribute(ScriptEngine.FILENAME, file.getName(), ScriptContext.ENGINE_SCOPE);
  114.             context.setAttribute("classpath", SCRIPT_FOLDER.getAbsolutePath(), ScriptContext.ENGINE_SCOPE);
  115. @@ -435,11 +435,11 @@
  116.             this.setCurrentLoadingScript(file);
  117.             ScriptContext ctx = engine.getContext();
  118.             try
  119.             {
  120.                 engine.setContext(context);
  121. -               if (USE_COMPILED_CACHE)
  122. +               if (Config.USE_COMPILED_CACHE)
  123.                 {
  124.                     CompiledScript cs = _cache.loadCompiledScript(engine, file);
  125.                     cs.eval(context);
  126.                 }
  127.                 else
  128. @@ -506,11 +506,11 @@
  129.         return getScriptContext(engine);
  130.     }
  131.    
  132.     public Object eval(ScriptEngine engine, String script, ScriptContext context) throws ScriptException
  133.     {
  134. -       if (engine instanceof Compilable && ATTEMPT_COMPILATION)
  135. +       if (engine instanceof Compilable && Config.ATTEMPT_COMPILATION)
  136.         {
  137.             Compilable eng = (Compilable) engine;
  138.             CompiledScript cs = eng.compile(script);
  139.             return context != null ? cs.eval(context) : cs.eval();
  140.         }
  141. --- java/com/l2jserver/gameserver/templates/skills/L2EffectType.java    Mon Jan 19 23:26:36 1970
  142. +++ java/com/l2jserver/gameserver/templates/skills/L2EffectType.java    Mon Jan 19 23:26:36 1970
  143. @@ -51,10 +51,11 @@
  144.     STUN_SELF,
  145.     PHYSICAL_MUTE,
  146.     PHYSICAL_ATTACK_MUTE,
  147.     REMOVE_TARGET,
  148.     TARGET_ME,
  149. +   SILENCE_MAGIC_PHYSICAL,
  150.     BETRAY,
  151.     NOBLESSE_BLESSING,
  152.     PHOENIX_BLESSING,
  153.     PETRIFICATION,
  154.     BLUFF,
  155. --- java/com/l2jserver/Config.java  Mon Jan 19 23:26:36 1970
  156. +++ java/com/l2jserver/Config.java  Mon Jan 19 23:26:36 1970
  157. @@ -434,10 +434,14 @@
  158.     public static boolean DEVELOPER;
  159.     public static boolean ACCEPT_GEOEDITOR_CONN;
  160.     public static boolean ALT_DEV_NO_HANDLERS;
  161.     public static boolean ALT_DEV_NO_QUESTS;
  162.     public static boolean ALT_DEV_NO_SPAWNS;
  163. +   public static boolean VERBOSE_LOADING;
  164. +   public static boolean ATTEMPT_COMPILATION;
  165. +   public static boolean USE_COMPILED_CACHE;
  166. +   public static boolean PURGE_ERROR_LOG;
  167.     public static int THREAD_P_EFFECTS;
  168.     public static int THREAD_P_GENERAL;
  169.     public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  170.     public static int IO_PACKET_THREAD_CORE_SIZE;
  171.     public static int GENERAL_THREAD_CORE_SIZE;
  172. @@ -887,10 +891,12 @@
  173.     public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  174.     public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  175.     public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  176.     public static boolean ALT_STRICT_SEVENSIGNS;
  177.     public static boolean ALT_SEVENSIGNS_LAZY_UPDATE;
  178. +   public static int ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS;
  179. +   public static int ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS_GM;
  180.    
  181.    
  182.     //--------------------------------------------------
  183.     // Server Settings
  184.     //--------------------------------------------------
  185. @@ -971,10 +977,11 @@
  186.     public static String SERVER_VERSION;
  187.     public static String SERVER_BUILD_DATE;
  188.     public static String DATAPACK_VERSION;
  189.     public static int PVP_NORMAL_TIME;
  190.     public static int PVP_PVP_TIME;
  191. +
  192.     public static enum IdFactoryType
  193.     {
  194.         Compaction,
  195.         BitSet,
  196.         Stack
  197. @@ -1436,10 +1443,12 @@
  198.                     ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
  199.                     ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
  200.                     ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
  201.                     ALT_STRICT_SEVENSIGNS = Boolean.parseBoolean(Feature.getProperty("StrictSevenSigns", "True"));
  202.                     ALT_SEVENSIGNS_LAZY_UPDATE = Boolean.parseBoolean(Feature.getProperty("AltSevenSignsLazyUpdate", "True"));
  203. +                   ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS = Integer.parseInt(Feature.getProperty("AltMyTeleportBookmarkMaxSlots", "9")) + 1;
  204. +                   ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS_GM = Integer.parseInt(Feature.getProperty("AltMyTeleportBookmarkMaxSlotsGM", "96")) + 1;
  205.                    
  206.                     TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
  207.                     LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "0"));
  208.                     TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
  209.                     LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
  210. @@ -1888,10 +1897,14 @@
  211.                     DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  212.                     ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  213.                     ALT_DEV_NO_HANDLERS = Boolean.parseBoolean(General.getProperty("AltDevNoHandlers", "False"));
  214.                     ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  215.                     ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  216. +                   VERBOSE_LOADING = Boolean.parseBoolean(General.getProperty("AltVerbooseScriptLoading", "False"));
  217. +                   ATTEMPT_COMPILATION = Boolean.parseBoolean(General.getProperty("AltAttemptCompillation", "True"));
  218. +                   USE_COMPILED_CACHE = Boolean.parseBoolean(General.getProperty("AltUseCompilledCache", "False"));
  219. +                   PURGE_ERROR_LOG = Boolean.parseBoolean(General.getProperty("AltPurgeErrorLog", "True"));
  220.                     THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
  221.                     THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
  222.                     IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  223.                     GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  224.                     GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  225. --- dist/game/config/Feature.properties Mon Jan 19 23:26:36 1970
  226. +++ dist/game/config/Feature.properties Mon Jan 19 23:26:36 1970
  227. @@ -355,6 +355,13 @@
  228.  # Other
  229.  # ---------------------------------------------------------------------------
  230.  
  231.  # Allow riding wyvern during Castle/Fort Siege
  232.  # Default: True
  233. -AllowRideWyvernDuringSiege = True
  234. \ No newline at end of file
  235. +AllowRideWyvernDuringSiege = True
  236. +
  237. +#  Set maximum allowed myteleport bookmark slots for players
  238. +# Default: 9
  239. +AltMyTeleportBookmarkMaxSlots = 9
  240. +#  Set maximum allowed myteleport bookmark slots for GMs and admins
  241. +# Default: 96
  242. +AltMyTeleportBookmarkMaxSlotsGM = 96
  243. \ No newline at end of file
  244. --- dist/game/config/General.properties Mon Jan 19 23:26:36 1970
  245. +++ dist/game/config/General.properties Mon Jan 19 23:26:36 1970
  246. @@ -926,6 +926,20 @@
  247.  # Default: False
  248.  AltDevNoQuests = False
  249.  
  250.  # Don't load spawntable.
  251.  # Default: False
  252. -AltDevNoSpawns = False
  253. \ No newline at end of file
  254. +AltDevNoSpawns = False
  255. +
  256. +# ---------------------------------------------------------------------------
  257. +# Scripting Engine Settings
  258. +# ---------------------------------------------------------------------------
  259. +# Do not touch these if you do not know what you are doing.
  260. +
  261. +# Default: False
  262. +AltVerbooseScriptLoading = False
  263. +# Default: True
  264. +AltAttemptCompillation = True
  265. +# Default: False
  266. +AltUseCompilledCache = False
  267. +# Default: True
  268. +AltPurgeErrorLog = True
  269. \ No newline at end of file
  270.  
  271. --- dist/game/data/scripts/handlers/itemhandlers/TeleportBookmark.java  Mon Jan 19 23:26:36 1970
  272. +++ dist/game/data/scripts/handlers/itemhandlers/TeleportBookmark.java  Mon Jan 19 23:26:36 1970
  273. @@ -12,10 +12,11 @@
  274.   * You should have received a copy of the GNU General Public License along with
  275.   * this program. If not, see <http://www.gnu.org/licenses/>.
  276.   */
  277.  package handlers.itemhandlers;
  278.  
  279. +import com.l2jserver.Config;
  280.  import com.l2jserver.gameserver.handler.IItemHandler;
  281.  import com.l2jserver.gameserver.model.L2ItemInstance;
  282.  import com.l2jserver.gameserver.model.actor.L2Playable;
  283.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  284.  import com.l2jserver.gameserver.network.SystemMessageId;
  285. @@ -34,11 +35,11 @@
  286.         if (playable == null || item == null || !(playable instanceof L2PcInstance))
  287.             return;
  288.        
  289.         L2PcInstance player = (L2PcInstance) playable;
  290.        
  291. -       if(player.getBookMarkSlot() >= 9)
  292. +       if(player.getBookMarkSlot() >= (player.isGM() ? Config.ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS_GM : Config.ALT_MAX_MYTELEPORT_BOOKMARK_SLOTS) - 1)
  293.         {
  294.             player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_NUMBER_OF_MY_TELEPORTS_SLOTS_HAS_REACHED_ITS_MAXIMUM_LIMIT));
  295.             return;
  296.         }
  297.  
Add Comment
Please, Sign In to add comment