Jump to content

devilake

Inactive Member
  • Posts

    14
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by devilake

  1. 44 minutes ago, WeedHex said:

    __QUERY_PLAYER_DELETE

    or maybe you're using monarch.

     

     

    ClientManager.cpp 

     

    case HEADER_GD_PLAYER_DELETE:
                    sys_log(1, "HEADER_GD_PLAYER_DELETE (handle: %d length: %d)", dwHandle, dwLength);
                    __QUERY_PLAYER_DELETE(peer, dwHandle, (TPlayerDeletePacket *) data);
                    break;

     

    ClientManagerPlayer.cpp

    void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerDeletePacket* packet)
    {
        if (!packet->login[0] || !packet->player_id || packet->account_index >= PLAYER_PER_ACCOUNT)
            return;
    
        CLoginData * ld = GetLoginDataByLogin(packet->login);
    
        if (!ld)
        {
            peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
            peer->EncodeBYTE(packet->account_index);
            return;
        }
    
        TAccountTable & r = ld->GetAccountRef();
    
        // block for japan 
        if (g_stLocale != "sjis")
        {
            if (!IsChinaEventServer())
            {
                //if (strlen(r.social_id) < 7 || strncmp(packet->private_code, r.social_id + strlen(r.social_id) - 7, 7))
                if (strlen(r.social_id) != 7 || strcmp(packet->private_code, r.social_id))
                {
                    sys_log(0, "PLAYER_DELETE FAILED len(%d) %s %s", strlen(r.social_id), packet->private_code, r.social_id);
                    peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
                    peer->EncodeBYTE(packet->account_index);
                    return;
                }
    
                CPlayerTableCache * pkPlayerCache = GetPlayerCache(packet->player_id);
                if (pkPlayerCache)
                {
                    TPlayerTable * pTab = pkPlayerCache->Get();
    
                    if (pTab->level >= m_iPlayerDeleteLevelLimit)
                    {
    #ifdef ENABLE_MAXIMUM_LEVEL_2147483647
                        sys_log(0, "PLAYER_DELETE FAILED LEVEL %d >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
    #else
                        sys_log(0, "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
    #endif
                        peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
                        peer->EncodeBYTE(packet->account_index);
                        return;
                    }
    
                    if (pTab->level < m_iPlayerDeleteLevelLimitLower)
                    {
                        sys_log(0, "PLAYER_DELETE FAILED LEVEL %u < DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimitLower);
                        peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
                        peer->EncodeBYTE(packet->account_index);
                        return;
                    }
                }
            }
        }

     

    Im not using Monarch. Thanks for help btw.

  2. Ok, so my DB core crashes randomly and this is the bt

     

    #0  0x2851871b in strncmp () from /usr/lib32/libc.so.7
    No symbol table info available.
    #1  0x2851774b in strncmpeq (nameValue=0x305c305c <error: Cannot access memory at address 0x305c305c>, name=<optimized out>, nameLen=<optimized out>) at /usr/src/lib/libc/stdlib/getenv.c:144
    No locals.
    #2  __findenv_environ (name=<optimized out>, nameLen=<optimized out>) at /usr/src/lib/libc/stdlib/getenv.c:195
            envNdx = <optimized out>
    #3  getenv (name=0x28533060 "TZ") at /usr/src/lib/libc/stdlib/getenv.c:441
            nameLen = <optimized out>
            envNdx = <optimized out>
    #4  0x28500623 in tzset_basic (rdlocked=676540512) at /usr/src/contrib/tzcode/stdtime/localtime.c:1271
            name = <optimized out>
    #5  0x28500877 in localtime (timep=0xffffc698) at /usr/src/contrib/tzcode/stdtime/localtime.c:1455
            p_tm = 0x288441b0
    #6  0x0809c751 in sys_log (bit=0, format=0x80dbf8c "SIGNAL: SIGSEGV") at log.c:199
            ct = 1585165952
            time_s = <optimized out>
            args = <optimized out>
    #7  0x0804f7a9 in emergency_sig (sig=11) at Main.cpp:60
    No locals.
    #8  0x283d40b9 in handle_signal (actp=<optimized out>, sig=<optimized out>, info=0xffffcd00, ucp=0xffffca40) at /usr/src/lib/libthr/thread/thr_sig.c:246
            curthread = 0x28814000
            in_sigsuspend = <optimized out>
            cancel_async = <optimized out>
            cancel_enable = <optimized out>
            cancel_point = <optimized out>
            sigfunc = 0x305c305c
            err = <optimized out>
            uc2 = <optimized out>
    #9  0x283d35f2 in thr_sighandler (sig=11, info=0xffffcd00, _ucp=0xffffca40) at /usr/src/lib/libthr/thread/thr_sig.c:189
            ucp = 0xffffca40
            err = <optimized out>
            curthread = 0x28814000
            usa = <optimized out>
            act = <optimized out>
    #10 <signal handler called>

    I have no idea about what could cause this Segmentation Fault.

    It happens since the server went live ( ~ a month ago ). I cannot replicate it on my test server though ( it stays online 24/24, no crashes yet ).

    I've wrapped every single query into smart pointers and i am still getting this same exact bt.

    I did alot of research into this but i can't find anything relevant or helpful.

    If anyone has ANY hint, tip, idea about what could cause this, please let me know. 

  3. bool CMgrMap::IsPartecipant(DWORD dwPlayerID)     
    {
             if (!dwPlayerID)             
                    return false;
             itertype(v_Partecipants) it = std::find(v_Partecipants.begin(), v_Partecipants.end(), dwPlayerID);
    
             if (it != v_Partecipants.end())
                 return true;         
             return false;
    }
    

     

    This refactor by WeedHex helped me. Seems like the problem is solved. Thanks :)

    • Confused 1
  4. Hello guys, i have a little problem with the Meley run. Once in a while one of my cores ( the one that is used by the run ) crashes and then i get this

     

    https://metin2.download/picture/86iEM56V9EDRmaE5Q9YEX6HoxD2T9c5a/.png

    MeleyLair.cpp

    bool CMgrMap::IsPartecipant(DWORD dwPlayerID)
        {
            bool bCheck = std::find(v_Partecipants.begin(), v_Partecipants.end(), dwPlayerID) != v_Partecipants.end();
            return bCheck;
        }
    void CMgr::OnKillCommon(LPCHARACTER pkMonster, LPCHARACTER pkChar, CGuild* pkGuild)
        {
            if ((!pkMonster) || (!pkChar) || (!pkGuild))
                return;
            
            CMgrMap* pMap = m_RegGuilds.find(pkGuild->GetID())->second;
            if (!pMap)
                return;
            else if (!pMap->IsPartecipant(pkChar->GetPlayerID()))
                return;
            else if (pMap->GetDungeonStep() < 3)
                return;
            
            int iChance = number(1, 100);
            if (iChance > 70)
            {
                LPITEM pkItem = ITEM_MANAGER::instance().CreateItem(SEAL_VNUM_KILL_STATUE);
                if (!pkItem)
                    return;
                
                PIXEL_POSITION mPos;
                mPos.x = pkMonster->GetX();
                mPos.y = pkMonster->GetY();
                
                pkItem->AddToGround(pMap->GetMapIndex(), mPos);
                pkItem->StartDestroyEvent();
                pkItem->SetOwnership(pkChar, 60);
            }
        }

    char_battle.cpp

        if ((IsStone()) || (IsMonster()))
        {
            if (pkKiller)
            {
                if (((GetMobTable().dwVnum == (DWORD)(MeleyLair::MOBVNUM_RESPAWN_STONE_STEP2)) || (GetMobTable().dwVnum == (DWORD)(MeleyLair::MOBVNUM_RESPAWN_BOSS_STEP3))) && (MeleyLair::CMgr::instance().IsMeleyMap(pkKiller->GetMapIndex())))
                    MeleyLair::CMgr::instance().OnKill(GetMobTable().dwVnum, pkKiller->GetGuild());
                else if (MeleyLair::CMgr::instance().IsMeleyMap(pkKiller->GetMapIndex()))
                    MeleyLair::CMgr::instance().OnKillCommon(this, pkKiller, pkKiller->GetGuild());
            }
        }

     

    If any of you has any idea about what triggers that crash and/or what can i fix, i'd appreciate it. Thanks!

  5. 15 hours ago, NabbHackeR said:

    I told you how to do it with pure python, he did the same thing, he just did it in C++.

     

    I have a script that is taken from a multihack, i can show it to you, when i try to implement it to my client, it crashes, maybe because of the client antihack protection wich i don't know how to bypass

  6. 13 minutes ago, VegaS said:

    Haha bro, that is nice xD *this script and all script for pickup, called a simple function player.PickCloseItem() with delay automatically.

    He want to make a special functions to send to binary to check vnum xD.

    That means you need to make a new functions in binary.

    Ahh here is a point how to make, i made this long time ago.

     

    If u use small part of brain you can do this fucking easy ^^.

    Thank you, buy i have no access to binary, i need to do it with pure python.

  7. 2 minutes ago, NabbHackeR said:

    def PickUpItem(self): player.PickCloseItem()

    1230 game.py

    def PickUpStart(self): player.PickCloseItem()

    119 pickup.py

     

    I remembered correctly, it will not only try to pickup the items with your name, but the others too, so say goodbye to ur chat if u step on an item you're not the owner of XD

    Got it, but i don't need this, i already have this, check my response to charparodar

  8. 3 minutes ago, charparodar said:

    At least on my server it only picks the itens with the owner's name or without anyone's name..., Yang is included...

    I understand what u're telling me.

    But look, for example, there are two items dropped : Sword+2 and Skill Book. I want this autopickup to pick only the book. And i want to tell it what to pick up in the .py script, not ingame.

  9. 13 minutes ago, charparodar said:

    I use this pick up on my client: https://uploads.habira-gamers.org/index.php/s/boeQ4U5nNGj6LLo

    It's a python script, it appears under the minimap when imported...

    This only picks up itens with the owner's name or without any name, I don't know if is this exactly what you're looking for...

    it isn't but i think i can edit it to be what i want, thank you alot for help. What i wanted is a pickupbot that will pick a type of items. For example it will pick only Moonlight chests

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