Jump to content

Recommended Posts

Posted

Offline trade/craft mode disabled by default and can be enabled in character.properties, craft and trade can be enabled separately. You must open private store/craft and simply close client (using logout) - character will enter offline mode automatically, same for network connection loss in private store/craft mode.

Restrictions: characters automatically leave party then entering offline mode for prevent bot-like exping. Characters in olympiad mode and festival participants can not use offline trade/craft and will be removed from world as usual.

Characters in offline mode can not receive PMs (message about this will be sent to sender). It is possible to set name colour of the offline characters - see config.

 

Combat stance was committed in rev.2750.

 

V2. Fixed problem then characters can stay in world even if not in store/craft mode on disconnection. Also added check for TvT participants - they can not use offline trade/craft too and will be removed from the world.

 

V3. All offline trade/craft options moved to l2jmods.properties. No other changes.

 

V4. Synchronization added on creating clean task.

 

V5. Syncronization reworked a little, to avoid possible variable corruption. Jailed characters can't use offline mode too. Fixed bug pointed by nBd.

 

V6. Fixed problem with "server transfer" function in Alt-G and added exit from detach mode on the end of cleanup, hope it helps

 

V7. Scheduling part reworked, added fallback timestamp (if character disconnected in more than 16s he will be kicked instantly on relogin)

 

V8. Hope long disconnect under linux bug fixed. Returned to the old scheme (with single task).

 

V9. Number of the detached players added to the telnet "status" output. All incoming packets dropped in offline mode too. (but i still dont know how they come after disconnection).

 

V10. Fixed bug with "admin_find_ip" command. Now it is possible to find both online and detached characters.

 

V11. Because combat stance was committed this patch contains only offline trade. Now not possible to send party invite request to offline chars (crafters become busy) and they not shown as online in clan menu (tnx pompinus).

 

V12. Update to current and fix for NPE in L2ClanMember.isOnline()

 

Datapack  patch:

 

Index: data/scripts/handlers/chathandlers/ChatTell.java
===================================================================
--- data/scripts/handlers/chathandlers/ChatTell.java	(revision 5944)
+++ data/scripts/handlers/chathandlers/ChatTell.java	(working copy)
@@ -76,6 +76,11 @@
				activeChar.sendMessage("Player is chat banned.");
				return;
			}
+			if (receiver.getClient().isDetached())
+			{
+				activeChar.sendMessage("Player is in offline mode.");
+				return;
+			}

			if (!receiver.getMessageRefusal())
			{

 

Gs patch :

Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 2917)
+++ java/config/l2jmods.properties	(working copy)
@@ -197,6 +197,24 @@


# ---------------------------------------------------------------------------
+# Offline trade/craft
+# ---------------------------------------------------------------------------
+# Option to enable or disable offline trade feature.
+# Enable -> true, Disable -> false
+OfflineTradeEnable = False
+
+# Option to enable or disable offline craft feature.
+# Enable -> true, Disable -> false
+OfflineCraftEnable = False
+
+# If set to True, name color will be changed then entering offline mode
+OfflineSetNameColor = False
+
+# Color of the name in offline mode (if OfflineSetNameColor = True)
+OfflineNameColor = 808080
+
+
+# ---------------------------------------------------------------------------
# Mana Drugs/Potions
# ---------------------------------------------------------------------------
# This option will enable core support for:
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 2917)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -538,6 +538,10 @@
	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
+	public static boolean OFFLINE_TRADE_ENABLE;
+	public static boolean OFFLINE_CRAFT_ENABLE;
+	public static boolean OFFLINE_SET_NAME_COLOR;
+	public static int OFFLINE_NAME_COLOR;
	public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;


@@ -1716,6 +1720,11 @@
					BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
					BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));

+					OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
+					OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
+					OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
+					OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
+
					L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
				}
				catch (Exception e)
Index: java/net/sf/l2j/gameserver/network/L2GameClient.java
===================================================================
--- java/net/sf/l2j/gameserver/network/L2GameClient.java	(revision 2917)
+++ java/net/sf/l2j/gameserver/network/L2GameClient.java	(working copy)
@@ -39,6 +39,7 @@
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.L2Event;
+import net.sf.l2j.gameserver.model.entity.TvTEvent;
import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
import net.sf.l2j.util.EventData;

