Character delete patch

Removed an exploit where characters of different accounts could be deleted by a logging account session. Issue pointed out by zera.
This commit is contained in:
ronancpl
2018-03-21 02:08:43 -03:00
parent 97da2e2b5a
commit 9f643cc739
6 changed files with 35 additions and 16 deletions

View File

@@ -34,9 +34,12 @@ public final class DeleteCharHandler extends AbstractMaplePacketHandler {
String pic = slea.readMapleAsciiString();
int cid = slea.readInt();
if (c.checkPic(pic)) {
FilePrinter.printError(FilePrinter.DELETED_CHARACTERS + c.getAccountName() + ".txt", c.getAccountName() + " deleted CID: " + cid + "\r\n");
c.announce(MaplePacketCreator.deleteCharResponse(cid, 0));
c.deleteCharacter(cid);
if(c.deleteCharacter(cid)) {
FilePrinter.printError(FilePrinter.DELETED_CHARACTERS + c.getAccountName() + ".txt", c.getAccountName() + " deleted CID: " + cid + "\r\n");
c.announce(MaplePacketCreator.deleteCharResponse(cid, 0));
} else {
c.announce(MaplePacketCreator.deleteCharResponse(cid, 0x14));
}
} else {
c.announce(MaplePacketCreator.deleteCharResponse(cid, 0x14));
}