Jump to content

Jamie

Inactive Member
  • Posts

    20
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Jamie

  1. 6 hours ago, garofolo said:

    Fix about friends list update

    Server Source

      Hide contents
    common/service.h open
    
    add:
    #define ENABLE_DELETE_FRIEND_REFRESH_FIX
    
    game/src/messenger_manager.cpp open
    
    Find:
    MessengerManager::MessengerManager()
    
    Add :
    static char    __account[CHARACTER_NAME_MAX_LEN*2+1];
    static char    __companion[CHARACTER_NAME_MAX_LEN*2+1];
    
    Find:
    DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&MessengerManager::LoadList)
    
    Add:
        DBManager::instance().EscapeString(__account, sizeof(__account), account.c_str(), account.size());
        if (account.compare(__account))
            return;
    
    Find:
        if (m_Relation[account].find(companion) != m_Relation[account].end())
    
    Add:
        DBManager::instance().EscapeString(__account, sizeof(__account), account.c_str(), account.size());
        DBManager::instance().EscapeString(__companion, sizeof(__companion), companion.c_str(), companion.size());
        if (account.compare(__account) || companion.compare(__companion))
            return;
    
    Find:
        sys_log(1, "Messenger Remove %s %s", account.c_str(), companion.c_str());
    
    Add:
        DBManager::instance().EscapeString(__account, sizeof(__account), account.c_str(), account.size());
        DBManager::instance().EscapeString(__companion, sizeof(__companion), companion.c_str(), companion.size());
     
        if (account.compare(__account) || companion.compare(__companion))
            return;
    
    Find:
    std::set<keyT>    company(m_Relation[account]);
    
    Add:
        DBManager::instance().EscapeString(__account, sizeof(__account), account.c_str(), account.size());
        if (account.compare(__account))
            return;
    
    Find:
        m_InverseRelation[companion].erase(account);
    
    Add:
    #ifdef ENABLE_DELETE_FRIEND_REFRESH_FIX
        m_Relation[companion].erase(account);
        m_InverseRelation[account].erase(companion);
    #endif
    
    Find:
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Messenger> You deleted %s off the list."), companion.c_str());
    
    Add:
    #ifdef ENABLE_DELETE_FRIEND_REFRESH_FIX
        LPCHARACTER tch = CHARACTER_MANAGER::Instance().FindPC(companion.c_str());
        if (tch && tch->GetDesc())
        {
            TPacketGCMessenger p;
            p.header        = HEADER_GC_MESSENGER;
            p.subheader        = MESSENGER_SUBHEADER_GC_REMOVE_FRIEND;
            p.size            = sizeof(TPacketGCMessenger) + sizeof(BYTE) + account.size();
            BYTE bLen        = account.size();
            tch->GetDesc()->BufferedPacket(&p, sizeof(p));
            tch->GetDesc()->BufferedPacket(&bLen, sizeof(BYTE));
            tch->GetDesc()->Packet(account.c_str(), account.size());
        }
    #endif

     


    Client Source

     

      Reveal hidden contents
    Userinterface/packet.h open:
    
    Find:
    MESSENGER_SUBHEADER_GC_INVITE,
    
    Add:
    #ifdef ENABLE_DELETE_FRIEND_REFRESH_FIX
        MESSENGER_SUBHEADER_GC_REMOVE_FRIEND,
    #endif
    
    Userinterface/PythonMessenger.cpp open
    
    Find:
    m_FriendNameMap.erase(c_szKey);
    
    Add:
    #ifdef ENABLE_DELETE_FRIEND_REFRESH_FIX
        if (m_poMessengerHandler)
            PyCallClassMemberFunc(m_poMessengerHandler, "OnRemoveList", Py_BuildValue("(is)", MESSENGER_GRUOP_INDEX_FRIEND, c_szKey));
    #endif
    
    The result should be like this:
    
    void CPythonMessenger::RemoveFriend(const char * c_szKey)
    {
        m_FriendNameMap.erase(c_szKey);
     
    #ifdef ENABLE_DELETE_FRIEND_REFRESH_FIX
        if (m_poMessengerHandler)
            PyCallClassMemberFunc(m_poMessengerHandler, "OnRemoveList", Py_BuildValue("(is)", MESSENGER_GRUOP_INDEX_FRIEND, c_szKey));
    #endif
    }
    
    Find:
    case MESSENGER_SUBHEADER_GC_LOGOUT:
    
    Add in the of the block:
    #ifdef ENABLE_DELETE_FRIEND_REFRESH_FIX
            case MESSENGER_SUBHEADER_GC_REMOVE_FRIEND:
            {
                BYTE bLength;
                if (!Recv(sizeof(bLength), &bLength))
                    return false;
    
                if (!Recv(bLength, char_name))
                    return false;
    
                char_name[bLength] = 0;
                CPythonMessenger::Instance().RemoveFriend(char_name);
                break;
            }
    #endif

     


    Have fun

    no work in localhost. 

    Edit: No work add friends refresh

  2. hello, after I did all the installation steps, I get this error when I connect

     


    1015 14:16:16174 ::   File "networkModule.py", line 247, in SetGamePhase

    1015 14:16:16174 ::   File "game.py", line 99, in __init__

    1015 14:16:16174 ::   File "interfaceModule.py", line 311, in MakeInterface

    1015 14:16:16174 ::   File "interfaceModule.py", line 157, in __MakeTaskBar

    1015 14:16:16174 ::   File "system.py", line 137, in __pack_import

    1015 14:16:16175 :: ImportError
    1015 14:16:16175 :: :
    1015 14:16:16175 :: No module named uiGift
    1015 14:16:16175 ::

     

    in interfacemodule.py, we import uiGift

    This is the hidden content, please

    • Metin2 Dev 2
  3. 28 minutes ago, .T4Ump said:

    #include "../UserInterface/PythonSkill.h"
    /*
    stuff...
    */

    const char * CItemData::GetName() const
    {
        CPythonSkill::SSkillData * c_pSkillData;
        bool Skills = CPythonSkill::Instance().GetSkillData(GetSocket(0), &c_pSkillData)

        char szText[1024];
        
        switch (GetType())
        {
            case ITEM_TYPE_POLYMORPH:
                return m_ItemTable.szLocaleName;
                break;
            case ITEM_TYPE_SKILLBOOK:
            case ITEM_TYPE_SKILLFORGET:
                if(Skills)
                {
                    sprintf(szText, "%s - %s", m_ItemTable.szLocaleName, c_pSkillData->strName.c_str());
                    return szText;
                }
                else
                    return m_ItemTable.szLocaleName;
                break;
            default:
                return m_ItemTable.szLocaleName;
                break;
        }

    }

    Not work :))

     

×
×
  • 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.