@@ -580,9 +581,25 @@
			{
				isDetached(true);
				L2PcInstance player = L2GameClient.this.getActiveChar();
-				if (player != null && player.isInCombat())
+				if (player != null)
				{
-					fast = false;
+					if (!player.isInOlympiadMode() && !player.isFestivalParticipant() && !TvTEvent.isPlayerParticipant(player.getObjectId()) && !player.isInJail())
+					{
+						if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
+						{
+							player.leaveParty();
+							if (Config.OFFLINE_SET_NAME_COLOR)
+							{
+								player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
+								player.broadcastUserInfo();
+							}
+							return;
+						}
+					}
+					if (player.isInCombat())
+					{
+						fast = false;
+					}
				}
				cleanMe(fast);
			}
Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java	(revision 2917)
+++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java	(working copy)
@@ -103,6 +103,13 @@
		}

		TvTEvent.onLogout(player);
+		
+		if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
+		{
+			player.closeNetConnection();
+			return;
+		}
+
		RegionBBSManager.getInstance().changeCommunityBoard();

		player.deleteMe();
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java	(revision 2917)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java	(working copy)
@@ -105,6 +105,12 @@
			requestor.sendMessage("Player is in Jail");
			return;
		}
+		
+		if (target.getClient().isDetached())
+		{
+			requestor.sendMessage("Player is in offline mode.");
+			return;
+		}

         if (target.isInOlympiadMode() || requestor.isInOlympiadMode())
             return;
Index: java/net/sf/l2j/gameserver/model/L2ClanMember.java
===================================================================
--- java/net/sf/l2j/gameserver/model/L2ClanMember.java	(revision 2917)
+++ java/net/sf/l2j/gameserver/model/L2ClanMember.java	(working copy)
@@ -143,7 +143,14 @@

	public boolean isOnline()
	{
-		return _player != null;
+		if (_player == null)
+			return false;
+		if (_player.getClient() == null)
+			return false;
+		if (_player.getClient().isDetached())
+			return false;
+
+		return true;
	}

	/**

 

Credits : l2jserver.forum _DS_

  • 5 weeks later...
Posted

where is the link? how i use it ? for what chronicle is ?

 

Lol man if You dont know how to use it dont post here , go and read some guides , this is code you must inserd it into your source code and compile .

Posted

I hear this is easily exploitable.. anyone know different? if not, ill check this out. id like to have an offline craft/shop, just the ones I have tried could be exploited.

  • 1 month later...
Posted

Lol man if You dont know how to use it dont post here , go and read some guides , this is code you must inserd it into your source code and compile .

 

I agree with my friend upstairs...Always wrong posts guys!

  • 8 months later...
Posted

i have La2Base Pay Version and i have no this file:

 

Index: data/scripts/handlers/chathandlers/ChatTell.java
===================================================================
--- data/scripts/handlers/chathandlers/ChatTell.java	(revision 5944)
+++ data/scripts/handlers/chathandlers/ChatTell.java	(working copy)
@@ -76,6 +76,11 @@
				activeChar.sendMessage("Player is chat banned.");
				return;
			}
+			if (receiver.getClient().isDetached())
+			{
+				activeChar.sendMessage("Player is in offline mode.");
+				return;
+			}

			if (!receiver.getMessageRefusal())
			{

Posted

i have La2Base Pay Version and i have no this file:

 

Index: data/scripts/handlers/chathandlers/ChatTell.java
===================================================================
--- data/scripts/handlers/chathandlers/ChatTell.java	(revision 5944)
+++ data/scripts/handlers/chathandlers/ChatTell.java	(working copy)
@@ -76,6 +76,11 @@
				activeChar.sendMessage("Player is chat banned.");
				return;
			}
+			if (receiver.getClient().isDetached())
+			{
+				activeChar.sendMessage("Player is in offline mode.");
+				return;
+			}

			if (!receiver.getMessageRefusal())
			{

 

La2Base dont have this chathandler. You can be in patience. ;)

  • 7 months later...
Posted

My pack doesn't support this: if (receiver.getClient().isDetached())

 

Try this, if u don't have.

Index: /TrunK/Trance-Core/java/net/sf/l2j/gameserver/network/L2GameClient.java
===================================================================
--- /TrunK/Trance-Core/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 2)
+++ /TrunK/Trance-Core/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 13)
@@ -70,4 +70,6 @@
	public byte packetsSentInSec = 0;
	public int packetsSentStartTick = 0;
+	
+	private boolean _isDetached = false;

	public L2GameClient(MMOConnection<L2GameClient> con)
@@ -168,5 +170,15 @@
		gsp.runImpl();
	}
-
+	
+	public boolean isDetached()
+	{
+		return _isDetached;
+	}
+
+	public void setDetached(boolean b)
+	{
+		_isDetached = b;
+	}
+	
	public L2PcInstance markToDeleteChar(int charslot) throws Exception
	{

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Seems legit, for sure deserves a try!
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • +8? Isnt +5 max per one stat?
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock