Jump to content

Hacked metin2 server


Recommended Posts

  • Bot

In Database/Messenger_Manager.cpp find method MessengerManager::RemoveFromList and replace it by:

void MessengerManager::RemoveFromList(MessengerManager::keyA account, MessengerManager::keyA companion)
{
    if (companion.empty())
        return;

    char companionEscaped[CHARACTER_NAME_MAX_LEN * 2 + 1];
    DBManager::instance().EscapeString(companionEscaped, sizeof(companionEscaped), companion.c_str(), companion.length());


    DBManager::instance().Query("DELETE FROM messenger_list%s WHERE account='%s' AND companion = '%s'",
                                get_table_postfix(), account.c_str(), companionEscaped);


    __RemoveFromList(account, companion);

    sys_log(1, "Messenger Remove %s %s", account.c_str(), companion.c_str());

    TPacketGGMessenger pack;
    pack.bHeader = HEADER_GG_MESSENGER_REMOVE;
    strlcpy(pack.szAccount, account.c_str(), sizeof(pack.szAccount));
    strlcpy(pack.szCompanion, companion.c_str(), sizeof(pack.szCompanion));
    P2P_MANAGER::instance().Send(&pack, sizeof(TPacketGGMessenger));
}

 

english_banner.gif

Link to comment
Share on other sites

  • Bot

Well, there is second solution which should be better but I think it's the same.
Make sure you will implement this to an old broken file.

In method MessengerManager::RemoveFromList search for:

if (companion.size() == 0)
    return;

Under this add:

if (!IsInList(account, companion))
    return;

Then add a new method to a file:

bool MessengerManager::IsInList(MessengerManager::keyA account, MessengerManager::keyA companion)
{
    if (m_Relation.find(account) == m_Relation.end())
        return false;

    if (m_Relation[account].empty())
        return false;

    return m_Relation[account].find(companion) != m_Relation[account].end();
}

And do not forget to declare the method in Database/Messenger_Message.h:

bool    IsInList(MessengerManager::keyA account, MessengerManager::keyA companion);

 

  • Love 2

english_banner.gif

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.