What's new

Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

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

Blaze

Elite
Elite
Joined
Jan 28, 2019
Messages
263
Reaction score
1,845
Points
93
Credits
64
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:
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:
"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.
 

MartwyPlod

New member
Joined
Dec 15, 2019
Messages
2
Reaction score
0
Points
1
Credits
0
Someone hacking the database will add himself an administrator and start handing out items then what?
 

shape1
shape2
shape3
shape4
shape7
shape8
Top