Jump to content

Dungeon Core Downer Fix


masodikbela

Recommended Posts

  • Premium

Hi there devs,

I've found a very big problem with dungeons and party about half a year before. This fix is already public on our (the Hungarian) forum, but now I'd like to share it here too.

The problem & The story

I was a developer on a real server (server with players) and we made a new dungeon. (There was no dungeon before.) During the test there was no problem, so we put in the dungeon to the live server. After some hours, the game99 have crashed. In the first days, I had no idea what could cause the problem. I rewrote the quest about 2 times 2 different ways, and the problem was still up. I've tired to debug the core, but I couldn't find anything, so I started to search on the forums, and I've found this: LINK

So the main problem: Go to ch99, create a group with 3 member, then start a dungeon. After the warp, go back to character select (exit from dungeon) and kick one member. Then invite him/her again. When the target accepts the invitation, the core will crash.

https://www.youtube.com/watch?v=KRuuAo8MGKw&feature=youtu.be

The fix

Its a really really short and interesting fix, because its already in the sources, but its commented (both in mainline and novaline) -.- (for unknown reason, because it doesn't cause any further problem).

char.cpp, in void CHARACTER::SetParty(LPPARTY pkParty):
Replace this:

	//if (m_pkDungeon && IsPC())
	//SetDungeon(NULL);
To this: 
    if (m_pkDungeon && IsPC() && !pkParty)
        SetDungeon(NULL);

 
  • Metin2 Dev 4
  • Think 1
  • Love 1
  • Love 26

The one and only UI programming guideline

Link to comment
Share on other sites

  • Premium
14 hours ago, ds_aim said:

Thanks for share.

But , you should debug client binary and see where it's the problem.

 

I sloved this one month ago. But i don't changed in game nothing. :)

As you can see in the video it crashed the core, and not the client binary. But I already debuged the core, and the problem was there. Its definitely game core problem not client binary problem. Because when you invite somebody to the party, it sets the "dungeon" to the new member. And if we don't set the dungeon to "null" when we destroy the dungeon, it will point to an incorrect memory adress, and when we try to use this incorrect adress, it will lead to core crash,

  • Love 4

The one and only UI programming guideline

Link to comment
Share on other sites

  • 1 month later...

i think this sould look like:

void CHARACTER::SetParty(LPPARTY pkParty)
{
    if (pkParty == m_pkParty)
        return;

    if (pkParty && m_pkParty)
        sys_err("%s is trying to reassigning party (current %p, new party %p)", GetName(), get_pointer(m_pkParty), get_pointer(pkParty));

    sys_log(1, "PARTY set to %p", get_pointer(pkParty));

    if (m_pkDungeon && IsPC())
    SetDungeon(NULL);
    m_pkParty = pkParty;

 

Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...
  • 1 month later...

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.