Jump to content
  • 0

Character Deletion Script (workaround)


Question

Posted (edited)

Hi,

since my client is bugging with the character deletion, I've just written a script to do it.

Could you please check if it is not exploitable/ doing something wrong?

It seems to work fine for me though, but would be glad to have someone checking it before releasing it.

lhz_in03,255,257,3    script    Chardel    93,{
    set .@accid, getcharid(3);
    mes .npcname$;
    mes "Hello ^6495ED"+strcharinfo(0)+"^000000.";
    mes "Would you like to delete a character?";
    if (select("No:Yes")  == 1){
        next;
        mes .npcname$;
        mes "Alright, see you then.";
        close;
    }
    next;
    mes .npcname$;
    mes "Please enter the Character's name.";
    mes "Note that you can only delete characters on your own account.";
    input(.@charname$);
    query_sql "SELECT account_id FROM `char` WHERE name = '"+.@charname$+"'",.@accid2;
    if (.@accid != .@accid2){
        next;
        mes .npcname$;
        mes "^ff0000I could not find this character on your account!^000000";
        close;
    }
    if (strcharinfo(0) == .@charname$){
        next;
        mes .npcname$;
        mes "^ff0000Please log in with a different character to delete this one.^000000";
        close;
    }
    next;
    mes .npcname$;
    mes "Do you really want to delete this character?";
    if (select("No:Yes")  == 1){
        next;
        mes .npcname$;
        mes "Alright, see you then.";
        close;
    }
    next;
    mes .npcname$;
    mes "Okay, I have deleted this character from your account.";
    query_sql "DELETE FROM `char` WHERE `name`='"+.@charname$+"'";
    close;
    end;
    OnInit:
        set .npcname$, "[^6495EDCharacter Deletion^000000]";
        end;
}

Thanks! :)

Edited by Yuka

3 answers to this question

Recommended Posts

Posted

if you want ..... then i can add some more ...

  1. data in other SQL tables that related to that character
  2. Items within the characters that you're going to delete
  3. Guild that current characters joined
  4. etc
Posted

 

Could you please check if it is not exploitable/ doing something wrong?

    input(.@charname$);
    query_sql "SELECT account_id FROM `char` WHERE name = '"+.@charname$+"'",.@accid2;

just to point this line.. don't forget to use escape_sql to prevent sql injection

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...