[RELEASE] Character Stuck Fix Command

Newbie Spellweaver
Joined
Apr 7, 2008
Messages
89
Reaction score
0
Hey,

This isn't much, and it is sorta crudely coded, but it works :D

This is a command fix for when a character gets stuck ingame, and the player can't login till the next server restart because of "doublelogin" error.

I added this in BanningCommands.java because it is pretty much just a edited dc command.

Command:

Code:
 else if (splitted[0].equals("!dctest")) {
            MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
            if (splitted[2].equals("2")) {
                            victim.getClient().disconnect();
            } else if (splitted[2].equals("6")) {
                            victim.getClient().getSession().close();
                            victim.getClient().disconnect();
                            victim.saveToDB(true);
                            cserv.removePlayer(victim);
            }
        }
Command Definition:

Code:
new CommandDefinition("dctest", "name type(2, 6)", "Disconnects the player with the given name", 100),
I've had this for awhile and some people have asked for it. I said once a dc fix was released xD (So you can thank purplemadness for releasing a dc fix and go up to Flowsion and call him a noob who keeps everything for himself)

There are options 2 and 6. There were actually 1-6 when I was testing, but 2 and 6 are the only ones that worked so I added both. 2 seems to work, but only once per character (weird huh?), while 6 seems to be able to be used on the same character multiple times.

If you want to test this right away, get on a GM character, do !item 123 then jump around a little and your character will get stuck (invalid items make your character stuck along with other things)

Then have another GM do !dctest CharacterToFix 6

The stuck character will dc! The !dc command didn't do that...

I'm not sure if the dc fix fixed this or not (haven't tested), or if this has been released in a different form, but I figured I'd put this out there.

Feel free to make it for normal characters too so they can fix their character without gm help (they will have to have a second account though), but make sure to add a username and password check to the command, because this is a dc command.

CREDITS:
Me - For making it
PurpleMadness - For releasing a dc fix and fulfilling my personal requirement for releasing this

People you shouldn't thank:
Flowsion - This could have been released sooner but Flowsion decided to keep the dc fixes for himself...
 
Last edited:
Not sure, you could try though. I only tried !dc playername, and because people have mentioned the problem in forums, I figured it needed a way to be fixed. That's why I made the command.
 
Back