• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Server-sided character unstucker

Joined
Feb 23, 2008
Messages
507
Reaction score
361
Yeah, I know there are some offline unstuckers, but these are better as they disconnect an already logged-in player.

Go to net.channel.handler.playerloggedinhandler.java


Look for :
PHP:
boolean allowLogin = true;
        ChannelServer channelServer = c.getChannelServer();

Replace
PHP:
WorldChannelInterface worldInterface = channelServer.getWorldInterface();
				if (state == MapleClient.LOGIN_SERVER_TRANSITION) {
					for (String charName : c.loadCharacterNames(c.getWorld())) {
						if (worldInterface.isConnected(charName)) {
							
							allowLogin = false;
							break;
						}
					}
				}

With this :
PHP:
WorldChannelInterface worldInterface = channelServer.getWorldInterface();
                if (state == MapleClient.LOGIN_SERVER_TRANSITION) {
                    for (String charName : c.loadCharacterNames(c.getWorld())) {
                        if (worldInterface.isConnected(charName)) {
                           System.err.print(charName + " has been unstucked, for bug-testing purposes.");
                            MapleCharacter player_to_dc = player.getClient().getChannelServer().getPlayerStorage().getCharacterByName(charName);
                            player_to_dc.getClient().disconnect();
                            player_to_dc.getClient().getSession().close();
                             c.getSession().write(MaplePacketCreator.serverNotice(1, "\r\n\r\n\r\n Player was unstuck.\r\n Please re-log"));
                            player_to_dc.getMap().removePlayer(player_to_dc);
                            allowLogin = false;
                            break;
                        }
                    }
                }


Information:
Basically, you know whenever your character is stuck on the channelserver, it keeps you from logging in , and on the channel-server bat window, you see something like "[h4x] Player is trying to double-login "

Well, what this basically does is that it disconnects the stuck player and then makes you re-login so you can connect. (Duping shouldn't be possible).

Report any bugs you may encounter, I've used this on my server and it seems good. :) ~

This was tested on Arber (v75) and Shootsource(v75) .

As always, if you migrate this release to another forum, provide the necessary credits! Credits to LxShutdown/FateJiki/Seclusion


~Julez
 
Last edited:
Skilled Illusionist
Loyal Member
Joined
Aug 4, 2008
Messages
376
Reaction score
37
Pretty sure this has been released a long time ago. I've seen it somewhere.
 
Custom Title Activated
Loyal Member
Joined
Nov 27, 2009
Messages
1,905
Reaction score
948
So you're releasing something that is already in a repack?
 
Junior Spellweaver
Joined
Aug 15, 2008
Messages
192
Reaction score
12
Then proof it instead of flaming.
 
Junior Spellweaver
Joined
Sep 19, 2009
Messages
138
Reaction score
92
Code:
if (worldInterface.isConnected(charName)) {

You guys should really think before you do something.
If a character isn't removed from the HashMap of PlayerStorage, it'll still return true.


Also, if you got everything well planned before coding new contents it will not cause any character stuck problem at all.
 
Last edited:
Joined
Feb 23, 2008
Messages
507
Reaction score
361
Alright guys, instead of posting that you've seen this before, post the freaking link to the thread containing the original content, instead of spamming the same thing .
 
Newbie Spellweaver
Joined
Apr 10, 2009
Messages
91
Reaction score
195
This probably hasn't been explicitly released, I haven't seen it before in any repack.

I've used this method for quite a while now, except without the notice (I might add that, thanks for the idea).

Edit: Btw, @lightpepsi disconnect() should handle removing the character from maps/channels and the rest of the cleanup.
 
Last edited:
offonline
Loyal Member
Joined
Aug 5, 2009
Messages
1,403
Reaction score
164
I excuse for the bump but what the hell.

Can someone confirm, that this 'method' is secure and suitable for a mass populated server (not refering to my server, just incase ) :laugh:
 
offonline
Loyal Member
Joined
Aug 5, 2009
Messages
1,403
Reaction score
164
And according to me transition ° loggedin 1, people who are stuck have 2 right 0_0?

seems to be correct..
PHP:
   public static final int LOGIN_NOTLOGGEDIN = 0;
    public static final int LOGIN_SERVER_TRANSITION = 1;
    public static final int LOGIN_LOGGEDIN = 2;

so
PHP:
if (state == MapleClient.LOGIN_SERVER_TRANSITION) {

should be

PHP:
if (state == MapleClient.LOGIN_LOGGEDIN) {


:blink:
 
Junior Spellweaver
Joined
Aug 15, 2008
Messages
192
Reaction score
12
Err.. 2 is loggedin, and 1 is stuck o_O
 
Back
Top