Hello Maxcheaters! I was browsing in some forums and I found this code that is an antk fk .. I wanted to know if anyone could adapt it to work only for the players that are in tvt, ctf, dm .. players that stay afk take kick of the event .. My project is JFrozen.
public List<String> active_boxes_characters = new ArrayList<String>();
+ private long _lastAction = 0;
+
/** 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=?,good=?,evil=?,gve_kills=? 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=?,punish_level=?,punish_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=?,pc_point=?,name_color=?,title_color=?,aio=?,aio_end=? WHERE obj_id=?";
@@ -19299,6 +19301,16 @@
}
*/
}
+
+ public long getLastActionMillis()
+ {
+ return _lastAction;
+ }
+
+ public void setLastActionMillis(long val)
+ {
+ _lastAction = val;
+ }
/**
* Aio System Start.
@@ -20376,5 +20388,4 @@
_currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
ElmoreLab Harbor - Eternal C1 x1:
✅ https://harbor.elmorelab.com
ElmoreLab Harbor - Eternal C1 x1 - is an exclusive server of the Eternal C1 chronicles from the top project ElmoreLab Harbor.
A unique server of its kind, on which everyone will have maximum pleasure, such as oldschool players who dream of nostalgia and to feel the warmest and classic C1 chronicles, as well as experienced players who are tired of thousands unbalanced servers of late chronicles.
Due to the professional corrections of the balance system and the HONEST gameplay system - on this server, EVERY player will feel like in their own, warm and cozy Harbor C1.
Let's return to the origins of L2 - back to 2004 in C1! ❤️
⭐ Server characteristics:
STRICTLY 1 window, NO BOXES
Bans for RMT and bots/cheats
No donations with benefits
Unique and high-quality PTS-build from Master Toma
Professional corrections and full class-balance
Reworked economy and closed all abuses
Improved animations and all aspects of the game
Exclusive HD-client with high-quality textures
Experienced administration and management
Fixed all bugs, geodata, exploits and holes
Maximum sociality due to the 1-box system
Discovering, exploring and researching
Big online
International server
Nostalgia and oldschool-feelings
Rates: x1
Server start: 14.02.2025
The server is at the final stages of development and preparation for release. Information on the server will be updated, soon the patchnotes and changes/edits will be posted.
Don't miss the legendary and epic experience on the best server in the last 20 years! ❤️
Join our C1-forum with a lot of information about server and active discussions.
⭐ Website:
https://harbor.elmorelab.com
✅ Forum:
https://forum-harbor.elmorelab.com
💥 Telegram:
https://t.me/l2harbor
https://t.me/l2harbor_chat
⚡ Discord:
https://discord.gg/harborelmorelab
yeah ok, if you say what is fuctional 100% i can't say something different 😛
but if someone find hard to compile it or get vs and all that things i have here one more simple way here to put overlay in your own server or to change your window name with few money.
I've been using this for 2 years now with no issues from Discord. I don't use ogg.dll either. This one works with any l2.exe too; I don’t see any difference between them.
hmm.. ok i just see that, is different code first of all. My sources is totally different based in other way, with else libraries.
I have access to modify everything even to make the clock to stop show how many time users play in server.
1) so maybe keep some personal info more hide.
2) i dont use ogg.dll
3) i create it and give it ready + support to install it.
Plus what is mine can working with what ever .exe you want not just l2 with same simple method.
And i am sure if you try this source to compile it, after 3 hours discord will like shadowban your API too
thats my source
Question
DeJavaAiQueEuVouBolar
Hello Maxcheaters! I was browsing in some forums and I found this code that is an antk fk .. I wanted to know if anyone could adapt it to work only for the players that are in tvt, ctf, dm .. players that stay afk take kick of the event .. My project is JFrozen.
# Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (revision 1004)
+++ head-src/com/l2jfrozen/Config.java (working copy)
@@ -3418,6 +3418,9 @@
public static int ALLOWED_BOXES;
public static boolean ALLOW_DUALBOX_OLY;
public static boolean ALLOW_DUALBOX_EVENT;
+
+ public static int LEAVEBURSTER_TIME_KICK;
+
//============================================================
public static void loadPOtherConfig()
{
@@ -3453,6 +3456,8 @@
BOT_PROTECTOR_FIRST_CHECK = Integer.parseInt(POtherSetting.getProperty("BotProtectFirstCheck", "15"));
BOT_PROTECTOR_NEXT_CHECK = Integer.parseInt(POtherSetting.getProperty("BotProtectNextCheck", "60"));
BOT_PROTECTOR_WAIT_ANSVER = Integer.parseInt(POtherSetting.getProperty("BotProtectAnsver", "180"));
+
+ LEAVEBURSTER_TIME_KICK = Integer.parseInt(POtherSetting.getProperty("LeaveBursterTimeKick", "10"));
}
catch(Exception e)
{
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestartPoint.java (working copy)
@@ -230,6 +230,8 @@
if (activeChar == null)
return;
+ activeChar.setLastActionMillis(System.currentTimeMillis());
+
if (activeChar.isFakeDeath())
{
activeChar.stopFakeDeath(null);
Index: head-src/com/l2jfrozen/gameserver/model/entity/LeaveBuster.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/LeaveBuster.java (revision 0)
+++ head-src/com/l2jfrozen/gameserver/model/entity/LeaveBuster.java (working copy)
@@ -0,0 +1,66 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package com.l2jfrozen.gameserver.model.entity;
+
+import java.util.concurrent.ScheduledFuture;
+import java.util.logging.Logger;
+
+import javolution.util.FastMap;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Anarchy
+ */
+public class LeaveBuster implements Runnable
+{
+ public static FastMap<L2PcInstance, ScheduledFuture<?>> _players = new FastMap<L2PcInstance, ScheduledFuture<?>>();
+
+ private static final Logger _log = Logger.getLogger(LeaveBuster.class.getName());
+
+ private L2PcInstance _p = null;
+
+ public LeaveBuster(L2PcInstance p)
+ {
+ _p = p;
+ }
+
+ @Override
+ public void run()
+ {
+ if (_p == null || _p.isOnline() == 0)
+ {
+ if (_p != null)
+ {
+ _players.get(_p).cancel(true);
+ _players.remove(_p);
+ }
+
+ return;
+ }
+
+ if ((System.currentTimeMillis() - _p.getLastActionMillis()) / 1000 / 60 >= Config.LEAVEBURSTER_TIME_KICK)
+ {
+ _log.info("Leave Buster: " + _p.getName() + " was kicked out of game.");
+ _players.get(_p).cancel(true);
+ _players.remove(_p);
+ _p.logout();
+ }
+ }
+}
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java (working copy)
@@ -170,6 +170,8 @@
_type = PETITION_GM;
}
+ activeChar.setLastActionMillis(System.currentTimeMillis());
+
if(_text.length() > Config.MAX_CHAT_LENGTH)
{
if(Config.DEBUG)
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java (working copy)
@@ -27,6 +27,7 @@
import com.l2jfrozen.gameserver.model.Inventory;
import com.l2jfrozen.gameserver.model.L2Party;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.entity.LeaveBuster;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival;
import com.l2jfrozen.gameserver.network.L2GameClient;
@@ -60,6 +61,8 @@
return;
}
+ player.setLastActionMillis(System.currentTimeMillis());
+
// Check if player is enchanting
if(player.getActiveEnchantItem() != null)
{
@@ -165,6 +168,9 @@
{
player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
}
+
+ LeaveBuster._players.get(player).cancel(true);
+ LeaveBuster._players.remove(player);
if(player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND)!=null
&& player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).isAugmented()){
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java (working copy)
@@ -49,7 +49,9 @@
if (player == null)
return;
- if (!player.getAccessLevel().allowTransaction())
+ player.setLastActionMillis(System.currentTimeMillis());
+
+ if (!player.getAccessLevel().allowTransaction())
{
player.sendMessage("Transactions are disable for your Access Level");
player.sendPacket(ActionFailed.STATIC_PACKET);
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java (working copy)
@@ -76,6 +76,8 @@
if (activeChar == null)
return;
+ activeChar.setLastActionMillis(System.currentTimeMillis());
+
// Move flood protection
if (!getClient().getFloodProtectors().getMoveAction().tryPerformAction("MoveBackwardToLocation"))
{
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java (working copy)
@@ -22,6 +22,7 @@
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2Party;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.entity.LeaveBuster;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival;
import com.l2jfrozen.gameserver.network.SystemMessageId;
@@ -47,6 +48,8 @@
if (player == null)
return;
+ player.setLastActionMillis(System.currentTimeMillis());
+
if (player.isInFunEvent() && !player.isGM())
{
player.sendMessage("You cannot Logout while in registered in an Event.");
@@ -118,6 +121,9 @@
if (player.isFlying())
player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
+ LeaveBuster._players.get(player).cancel(true);
+ LeaveBuster._players.remove(player);
+
if (Config.OFFLINE_LOGOUT && player.isSitting())
{
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
Index: config/protected/other.properties
===================================================================
--- config/protected/other.properties (revision 1004)
+++ config/protected/other.properties (working copy)
@@ -60,4 +60,7 @@
# The time interval, which will take place from the previous question until the next (minutes).
BotProtectNextCheck = 60
# Amount of time allowed for giving the answer (seconds).
-BotProtectAnsver = 200
\ No newline at end of file
+BotProtectAnsver = 200
+
+# Time to kick afkers. Default = 0 (Disabled)
+LeaveBursterTimeKick = 10
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (working copy)
@@ -64,6 +64,8 @@
if (activeChar == null)
return;
+ activeChar.setLastActionMillis(System.currentTimeMillis());
+
L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
if (item == null)
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy)
@@ -56,6 +56,7 @@
import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.model.entity.ClanHall;
import com.l2jfrozen.gameserver.model.entity.Hero;
+import com.l2jfrozen.gameserver.model.entity.LeaveBuster;
import com.l2jfrozen.gameserver.model.entity.Wedding;
import com.l2jfrozen.gameserver.model.entity.event.CTF;
import com.l2jfrozen.gameserver.model.entity.event.DM;
@@ -133,6 +134,9 @@
// Set lock at login
activeChar.setLocked(true);
+ activeChar.setLastActionMillis(System.currentTimeMillis());
+ LeaveBuster._players.put(activeChar, ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new LeaveBuster(activeChar), 5000, 5000));
+
// Register in flood protector
//FloodProtector.getInstance().registerNewPlayer(activeChar.getObjectId());
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -455,6 +455,8 @@
/** The active_boxes_characters. */
public List<String> active_boxes_characters = new ArrayList<String>();
+ private long _lastAction = 0;
+
/** 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=?,good=?,evil=?,gve_kills=? 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=?,punish_level=?,punish_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=?,pc_point=?,name_color=?,title_color=?,aio=?,aio_end=? WHERE obj_id=?";
@@ -19299,6 +19301,16 @@
}
*/
}
+
+ public long getLastActionMillis()
+ {
+ return _lastAction;
+ }
+
+ public void setLastActionMillis(long val)
+ {
+ _lastAction = val;
+ }
/**
* Aio System Start.
@@ -20376,5 +20388,4 @@
_currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
}
-
}
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java (working copy)
@@ -45,6 +45,8 @@
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
return;
+
+ activeChar.setLastActionMillis(System.currentTimeMillis());
// You cannot do anything else while fishing
if(activeChar.isFishing())
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.