Jump to content

Question

Posted (edited)

I wanted to ask a simple question.
Can you ( as Admin ) force a player to restart or relog WITHOUT closing his client?

I am talking about making him lose connection to the server or any kind of trick, unless there is a legit way to do it.

Thanks in advace.

Edited by L2J NexuS

11 answers to this question

Recommended Posts

  • 0
Posted

Yes, you can logout without closing the client. I guess there is some disconnect command, option. Otherwise, code command with player.logout(false) - stands for close client. Alt+g may have disconnect button, I don't remember. 

  • 0
Posted
1 hour ago, SweeTs said:

Yes, you can logout without closing the client. I guess there is some disconnect command, option. Otherwise, code command with player.logout(false) - stands for close client. Alt+g may have disconnect button, I don't remember. 

Well, there are 2 things i dont get.
First of all the logout function does not accept true or false.

Looks like this on L2PcInstance.
 

public void logout() {
		if (getInventory().getItemByItemId(9819) != null) {
			Fort fort = FortManager.getInstance().getFort(this);
			if (fort != null) {
				FortSiegeManager.getInstance().dropCombatFlag(this);
			} else {
				int slot = getInventory().getSlotFromItem(getInventory().getItemByItemId(9819));
				getInventory().unEquipItemInBodySlotAndRecord(slot);
				destroyItem("CombatFlag", getInventory().getItemByItemId(9819), null, true);
			}
		}

		closeNetConnection();
	}

I tried to just do this :

					activeChar.closeNetConnection();

But it closes the client as well. ( Which in my understanding is the same thing )
And it looks like this :

public void closeNetConnection() {
		L2GameClient client = _client;

		if (client != null) {
			if (client.isDetached()) {
				client.cleanMe(true);
			} else {
				if (!client.getConnection().isClosed()) {
					client.close(new LeaveWorld());
				}
			}
		}
	}

 

  • 0
Posted

No sources so can't check. But you could take a look at Shutdown.java and see the disconnect players code. Example of l2jserver. The try block of disconnectAllCharacters

 

https://bitbucket.org/l2jserver/l2j_server/src/2c43c001b69f644c9d96b85309f1757710bdbe14/src/main/java/com/l2jserver/gameserver/Shutdown.java?at=develop&fileviewer=file-view-default

  • 0
Posted
5 minutes ago, SweeTs said:

No sources so can't check. But you could take a look at Shutdown.java and see the disconnect players code. Example of l2jserver. The try block of disconnectAllCharacters

 

https://bitbucket.org/l2jserver/l2j_server/src/2c43c001b69f644c9d96b85309f1757710bdbe14/src/main/java/com/l2jserver/gameserver/Shutdown.java?at=develop&fileviewer=file-view-default

Thank you, ill check it out in an hour and tell you the result.

  • 0
Posted

No problem, but still, you should have the logout with boolean (there is logout() and logout(closeClient)) , check pcinstance, and search for it. Else they introduced it later. 

  • 0
Posted (edited)

As i can see there isn't anything related to logout(closeClient) or whatsoever.

 

Anyway i will look more into it, i will download some sources from H5 to see if there is something to help me in there.

 

Edit : disconnectingAllPlayers from Shutdown.java should do the job but i don't think i am so good with Java to understand what is going on in there, so i will teach my self something and then i will proceed on completing this.

Edited by L2J NexuS
  • 0
Posted

aCis way to disconnect from one or another way. Basically you only have to send the correct packet, LeaveWorld or ServerClose.

	private void closeNetConnection(boolean closeClient)
	{
		L2GameClient client = _client;
		if (client != null)
		{
			if (client.isDetached())
				client.cleanMe(true);
			else
			{
				if (!client.getConnection().isClosed())
				{
					if (closeClient)
						client.close(LeaveWorld.STATIC_PACKET);
					else
						client.close(ServerClose.STATIC_PACKET);
				}
			}
		}
	}

 

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

    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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