Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/head-src/com/l2jfrozen/Config.java b/head-src/com/l2jfrozen/Config.java
- index e41a7fe..166a404 100644
- --- a/head-src/com/l2jfrozen/Config.java
- +++ b/head-src/com/l2jfrozen/Config.java
- @@ -189,7 +189,7 @@
- public static int KNOWNLIST_FORGET_DELAY;
- public static int MINIMUN_UPDATE_TIME;
- public static boolean BYPASS_VALIDATION;
- -
- + public static int AFK_TIMER;
- public static boolean HIGH_RATE_SERVER_DROPS;
- public static boolean FORCE_COMPLETE_STATUS_UPDATE;
- @@ -586,7 +586,7 @@
- final InputStream is = new FileInputStream(new File(OTHER));
- otherSettings.load(is);
- is.close();
- -
- + AFK_TIMER = Integer.parseInt(otherSettings.getProperty("TimerAFK", "10"));
- DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
- ALLOW_GUARDS = Boolean.valueOf(otherSettings.getProperty("AllowGuards", "False"));
- EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java b/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java
- index 60012d1..f7eb345 100644
- --- a/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java
- +++ b/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java
- @@ -357,7 +357,7 @@
- activeChar.setTarget(activeChar);
- Player = activeChar;
- }
- -
- + if (!activeChar.isAFK())
- Player.getInventory().addItem("Admin", id, num, Player, null);
- ItemList il = new ItemList(Player, true);
- Player.sendPacket(il);
- diff --git a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- index b60fcda..a281692 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- @@ -19615,7 +19615,16 @@
- {
- return _currentPetSkill;
- }
- -
- + private long _lastAction;
- + public boolean isAFK()
- + {
- + return _lastAction < System.currentTimeMillis();
- + }
- +
- + public void updateLastAction()
- + {
- + _lastAction = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(Config.AFK_TIMER);
- + }
- /**
- * Create a new SkillDat object and set the player _currentPetSkill.<br>
- * <br>
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java
- index 2bbba88..576d2e5 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java
- @@ -77,7 +77,7 @@
- if (activeChar == null)
- return;
- -
- + activeChar.updateLastAction();
- // Move flood protection
- if (!getClient().getFloodProtectors().getMoveAction().tryPerformAction("MoveBackwardToLocation"))
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java
- index 63ffb78..4098ef8 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java
- @@ -231,7 +231,7 @@
- if (activeChar == null)
- return;
- -
- + activeChar.updateLastAction();
- if (activeChar.isFakeDeath())
- {
- activeChar.stopFakeDeath(null);
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java
- index 3a43371..d91045e 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java
- @@ -47,7 +47,7 @@
- final L2PcInstance activeChar = getClient().getActiveChar();
- if (activeChar == null)
- return;
- -
- + activeChar.updateLastAction();
- // You cannot do anything else while fishing
- if (activeChar.isFishing())
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- index 9a1d21a..b7c615c 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- @@ -142,7 +142,7 @@
- LOGGER.warn("[Say2.java] Active Character is null.");
- return;
- }
- -
- + activeChar.updateLastAction();
- if (activeChar.isChatBanned() && !activeChar.isGM() && _type != CLAN && _type != ALLIANCE && _type != PARTY)
- {
- activeChar.sendMessage("You may not chat while a chat ban is in effect.");
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java
- index e988860..dacfb3c 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java
- @@ -50,7 +50,7 @@
- final L2PcInstance player = getClient().getActiveChar();
- if (player == null)
- return;
- -
- + player.updateLastAction();
- if (!player.getAccessLevel().allowTransaction())
- {
- player.sendMessage("Transactions are disable for your Access Level");
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- index 4d3b028..ee40555 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- @@ -66,7 +66,7 @@
- final L2PcInstance activeChar = getClient().getActiveChar();
- if (activeChar == null)
- return;
- -
- + activeChar.updateLastAction();
- final L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
- if (item == null)
- Index: DataPack
- # Crit announce
- GMShowCritAnnouncerName = False
- +# Each X minutes the server will count the player as AFK when he don't act.
- +TimerAFK = 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement