Metin2 [C ++] A small lock to the "do_disconnect" function

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Blaze

Elite
Elite
VIP
Joined
Jan 28, 2019
Messages
507
Credits
635
Today I will present you a small blockade to the " do_disconnect " function .

It depends on the fact that we can not throw GM out of the game, so I think it is quite useful

1. Open cmd_gm.cpp (You will find it in the Source Game).

2. You are looking for and replacing this function:

Code:
Expand Collapse Copy
ACMD(do_disconnect)
{
    char arg1[256];
    one_argument(argument, arg1, sizeof(arg1));

    if (!*arg1)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "ex) /dc <player name>");
        return;
    }

    LPDESC d = DESC_MANAGER::instance().FindByCharacterName(arg1);
    LPCHARACTER    tch = d ? d->GetCharacter() : NULL;

    if (!tch)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "%s: no such a player.", arg1);
        return;
    }

    if (tch == ch)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "cannot disconnect myself");
        return;
    }

    if (tch->IsGM())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Blokada_Disconnect_GM"));
        return;
    }
    
    DESC_MANAGER::instance().DestroyDesc(d);
}
3. Open locale_string.txt , and then add to it:
Code:
Expand Collapse Copy
"Blokada_Disconnect_GM";
"You can not get an administrator out of the game!";
p.s2. You will find it in server files.

p.s3. You can also use the same "tch-> IsGM" function to block kill, stun, etc.
 
Someone hacking the database will add himself an administrator and start handing out items then what?
 
Back
Top