1 mesaj
Administrator Administrator
  • Mesaje: 3450
  • Reacții: 48503
  • Mesaje utile: 29
  • Status: Pe aici.. 🤠
  • Server: Saga2 - Soon
  • Regat: Jinno
  • [ID Discord]
  • Contact:
    *Descriere:

    Este un bug care este in Metin2 de vreo 20 de ani. O sa las quote de la @Mitachi, persoana care a rezolvat acest bug.

    Sursa de la martysama are deja rezolvat acest bug.
    I don't usually explain what I do, but I've decided to start doing so. It might be useful, who knows.

    This is quite an old and well-known bug, that’s why quests have always been written in a way to avoid it.
    The core issue is that quests are initialized before affects, so the when login trigger fires before affects are loaded.

    Have you ever tried to do something on login that involved affects?

    e.g.:
    -You want to check if the player has a mount when entering the OX map and dismount them.
    -You want to polymorph them into mob 101.

    Well, that wouldn’t work.

    The common workaround everyone uses is simply adding a timer to the login trigger, even 1 second is enough.
    That’s why this bug has never been considered a real problem: the workaround is simple and effective. If it works, it works.
    *Poze / Video:

    *Link download / Code:

    Cautam in void CInputDB::QuestLoad(LPDESC d, const char * c_pData), la sfarsitul functiei:
    Code:
            if (ch->GetDesc()->IsPhase(PHASE_GAME))
            {
                sys_log(0, "QUEST_LOAD: Login pc %d", pQuestTable[0].dwPID);
                quest::CQuestManager::instance().Login(pQuestTable[0].dwPID);
            }
            else
            {
                quest_login_event_info* info = AllocEventInfo<quest_login_event_info>();
                info->dwPID = ch->GetPlayerID();
    
                event_create(quest_login_event, info, PASSES_PER_SEC(1));
            }
    Inlocuim cu:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Cautam in EVENTFUNC(quest_login_event):
    Code:
        else if (d->IsPhase(PHASE_GAME))
        {
            sys_log(0, "QUEST_LOAD: Login pc %d by event", ch->GetPlayerID());
            quest::CQuestManager::instance().Login(ch->GetPlayerID());
            return 0;
        }
    Inlocuim cu:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    IsLoadedAffect is only set if you actually have an Affect or LoadAffect won't load, which is a problem.
    Not only for this fix, but in general, IsLoadedAffect is used in anti-exploit contexts.

    It is necessary that they are loaded even if you do not have affect, so, you got another fix there
    Code:
            case QID_AFFECT:
                sys_log(0, "QID_AFFECT %u", info->dwHandle);
    
                // if there are no affects, make an empty one to send the packet
                if (!mysql_num_rows(pSQLResult))
                {
                    TPacketAffectElement pAffElem{};
                    DWORD dwCount = 0;
    
                    peer->EncodeHeader(HEADER_DG_AFFECT_LOAD, info->dwHandle, sizeof(DWORD) + sizeof(DWORD) + sizeof(TPacketAffectElement) * dwCount);
                    peer->Encode(&info->player_id, sizeof(DWORD));
                    peer->Encode(&dwCount, sizeof(DWORD));
                    peer->Encode(&pAffElem, sizeof(TPacketAffectElement) * dwCount);
                    break;
                }
    
                RESULT_AFFECT_LOAD(peer, pSQLResult, info->dwHandle);
                break;

    Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo
    Te asteptam si pe serverul de Discord :p - aici ne-am strans toata comunitatea de Metin2 din Romania.
    Link: https://discord.gg/jWxeDSf7HP

    Suntem peste 1700 membri! - Avem chat activ zilnic, support, cereri, resurse. :D :ymcowboy:




    See full signature

    📢 Resurse Metin2 Premium!

    Zeci de resurse Metin2 Premium - exclusive și 100% funcționale începând cu 15.99€!.

    Vezi resursele Cumpără premium
    Premium
    Premium
    Anunț

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “FIX-uri”

    Informații

    Utilizatori ce navighează pe acest forum: Anthony NR1, mihaimiti30 și 14 vizitatori

    Discord ID copiat: