Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: config/players.properties
- ===================================================================
- --- config/players.properties (revision 3)
- +++ config/players.properties (working copy)
- @@ -42,6 +42,9 @@
- # Death Penalty chance if killed by mob (in %), 20 by default
- DeathPenaltyChance = 20
- +# Each X minutes the server will count the player as AFK when he don't act.
- +TimerAFK = 10
- +
- #=============================================================
- # Inventory / Warehouse
- #=============================================================
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 3)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -356,6 +356,7 @@
- public static boolean DEEPBLUE_DROP_RULES;
- public static boolean ALT_GAME_DELEVEL;
- public static int DEATH_PENALTY_CHANCE;
- + public static int AFK_TIMER;
- /** Inventory & WH */
- public static int INVENTORY_MAXIMUM_NO_DWARF;
- @@ -1028,6 +1029,7 @@
- DEEPBLUE_DROP_RULES = players.getProperty("UseDeepBlueDropRules", true);
- ALT_GAME_DELEVEL = players.getProperty("Delevel", true);
- DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20);
- + AFK_TIMER = players.getProperty("TimerAFK", 10);
- INVENTORY_MAXIMUM_NO_DWARF = players.getProperty("MaximumSlotsForNoDwarf", 80);
- INVENTORY_MAXIMUM_DWARF = players.getProperty("MaximumSlotsForDwarf", 100);
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java (revision 3)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java (working copy)
- @@ -53,7 +53,8 @@
- final Collection<Player> players = World.getInstance().getPlayers();
- for (Player player : players)
- - createItem(activeChar, player, id, count, 0, false);
- + if (!player.isAFK())
- + createItem(activeChar, player, id, count, 0, false);
- activeChar.sendMessage(players.size() + " players rewarded with " + ItemTable.getInstance().getTemplate(id).getName());
- }
- Index: java/net/sf/l2j/gameserver/model/actor/instance/Player.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/Player.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/Player.java (working copy)
- @@ -569,6 +569,8 @@
- private Door _requestedGate;
- + private long _lastAction;
- +
- /**
- * Constructor of Player (use Creature constructor).
- * <ul>
- @@ -9703,6 +9705,16 @@
- _requestedGate = door;
- }
- + public boolean isAFK()
- + {
- + return _lastAction < System.currentTimeMillis();
- + }
- +
- + public void updateLastAction()
- + {
- + _lastAction = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(Config.AFK_TIMER);
- + }
- +
- @Override
- public boolean polymorph(PolyType type, int npcId)
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java (working copy)
- @@ -55,6 +55,8 @@
- if (activeChar == null)
- return;
- + activeChar.updateLastAction();
- +
- if (activeChar.isOutOfControl())
- {
- activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java (working copy)
- @@ -34,6 +34,8 @@
- if (player == null)
- return;
- + player.updateLastAction();
- +
- if (player.isFakeDeath())
- {
- player.stopFakeDeath(true);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestSocialAction.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestSocialAction.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestSocialAction.java (working copy)
- @@ -27,6 +27,8 @@
- if (activeChar == null)
- return;
- + activeChar.updateLastAction();
- +
- if (activeChar.isFishing())
- {
- activeChar.sendPacket(SystemMessageId.CANNOT_DO_WHILE_FISHING_3);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (working copy)
- @@ -115,6 +115,8 @@
- if (player == null)
- return;
- + player.updateLastAction();
- +
- if (_type < 0 || _type >= CHAT_NAMES.length)
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java (working copy)
- @@ -28,6 +28,8 @@
- if (player == null)
- return;
- + player.updateLastAction();
- +
- if (!player.getAccessLevel().allowTransaction())
- {
- player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (working copy)
- @@ -42,6 +42,8 @@
- if (activeChar == null)
- return;
- + activeChar.updateLastAction();
- +
- if (activeChar.isInStoreMode())
- {
- activeChar.sendPacket(SystemMessageId.ITEMS_UNAVAILABLE_FOR_STORE_MANUFACTURE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement