Jump to content
  • 0

[Help]Offline Trader's Online Time shouldn't be increased


Question

Posted

As the title says, I wan't to disable Onlinetime points from Detached characters.

Maybe something like this:

if (_onlineBeginTime > 0 && !getClient().isDetached())
			totalOnlineTime += (System.currentTimeMillis()-_onlineBeginTime)/1000;

Any idea?

 

3 answers to this question

Recommended Posts

  • 0
Posted

As the title says, I wan't to disable Onlinetime points from Detached characters.

Maybe something like this:

if (_onlineBeginTime > 0 && !getClient().isDetached())
			totalOnlineTime += (System.currentTimeMillis()-_onlineBeginTime)/1000;

Any idea?

 

 

I'm not sure if this works,but try to give character offline status.

                        try
		{
			isDetached(true);
			L2PcInstance player = L2GameClient.this.getActiveChar();
			if (player != null)
			{
				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();
+                                                       player.setOnlineStatus(false);
						if (Config.OFFLINE_SET_NAME_COLOR)
						{
							player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
							player.broadcastUserInfo();
						}
						return;
					}
				}
				if (player.isInCombat() || player.isLocked())
				{
					fast = false;
				}
			}
			cleanMe(fast);
		}

  • 0
Posted

I'm not sure if this works,but try to give character offline status.

                        try
		{
			isDetached(true);
			L2PcInstance player = L2GameClient.this.getActiveChar();
			if (player != null)
			{
				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();
+                                                       player.setOnlineStatus(false);
						if (Config.OFFLINE_SET_NAME_COLOR)
						{
							player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
							player.broadcastUserInfo();
						}
						return;
					}
				}
				if (player.isInCombat() || player.isLocked())
				{
					fast = false;
				}
			}
			cleanMe(fast);
		}

Hmm, y may it could work

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...