SySt3MGaM3RFr3aKs
Members-
Posts
838 -
Joined
-
Last visited
Never -
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by SySt3MGaM3RFr3aKs
-
[Recruiting] L2JInterlude Development.
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's question in Request Server Development Help [L2J]
bump. -
Paidia help me to pack mo0!!
SySt3MGaM3RFr3aKs replied to `zэlaи's question in Request Server Development Help [Greek]
Kane Compile ( download ) to pack to L2JDreamcode. More information here: http://www.maxcheaters.com/forum/index.php?topic=117498.0 Exoun kanei polla fixes. -
[Share] Unk Packets spam Protection
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's topic in Server Shares & Files [L2J]
Yes that's truth. @Alexi, noone will never fix all PACKETS from PHX lol :D -
Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 423) @@ -17,4 +17,6 @@ import java.util.logging.Level; import java.util.logging.Logger; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -60,4 +62,11 @@ { L2PcInstance activeChar = getClient().getActiveChar(); + + if (!activeChar.getFloodProtectors().getServerBypass().tryPerformAction("_command")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (activeChar == null) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java (revision 423) @@ -84,4 +84,9 @@ { L2PcInstance player = getClient().getActiveChar(); + if (!player.getFloodProtectors().getMisc().tryPerformAction("misc")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (player == null) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java (revision 423) @@ -30,4 +30,5 @@ import net.sf.l2j.gameserver.model.item.PcInventory; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.ItemList; import net.sf.l2j.gameserver.network.serverpackets.PledgeShowInfoUpdate; @@ -90,4 +91,9 @@ private void doExchange(L2PcInstance player, MultiSellEntry templateEntry, boolean applyTaxes, boolean maintainEnchantment, int enchantment) { + if (!player.getFloodProtectors().getMultisell().tryPerformAction("multisell")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } PcInventory inv = player.getInventory(); boolean maintainItemFound = false; Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (revision 423) @@ -72,4 +72,12 @@ { L2PcInstance player = getClient().getActiveChar(); + + if (!player.getFloodProtectors().getMisc().tryPerformAction("misc")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + + if (player == null) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseWithDrawList.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseWithDrawList.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/SendWareHouseWithDrawList.java (revision 423) @@ -26,4 +26,5 @@ import net.sf.l2j.gameserver.model.item.ItemContainer; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate; import net.sf.l2j.gameserver.network.serverpackets.ItemList; @@ -84,4 +85,9 @@ { player.sendMessage("Transactions are disable for your Access Level"); + return; + } + if (!player.getFloodProtectors().getWerehouse().tryPerformAction("werehouse")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); return; } Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java (revision 423) @@ -89,4 +89,11 @@ { L2PcInstance player = getClient().getActiveChar(); + + if (!player.getFloodProtectors().getMisc().tryPerformAction("misc")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (player == null) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java (revision 423) @@ -18,4 +18,6 @@ import java.util.logging.Level; import java.util.logging.Logger; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -56,4 +58,11 @@ { L2PcInstance activeChar = getClient().getActiveChar(); + + if (!activeChar.getFloodProtectors().getMisc().tryPerformAction("misc")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (activeChar == null) return; Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java (revision 423) @@ -17,4 +17,6 @@ import java.util.logging.Logger; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; + import net.sf.l2j.Config; import net.sf.l2j.gameserver.GmListTable; @@ -61,4 +63,11 @@ { L2PcInstance activeChar = getClient().getActiveChar(); + + if (!activeChar.getFloodProtectors().getDropItem().tryPerformAction("drop")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (activeChar == null || activeChar.isDead()) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 423) @@ -25,4 +25,5 @@ import net.sf.l2j.gameserver.handler.IChatHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; /** @@ -85,4 +86,13 @@ // getting char instance L2PcInstance activeChar = getClient().getActiveChar(); + + if (activeChar != null && activeChar instanceof L2PcInstance) + { + if (!activeChar.getFloodProtectors().getChat().tryPerformAction("chat")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + } if (_text.length() >= 100) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java (revision 423) @@ -61,4 +61,10 @@ else target = L2World.getInstance().findObject(_objectId); + // Update next commit + // if (!activeChar.getFloodProtectors().getActionMwx().tryPerformAction("_objectId")) + // { + // activeChar.sendPacket(ActionFailed.STATIC_PACKET); + // return; + // } if (target == null) return; Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBuyItem.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBuyItem.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBuyItem.java (revision 423) @@ -83,4 +83,11 @@ { L2PcInstance player = getClient().getActiveChar(); + + if (!player.getFloodProtectors().getMisc().tryPerformAction("misc")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (player == null) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 423) @@ -16,4 +16,6 @@ import java.util.logging.Logger; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -410,4 +412,11 @@ activeChar.sendPacket(sm); } + + if (!activeChar.getFloodProtectors().getWerehouse().tryPerformAction("werehouse")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + item.setEnchantLevel(item.getEnchantLevel() + 1); item.updateDatabase(); Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (revision 423) @@ -60,4 +60,9 @@ if (activeChar == null) return; + if (!activeChar.getFloodProtectors().getUseItem().tryPerformAction("use item")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (activeChar.getPrivateStoreType() != 0) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcBufferInstance.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcBufferInstance.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcBufferInstance.java (revision 423) @@ -18,4 +18,6 @@ import java.util.concurrent.ScheduledFuture; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; + import net.sf.l2j.gameserver.ThreadPoolManager; import net.sf.l2j.gameserver.datatables.NpcBufferSkillIdsTable; @@ -191,4 +193,9 @@ if (command.startsWith("npc_buffer_heal")) { + if (!playerInstance.getFloodProtectors().getBuffer().tryPerformAction("npc_buffer_heal")) + { + playerInstance.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (playerInstance.getCurrentHp() == 0 || playerInstance.getPvpFlag() > 0) { @@ -204,4 +211,9 @@ if (command.startsWith("npc_buffer_cancel")) { + if (!playerInstance.getFloodProtectors().getBuffer().tryPerformAction("npc_buffer_cancel")) + { + playerInstance.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (playerInstance.getCurrentHp() == 0 || playerInstance.getPvpFlag() > 0) { @@ -215,4 +227,9 @@ if (command.startsWith("npc_buffer_buff")) { + if (!playerInstance.getFloodProtectors().getBuffer().tryPerformAction("npc_buffer_buff")) + { + playerInstance.sendPacket(ActionFailed.STATIC_PACKET); + return; + } String[] params = command.split(" "); int skillId = Integer.parseInt(params[1]); Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java (revision 423) @@ -2814,4 +2814,6 @@ if (player == null) return; + if (!player.getFloodProtectors().getSubclass().tryPerformAction("buffer")) + return; // Blessing of protection - author kerberos_20. Used codes from Rayan - L2Emu project. int player_level = player.getLevel(); Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (revision 423) @@ -285,4 +285,12 @@ case 4: // Add Subclass - Action (Subclass 4 x[x]) boolean allowAddition = true; + + if (!player.getFloodProtectors().getSubclass().tryPerformAction("add subclass")) + { + player.sendMessage("Don't change sub classes so rapidly, please wait."); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + /* * If the character is less than level 75 on any of their previously chosen classes then disallow them to change to their most recently added sub-class choice. @@ -373,4 +381,10 @@ * If the character is less than level 75 on any of their previously chosen classes then disallow them to change to their most recently added sub-class choice. Note: paramOne = classIndex */ + if (!player.getFloodProtectors().getSubclass().tryPerformAction("change class")) + { + player.sendMessage("Don't change sub classes so rapidly, please wait."); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0)) { @@ -407,4 +421,10 @@ * Warning: the information about this subclass will be removed from the subclass list even if false! */ + if (!player.getFloodProtectors().getSubclass().tryPerformAction("change class")) + { + player.sendMessage("Don't change sub classes so rapidly, please wait."); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0)) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java (revision 423) @@ -58,4 +58,9 @@ } L2PcInstance activeChar = (L2PcInstance) playable; + if (!activeChar.getFloodProtectors().getItemPetSummon().tryPerformAction("summon items")) + { + playable.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (activeChar.isSitting()) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/Firework.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/Firework.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/Firework.java (revision 423) @@ -14,4 +14,6 @@ */ package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.datatables.SkillTable; @@ -39,4 +41,49 @@ L2PcInstance activeChar = (L2PcInstance) playable; int itemId = item.getItemId(); + if (!activeChar.getFloodProtectors().getFirework().tryPerformAction("firework")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } /* Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/RollingDice.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/RollingDice.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/itemhandlers/RollingDice.java (revision 423) @@ -69,4 +69,6 @@ private int rollDice(L2PcInstance player) { + if (!player.getFloodProtectors().getRollDice().tryPerformAction("roll dice")) + return 0; // Check if the dice is ready return Rnd.get(1, 6); Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Banking.java =================================================================== --- /trunk/v/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Banking.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Banking.java (revision 423) @@ -14,4 +14,6 @@ */ package net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -34,4 +36,9 @@ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { + if (!activeChar.getFloodProtectors().getBankingSystem().tryPerformAction("BankingSystem")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return false; + } if (command.equalsIgnoreCase("bank")) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java (revision 423) @@ -20,4 +20,5 @@ import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.CreatureSay; @@ -38,4 +39,9 @@ public void handleChat(int type, L2PcInstance activeChar, String target, String text) { + if (!activeChar.getFloodProtectors().getGlobal().tryPerformAction("global")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.isGM())) Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java =================================================================== --- /trunk/v/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java (revision 423) @@ -14,4 +14,6 @@ */ package net.sf.l2j.gameserver.handler.chathandlers; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -38,4 +40,9 @@ public void handleChat(int type, L2PcInstance activeChar, String target, String text) { + if (!activeChar.getFloodProtectors().getGlobal().tryPerformAction("global")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM())) Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java (revision 423) @@ -19,4 +19,5 @@ import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.CreatureSay; @@ -37,6 +38,11 @@ public void handleChat(int type, L2PcInstance activeChar, String target, String text) { - if (activeChar.isHero()) + if (activeChar.isHero() || activeChar.isGM ()) { + if (!activeChar.getFloodProtectors().getHeroVoice().tryPerformAction("hero voice") && !activeChar.isGM()) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); for (L2PcInstance player : L2World.getInstance().getAllPlayers()) Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/RecipeController.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/RecipeController.java (revision 413) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/RecipeController.java (revision 423) @@ -193,4 +193,9 @@ public synchronized void requestMakeItem(L2PcInstance player, int recipeListId) { + if (!player.getFloodProtectors().getCraft().tryPerformAction("craft")) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (player.isInDuel()) { Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/util/FloodProtectors.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/util/FloodProtectors.java (revision 422) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/util/FloodProtectors.java (revision 423) @@ -15,4 +15,6 @@ package net.sf.l2j.gameserver.util; +import net.sf.l2j.gameserver.util.FloodProtectorAction; + import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; Credits: L2J kai se emena gia to rework sto Interlude.
-
Geia se olous, 8a ithela na kanw share to Flood Protection rework, pou einai aparaitito gia ola ta interludes :D. Prostateuei ton server apo bugs, spams, lags. Einai reworked gia Interlude to Gracia Final to exei idi 1. ) Arxizoume kanontas delete to old FloodProtection sosta ? :D 2. ) As arxisoume, prota kanoume delete to Support apo to L2PcInstance gia to old floodprotection Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java @@ -201,5 +201,4 @@ import net.sf.l2j.gameserver.templates.L2WeaponType; import net.sf.l2j.gameserver.util.Broadcast; -import net.sf.l2j.gameserver.util.FloodProtector; import net.sf.l2j.util.Point3D; import net.sf.l2j.util.Rnd; @@ -10883,6 +10883,5 @@ // Close the connection with the client closeNetConnection(); - // remove from flood protector - FloodProtector.getInstance().removePlayer(getObjectId()); + if (getClanId() > 0) { 3. ) Tora kanoume delete to arxeio pou legete Floodprotector.java kai vriskete sto gameserver/util .Tora tha svisete oti protection exete valei se opio file exete valei apo to palio Flood Protection. 4. ) Ora na valoume to kainourio Mas FloodProtection System Edo to code: FloodProtection Rework 5. ) Ora na prostateusoume ta arxeia pou theloume Ena paradeigma: ( sto proigoumeno diff vriskete to support, omws tha sas dei3w pos ginete add se periptosi p thelete na kanete kai alla protections: Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 423) @@ -17,4 +17,6 @@ import java.util.logging.Level; import java.util.logging.Logger; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -60,4 +62,11 @@ { L2PcInstance activeChar = getClient().getActiveChar(); + + if (!activeChar.getFloodProtectors().getServerBypass().tryPerformAction("_command")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (activeChar == null) NOTE: "Actionfailed.STATIC_PACKET " can be changed to new ActionFaled()); without harming the code. { Support: Prota anoigoume to arxeio FloodProtection.java Vazoume ta lines: Stin arxi ( Mporeite na dite pou einai kai ta alla paromoia me auto to code ) + /** + * Server-bypass flood protector. + */ + private final FloodProtectorAction _serverBypass; Edo meta gia na sindethei me ta Configs ( mporeite na deite pou akrivos tha to valete apo olokliro to code sto Proto diff. + _serverBypass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SERVER_BYPASS); Auto sto telos. + /** + * Returns {@link #_serverBypass}. + * + * @return {@link #_serverBypass} + */ + public FloodProtectorAction getServerBypass() + { + return _serverBypass; + } Auto itan ena paradeigma. Prostateuste ta ipoloipa arxeia, deite to parakato to diff exei ta protections gia kapoia files. to Support tous sto FloodProtection / Config einai idi added sto proto diff Ipoloipa protections: http://www.4shared.com/file/184891519/dbc74782/Protectingit.html Next page :D
-
[Share] Unk Packets spam Protection
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's topic in Server Shares & Files [L2J]
Maybe in Gracia Final Watch your language. -
[Share] Unk Packets spam Protection
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's topic in Server Shares & Files [L2J]
Ofcourse jerk. Is not existing there for a reason. -
[Share] Unk Packets spam Protection
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's topic in Server Shares & Files [L2J]
It doesn't exists in any Chronicle of L2J, not in c4, c5, c6, Kamael nowhere. -
[Share] Unk Packets spam Protection
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's topic in Server Shares & Files [L2J]
I rewrited it, nothing special, i will delete the credits relax. -
Are you serious ???, He is banned for 1 Week, and he haven't really Flamed everybody he is just SAYING THE TRUTH, like Vazelos did. Omg with you guys. !
-
Chat filter system, with a log to write the words you don't allow in your server. Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 130) @@ -192,4 +192,48 @@ _logChat.log(record); + } + + if (L2Config.USE_CHAT_FILTER) + { + if (_type == SHOUT || _type == TRADE || _type == HERO_VOICE) + { + String filteredText = _text; + filteredText = filteredText.replace("=", ""); + filteredText = filteredText.replace("*", ""); + filteredText = filteredText.replace(" ", ""); + filteredText = filteredText.replace("-", ""); + filteredText = filteredText.replace("_", ""); + filteredText = filteredText.replace(".", ""); + filteredText = filteredText.replace(",", ""); + filteredText = filteredText.replace("'", ""); + filteredText = filteredText.replace("/", ""); + filteredText = filteredText.replace("+", ""); + filteredText = filteredText.toLowerCase(); + if(!activeChar.inObserverMode() && !activeChar.isInDuel() && !activeChar.isInOlympiadMode() + && L2Config.CHAT_FILTER_PUNISHMENT.equalsIgnoreCase("jail") && !activeChar.isInCombat()) { + for (int i = 0; i < L2Config.FILTER_LIST.size(); i++) + { + if(filteredText.contains(L2Config.FILTER_LIST.get(i).toString())) { + int punishmentLength = 0; + punishmentLength = L2Config.CHAT_FILTER_PUNISHMENT_PARAM1 + (L2Config.CHAT_FILTER_PUNISHMENT_PARAM2*activeChar.ChatFilterCount); + activeChar.sendMessage("[ChatFilterSystem] Be careful whith words"); + activeChar.sendMessage("[ChatFilterSystem] Word " + L2Config.FILTER_LIST.get(i).toString()+ " is untolerable"); + activeChar.setInJail(true, punishmentLength); + activeChar.ChatFilterCount += 1; + _text = "[CFS] Jailed for " + punishmentLength + "mins"; + break; + } + } + } else { + for (int i = 0; i < L2Config.FILTER_LIST.size(); i++) + { + if(filteredText.contains(L2Config.FILTER_LIST.get(i).toString())) { + activeChar.sendMessage("[ChatFilterSystem] Be careful whith words"); + activeChar.sendMessage("[ChatFilterSystem] Word " + L2Config.FILTER_LIST.get(i).toString()+ " is untolerable"); + _text = "[CFS] Text cleared"; + } + } + } + } } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 105) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 130) @@ -216,6 +216,6 @@ private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?"; - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?"; - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?"; + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,chat_filter_count=? WHERE obj_id=?"; + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,chat_filter_count FROM characters WHERE obj_id=?"; private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC"; private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)"; @@ -5910,5 +5910,6 @@ player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level")); - + player.setChatFilterCount(rset.getInt("chat_filter_count")); + // Add the L2PcInstance object in _allObjects //L2World.getInstance().storeObject(player); @@ -6274,5 +6275,6 @@ statement.setString(55, getName()); statement.setLong(56, getDeathPenaltyBuffLevel()); - statement.setInt(57, getObjectId()); + statement.setInt(57, getChatFilterCount()); + statement.setInt(58, getObjectId()); statement.execute(); @@ -6393,5 +6395,16 @@ finally { try { con.close(); } catch (Exception e) {} } } - + + /** ChatFilterCounter */ + public int ChatFilterCount = 0; + + public void setChatFilterCount(int cfcount) + { + ChatFilterCount = cfcount; + } + public int getChatFilterCount() + { + return ChatFilterCount; + } /** * Return True if the L2PcInstance is on line.<BR><BR> Index: /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java (revision 128) +++ /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java (revision 130) @@ -6,4 +6,7 @@ import java.io.InputStream; import java.io.OutputStream; +import java.io.LineNumberReader; +import java.io.BufferedReader; +import java.io.FileReader; import java.math.BigInteger; import java.util.List; @@ -60,4 +63,5 @@ public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties"; public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties"; + public static final String CHAT_FILTER_FILE = "./config/ChatFilter.txt"; public static int MAX_ITEM_IN_PACKET; @@ -770,6 +774,10 @@ public static final FloodProtectorConfig FLOOD_PROTECTOR_WEREHOUSE = new FloodProtectorConfig("WerehouseFloodProtector"); public static final FloodProtectorConfig FLOOD_PROTECTOR_MISC = new FloodProtectorConfig("MiscFloodProtector"); - public static final FloodProtectorConfig FLOOD_PROTECTOR_CHAT = new FloodProtectorConfig("ChatFloodProtector"); - + public static final FloodProtectorConfig FLOOD_PROTECTOR_CHAT = new FloodProtectorConfig("ChatFloodProtector"); + public static boolean USE_CHAT_FILTER; + public static List<String> FILTER_LIST = new FastList<String>(); + public static String CHAT_FILTER_PUNISHMENT; + public static int CHAT_FILTER_PUNISHMENT_PARAM1; + public static int CHAT_FILTER_PUNISHMENT_PARAM2; // Class Balance @@ -2100,4 +2108,33 @@ floodprotectorSettings.load(is); is.close(); + + USE_CHAT_FILTER = Boolean.parseBoolean(floodprotectorSettings.getProperty("UseChatFilter", "True")); + CHAT_FILTER_PUNISHMENT = floodprotectorSettings.getProperty("ChatFilterPunishment", "off"); + CHAT_FILTER_PUNISHMENT_PARAM1 = Integer.parseInt(floodprotectorSettings.getProperty("ChatFilterPunishmentParam1", "1")); + CHAT_FILTER_PUNISHMENT_PARAM2 = Integer.parseInt(floodprotectorSettings.getProperty("ChatFilterPunishmentParam2", "1")); + + if (USE_CHAT_FILTER) + { + try + { + LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE)))); + String line = null; + while ((line = lnr.readLine()) != null) + { + if (line.trim().length() == 0 || line.startsWith("#")) + { + continue; + } + FILTER_LIST.add(line.trim()); + } + _log.info("Chat Filter: Loaded " + FILTER_LIST.size() + " words"); + } + catch (Exception e) + { + e.printStackTrace(); + throw new Error("Failed to Load "+CHAT_FILTER_FILE+" File."); + } + } + loadFloodProtectorConfigs(floodprotectorSettings); _log.info("# " + FLOODPROTECTOR_CONFIG_FILE + " Sucessfully LOADED #"); Index: /trunk/Eclipse-Game/config/ChatFilter.txt =================================================================== --- /trunk/Eclipse-Game/config/ChatFilter.txt (revision 130) +++ /trunk/Eclipse-Game/config/ChatFilter.txt (revision 130) @@ -0,0 +1,7 @@ +lag +laag +laaag +laaaag +laaaaag +laaaaaag +laaaaaaag Index: /trunk/Eclipse-Game/config/Custom/FloodProtector.properties =================================================================== --- /trunk/Eclipse-Game/config/Custom/FloodProtector.properties (revision 76) +++ /trunk/Eclipse-Game/config/Custom/FloodProtector.properties (revision 130) @@ -7,4 +7,16 @@ # PunishmentType - type of the punishment ('none', 'ban', 'jail'), used only, if PunishmentLimit is greater than zero # PunishmentTime - for how many minutes should be the player/account punished, player is punished in case of 'jail', account is punishedin case of 'ban' (0 = forever) + +#--------------------------------------------------------------- +# Chat Filter system - +#--------------------------------------------------------------- +# Enable chat filter +UseChatFilter = False +# Player punishment for illegal word: off, jail +ChatFilterPunishment = off +# How long the punishment is in effect, min +ChatFilterPunishmentParam1 = 10 +# How much to increase every new punishment for player, min +ChatFilterPunishmentParam2 = 5 FloodProtectorUseItemInterval = 4 Credits: one guy from L2JForum, and ŚyśţęmƒяәдҚς for some modifications, nothing special, just removal effect.
-
Unknown Packets Protection Spam. ( This diff is for Interlude L2J but with some modifications can be inserted in Gracia Final or Gracia pt2 etc ) Your server will have protections from PHX Spammers, sending unknown packets. Diff file: Index: C:/Workspace/L2_GameServer_It/java/config/server.properties =================================================================== --- C:/Workspace/L2_GameServer_It/java/config/server.properties (revision 1025) +++ C:/Workspace/L2_GameServer_It/java/config/server.properties (working copy) @@ -69,6 +69,16 @@ # Define how many players are allowed to play simultaneously on your server. MaximumOnlineUsers=100 +# Activate Protection for unknownPacket flooding +PacketProtection = False +# How much unknown packets before punishment. +# If the player send more than 5 unknownPackets per second, the player get punished. +UnknownPacketsBeforeBan = 5 +# Punishments +# 1 - broadcast warning to gms only +# 2 - kick player (default) +# 3 - kick & ban player (Accesslevel -99) +UnknownPacketsPunishment = 2 # Minimum and maximum protocol revision that server allow to connect. # You must keep MinProtocolRevision <= MaxProtocolRevision. Index: C:/Workspace/L2_GameServer_It/java/net/sf/l2j/Config.java =================================================================== --- C:/Workspace/L2_GameServer_It/java/net/sf/l2j/Config.java (revision 1025) +++ C:/Workspace/L2_GameServer_It/java/net/sf/l2j/Config.java (working copy) @@ -78,6 +78,10 @@ /** Maximum number of players allowed to play simultaneously on server */ public static int MAXIMUM_ONLINE_USERS; + public static boolean ENABLE_PACKET_PROTECTION; + public static int MAX_UNKNOWN_PACKETS; + public static int UNKNOWN_PACKETS_PUNiSHMENT; + // Setting for serverList /** Displays [] in front of server name ? */ public static boolean SERVER_LIST_BRACKET; @@ -1120,6 +1124,10 @@ MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0")); MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100")); + + ENABLE_PACKET_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("PacketProtection", "false")); + MAX_UNKNOWN_PACKETS = Integer.parseInt(serverSettings.getProperty("UnknownPacketsBeforeBan", "5")); + UNKNOWN_PACKETS_PUNiSHMENT = Integer.parseInt(serverSettings.getProperty("UnknownPacketsPunishment", "2")); MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660")); MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665")); @@ -2082,6 +2090,10 @@ else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(pValue); else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue); + + else if (pName.equalsIgnoreCase("PacketProtection")) ENABLE_PACKET_PROTECTION = Boolean.parseBoolean(pValue); + else if (pName.equalsIgnoreCase("UnknownPacketsBeforeBan")) MAX_UNKNOWN_PACKETS = Integer.parseInt(pValue); + else if (pName.equalsIgnoreCase("UnknownPacketsPunishment")) UNKNOWN_PACKETS_PUNiSHMENT = Integer.parseInt(pValue); else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue); Index: C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/network/L2GameClient.java =================================================================== --- C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 1025) +++ C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/network/L2GameClient.java (working copy) @@ -41,6 +41,7 @@ import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.entity.L2Event; import net.sf.l2j.gameserver.serverpackets.L2GameServerPacket; +import net.sf.l2j.gameserver.util.FloodProtector; import net.sf.l2j.util.EventData; import com.l2jserver.mmocore.network.MMOClient; @@ -84,6 +85,9 @@ // Flood protection public byte packetsSentInSec = 0; public int packetsSentStartTick = 0; + + // UnknownPacket protection + private int unknownPacketCount = 0; public L2GameClient(MMOConnection<L2GameClient> con) { @@ -489,6 +493,26 @@ } } + public boolean checkUnknownPackets() + { + if(this.getActiveChar() != null && + !FloodProtector.getInstance().tryPerformAction(this.getActiveChar().getObjectId(), FloodProtector.PROTECTED_UNKNOWNPACKET)) + { + unknownPacketCount++; + if (unknownPacketCount >= Config.MAX_UNKNOWN_PACKETS) + { + return true; + } + else + return false; + } + else + { + unknownPacketCount = 0; + return false; + } + } + /** * Produces the best possible string representation of this client. */ Index: C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java =================================================================== --- C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (revision 1025) +++ C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (working copy) @@ -18,10 +18,13 @@ package net.sf.l2j.gameserver.network; import java.nio.ByteBuffer; +import java.sql.Time; import java.util.concurrent.RejectedExecutionException; import java.util.logging.Logger; import net.sf.l2j.Config; +import net.sf.l2j.gameserver.GmListTable; +import net.sf.l2j.gameserver.LoginServerThread; import net.sf.l2j.gameserver.ThreadPoolManager; import net.sf.l2j.gameserver.clientpackets.*; import net.sf.l2j.gameserver.network.L2GameClient.GameClientState; @@ -811,6 +814,8 @@ byte[] array = new byte[size]; buf.get(array); _log.warning(Util.printData(array, size)); + if (Config.ENABLE_PACKET_PROTECTION) + unknownPacketProtection(client); } private void printDebugDoubleOpcode(int opcode, int id2, ByteBuffer buf, GameClientState state, L2GameClient client) @@ -820,7 +825,50 @@ byte[] array = new byte[size]; buf.get(array); _log.warning(Util.printData(array, size)); + if (Config.ENABLE_PACKET_PROTECTION) + unknownPacketProtection(client); } + + private void unknownPacketProtection(L2GameClient client) + { + if(client.getActiveChar() != null && client.checkUnknownPackets()) + { + punish(client); + return; + } + } + + private void punish(L2GameClient client) + { + switch(Config.UNKNOWN_PACKETS_PUNiSHMENT) + { + case(1): + if (client.getActiveChar() != null) + { + GmListTable.broadcastMessageToGMs("Player " + client.getActiveChar().toString() + " flooding unknown packets."); + } + break; + case(2): + _log.warning("PacketProtection: " + client.toString() + " got kicked due flooding of unknown packets"); + if (client.getActiveChar() != null) + { + GmListTable.broadcastMessageToGMs("Player " + client.getActiveChar().toString() + " flooding unknown packets and got kicked."); + client.getActiveChar().sendMessage("You are will be kicked for unknown packet flooding, GM informed."); + client.getActiveChar().closeNetConnection(); + } + break; + case(3): + _log.warning("PacketProtection: " + client.toString() + " got banned due flooding of unknown packets"); + LoginServerThread.getInstance().sendAccessLevel(client.getAccountName(), -99); + if(client.getActiveChar() != null) + { + GmListTable.broadcastMessageToGMs("Player " + client.getActiveChar().toString() + " flooding unknown packets and got banned."); + client.getActiveChar().sendMessage("You are banned for unknown packet flooding, GM informed."); + client.getActiveChar().closeNetConnection(); + } + break; + } + } // impl public L2GameClient create(MMOConnection<L2GameClient> con) Index: C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/util/FloodProtector.java =================================================================== --- C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/util/FloodProtector.java (revision 1025) +++ C:/Workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/util/FloodProtector.java (working copy) @@ -50,15 +50,16 @@ // ========================================================= // Enum - private static final int PROTECTEDACTIONSIZE = 3; + private static final int PROTECTEDACTIONSIZE = 4; // reuse delays for protected actions (in game ticks 1 tick = 100ms) - private static final int[] REUSEDELAY = new int[]{ 4, 42, 42 }; + private static final int[] REUSEDELAY = new int[]{ 4, 42, 42, 15 }; // protected actions public static final int PROTECTED_USEITEM = 0; public static final int PROTECTED_ROLLDICE = 1; public static final int PROTECTED_FIREWORK = 2; + public static final int PROTECTED_UNKNOWNPACKET = 3; // ========================================================= // Constructor Note: this is not 100% Mine, i just make some modifications to make it work on Interlude. Thank you. So, Credits: L2JForum,
-
New Away + Back Command System. Is really simple and nice. How it works: Version 1: When you type .away: You get a Green title " *Away * ", this commands also informs the players that you are away , also it costs 500Milion. Just to avoid spam Version 2: Added Some useful protections. Changed Announcements text + Message to player. Version 1: When you type .back: Away title is removed, also this command " .back " informs the players that you are back .back is free. Version 2: Added Some useful protections. Changed Announcements text + Message to player. Patch: Version 2. ### Eclipse Workspace Patch 1.0 #P L2JEclipse-Private Index: trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/away.java =================================================================== --- trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/away.java (revision 0) +++ trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/away.java (revision 0) @@ -0,0 +1,114 @@ +package net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; +import net.sf.l2j.gameserver.Announcements; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +public class away implements IVoicedCommandHandler +{ + private static final String[] VOICED_COMMANDS = { "away", "back" }; + + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) + { + if (command.equalsIgnoreCase("away")) + { + else if(activeChar.isInJail()) + { + activeChar.sendMessage("You cannot use this command while you are in Jail!"); + return false; + } + else if(activeChar.isInOlympiadMode()) + { + activeChar.sendMessage("You cannot use this command while you are in the Olympiad now."); + return false; + } + else if(activeChar.atEvent) + { + activeChar.sendMessage("You cannot use this command while you are in an event."); + return false; + } + else if (activeChar.isInDuel()) + { + activeChar.sendMessage("You cannot use this command while you are in a duel!"); + return false; + } + else if (activeChar.inObserverMode()) + { + activeChar.sendMessage("You cannot use this command while you are in Observer Mode."); + } + else if (activeChar.isFestivalParticipant()) + { + activeChar.sendMessage("You cannot use this command while you are in a festival."); + return false; + } + else if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift()) + { + activeChar.sendMessage("You cannot use this command while you are in the dimensional rift."); + return false; + } + + if(activeChar.getInventory().getItemByItemId(57) != null && activeChar.getInventory().getItemByItemId(57).getCount() >= 500000000) + { + activeChar.getInventory().destroyItemByItemId("Away", 57, 500000000, activeChar, activeChar.getTarget()); + Announcements.getInstance().announceToAll("AWAY: " + activeChar + " is away"); + activeChar.sendMessage("You are away from keyboard, 500Milion adena dissapeared, players informed."); + activeChar.getAppearance().setTitleColor(0xFF000); + activeChar.setTitle("*Away*"); // Title text when somebody is away. + activeChar.broadcastUserInfo(); + } + } + + else + + if (command.equalsIgnoreCase("back")) + { + else if(activeChar.isInJail()) + { + activeChar.sendMessage("You cannot use this command while you are in Jail!"); + return false; + } + else if(activeChar.isInOlympiadMode()) + { + activeChar.sendMessage("You cannot use this command while you are in the Olympiad now."); + return false; + } + else if(activeChar.atEvent) + { + activeChar.sendMessage("You cannot use this command while you are in an event."); + return false; + } + else if (activeChar.isInDuel()) + { + activeChar.sendMessage("You cannot use this command while you are in a duel!"); + return false; + } + else if (activeChar.inObserverMode()) + { + activeChar.sendMessage("You cannot use this command while you are in Observer Mode."); + } + else if (activeChar.isFestivalParticipant()) + { + activeChar.sendMessage("You cannot use this command while you are in a festival."); + return false; + } + else if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift()) + { + activeChar.sendMessage("You cannot use this command while you are in the dimensional rift."); + return false; + } + + Announcements.getInstance().announceToAll("BACK: " + activeChar + " is back."); + activeChar.sendMessage("You are back. Players informed."); + activeChar.setTitle(" "); + activeChar.broadcastUserInfo(); + } + return true; + + } + + public String[] getVoicedCommandList() + { + return VOICED_COMMANDS; + } + +} \ No newline at end of file Index: trunk/Eclipse-Game/java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- trunk/Eclipse-Game/java/net/sf/l2j/gameserver/GameServer.java (revision 223) +++ trunk/Eclipse-Game/java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -199,6 +199,7 @@ import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvT; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.trade; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.pm; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.away; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Info; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Cl; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.karma; @@ -616,6 +617,7 @@ _voicedCommandHandler.registerVoicedCommandHandler(new karma()); + _voicedCommandHandler.registerVoicedCommandHandler(new away()); _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers."); Credits: ehh me.
-
Hello MxC Community, i decided to share something that Eminence was using for the Jail System. More info:. When somebody goes to the Jail Zone, he gains one Skill ( of your choice ), is really really simple. So Lets Start: Open the L2JailZone.java file wich is located right here: [glow=red,2,300]java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java[/glow] And add the lines ( when somebody ENTER'S the Jail Zone ) + character.startAbnormalEffect(0x2000); + if (character.getKnownSkill(Your Skill ID) == null) + { + character.addSkill(SkillTable.getInstance().getInfo(Your Skill ID, 1)); + } And add the lines after ( remove this skill when he LEFTS the Jail zone ) + character.stopAbnormalEffect((short) 0x2000); + if (character.getKnownSkill(Your Skill ID) != null) + { + character.removeSkill(SkillTable.getInstance().getInfo(Your Skill ID, 1)); + } And do not forget to add the imports: ( In the same file ) +import net.sf.l2j.gameserver.datatables.SkillTable; And here is the diff file to add it easier :P: Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java (revision 28) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java (revision 183) @@ -18,5 +18,4 @@ package net.sf.l2j.gameserver.model.zone.type; +import net.sf.l2j.gameserver.datatables.SkillTable; import net.sf.l2j.gameserver.model.L2Character; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; @@ -44,9 +43,4 @@ character.setInsideZone(L2Character.ZONE_JAIL, true); character.setInsideZone(L2Character.ZONE_PVP, true); + character.startAbnormalEffect(0x2000); + if (character.getKnownSkill(Your skill id) == null) + { + character.addSkill(SkillTable.getInstance().getInfo(Your skill id, 1)); + } ((L2PcInstance)character).sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE)); } @@ -60,9 +54,4 @@ character.setInsideZone(L2Character.ZONE_JAIL, false); character.setInsideZone(L2Character.ZONE_PVP, false); + character.stopAbnormalEffect((short) 0x2000); + if (character.getKnownSkill(Your skill id) != null) + { + character.removeSkill(SkillTable.getInstance().getInfo(Your skill id, 1)); + } ((L2PcInstance)character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE)); } This code is not only for Jail Zone, you can add it on any zone you would like is just an example. Hope you like it.
-
gt to lec auto.
-
Yio yio !:
-
http://www.youtube.com/watch?v=cXidLKnQKQA Dedicated to sX
-
Etc, etc 8a elega :D kana 2 - 3 etoixa mono :D
-
[Recruiting] L2JInterlude Development.
SySt3MGaM3RFr3aKs replied to SySt3MGaM3RFr3aKs's question in Request Server Development Help [L2J]
I Actually don't care. :D, I work on my private mostly. ! -
Apart from his big sig, look at his Karma / posts per day, he is a nice spammer. ! He should be banned.
-
[Share]New Hot NPCSS
SySt3MGaM3RFr3aKs replied to Street-Gamer's topic in Server Development Discussion [L2J]
Forgive me but i think some of them are already shared. Anyway, thanks for sharing them here ( again maybe ) dude :D
