Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_Mobius_C6_Interlude
- diff --git .gitignore .gitignore
- new file mode 100644
- index 0000000..ae3c172
- --- /dev/null
- +++ .gitignore
- @@ -0,0 +1 @@
- +/bin/
- diff --git dist/game/config/protected/Other.ini dist/game/config/protected/Other.ini
- index e4e8bbe..462b1d8 100644
- --- dist/game/config/protected/Other.ini
- +++ dist/game/config/protected/Other.ini
- @@ -11,6 +11,11 @@
- # IMPORTANT: Put True for server security.
- CheckNameOnEnter = True
- +# Check the name pattern of the GM character
- +# IMPORTANT: Put True for server security.
- +CheckNamePatternOnEnter = True
- +NamePatternToCheck =^(admin)$
- +
- # On / off protection from re-enchant
- # The GMs do not apply
- # If a player log with an item Over enchanted he will be banned.
- diff --git java/org/l2jmobius/Config.java java/org/l2jmobius/Config.java
- index a8dbf16..60bb716 100644
- --- java/org/l2jmobius/Config.java
- +++ java/org/l2jmobius/Config.java
- @@ -905,6 +905,8 @@
- public static boolean CHECK_SKILLS_ON_ENTER;
- public static boolean CHECK_NAME_ON_LOGIN;
- + public static boolean CHECK_NAME_PATTERN_ON_ENTER;
- + public static String NAME_PATTERN_TO_CHECK;
- public static boolean L2WALKER_PROTECTION;
- public static boolean PROTECTED_ENCHANT;
- public static boolean ONLY_GM_ITEMS_FREE;
- @@ -2460,6 +2462,8 @@
- final PropertiesParser protectedOtherConfig = new PropertiesParser(PROTECT_OTHER_CONFIG_FILE);
- CHECK_NAME_ON_LOGIN = protectedOtherConfig.getBoolean("CheckNameOnEnter", true);
- CHECK_SKILLS_ON_ENTER = protectedOtherConfig.getBoolean("CheckSkillsOnEnter", true);
- + CHECK_NAME_PATTERN_ON_ENTER = protectedOtherConfig.getBoolean("CheckNamePatternOnEnter", true);
- + NAME_PATTERN_TO_CHECK = protectedOtherConfig.getString("NamePatternToCheck", "^(admin)$");
- L2WALKER_PROTECTION = protectedOtherConfig.getBoolean("L2WalkerProtection", false);
- PROTECTED_ENCHANT = protectedOtherConfig.getBoolean("ProtectorEnchant", false);
- ONLY_GM_TELEPORT_FREE = protectedOtherConfig.getBoolean("OnlyGMTeleportFree", false);
- diff --git java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
- index 6827e46..054f3f4 100644
- --- java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
- +++ java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
- @@ -135,6 +135,20 @@
- return;
- }
- + // Check Admin name pattern, if doesn't match game will close.
- + if (player.isGM() && Config.CHECK_NAME_PATTERN_ON_ENTER)
- + {
- + Pattern pattern = Pattern.compile(Config.NAME_PATTERN_TO_CHECK, Pattern.CASE_INSENSITIVE);
- + Matcher matcher = pattern.matcher(player.getName());
- +
- + if (!matcher.matches())
- + {
- + LOGGER.info("Admin name doesn't match");
- + client.closeNow();
- + return;
- + }
- + }
- +
- // Set online status
- player.setOnlineStatus(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement