L2J NexuS Posted February 9, 2018 Posted February 9, 2018 (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 February 9, 2018 by L2J NexuS
0 SweeTs Posted February 9, 2018 Posted February 9, 2018 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 L2J NexuS Posted February 9, 2018 Author Posted February 9, 2018 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 SweeTs Posted February 9, 2018 Posted February 9, 2018 It's actual for aCis. What pack are we talking about?
0 L2J NexuS Posted February 9, 2018 Author Posted February 9, 2018 15 minutes ago, SweeTs said: It's actual for aCis. What pack are we talking about? L2j
0 SweeTs Posted February 9, 2018 Posted February 9, 2018 2 minutes ago, L2J NexuS said: L2j Every pack is l2j :D L2jserver h5?
0 L2J NexuS Posted February 9, 2018 Author Posted February 9, 2018 Just now, SweeTs said: Every pack is l2j :D L2jserver h5? i am a dumb motherfucker. l2j GF Pride pack.
0 SweeTs Posted February 9, 2018 Posted February 9, 2018 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 L2J NexuS Posted February 9, 2018 Author Posted February 9, 2018 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 SweeTs Posted February 9, 2018 Posted February 9, 2018 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 L2J NexuS Posted February 9, 2018 Author Posted February 9, 2018 (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 February 9, 2018 by L2J NexuS
0 Tryskell Posted February 9, 2018 Posted February 9, 2018 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); } } } }
Question
L2J NexuS
I wanted to ask a simple question.
Edited by L2J NexuSCan 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.
11 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now