Jump to content

How To Fix Party Dungeon Core


Recommended Posts

  • Bot

Today i get this problem, when i enter in a party dungeon and someone of the party goes offline or warp in another map, the core crashed.

I want give all my idea to fix that, i know that is not the best method to fix that but i think for someone can be useful.

I tried to fix the problem with the tutorial on metin2dev with SetDungeon(NULL) in SetParty but without any results, the bug continue...

 

This is my fix/idea:

 

When someone goes offline all the members of the group will go to the own village and the core doesn't crash.

Open party.cpp and replace your UpdateOfflineState function with this:

void CParty::UpdateOfflineState(DWORD dwPID)
{
	TPacketGCPartyAdd p;
	p.header = HEADER_GC_PARTY_ADD;
	p.pid = dwPID;
	memset(p.name, 0, CHARACTER_NAME_MAX_LEN+1);
	for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
	{
		if (it->second.pCharacter && it->second.pCharacter->GetDesc()) {
			if (it->second.pCharacter->GetDungeon()) {
				LPDUNGEON dung=it->second.pCharacter->GetDungeon();
				dung->ExitAllToStartPosition();
			}else{
				it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
			}
		}
	}
}

 

  • Love 4

english_banner.gif

Link to comment
Share on other sites

On 27.06.2017 at 5:04 AM, M2BobFixed said:

void CParty::UpdateOfflineState(DWORD dwPID)
{
	TPacketGCPartyAdd p;
	p.header = HEADER_GC_PARTY_ADD;
	p.pid = dwPID;
	memset(p.name, 0, CHARACTER_NAME_MAX_LEN+1);
	for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
	{
		if (it->second.pCharacter && it->second.pCharacter->GetDesc()) {
			if (it->second.pCharacter->GetDungeon()) {
				LPDUNGEON dung=it->second.pCharacter->GetDungeon();
				dung->ExitAllToStartPosition();
			}else{
				it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
			}
		}
	}
}

 

void CParty::UpdateOfflineState(DWORD dwPID)
{
	TPacketGCPartyAdd p;
	p.header = HEADER_GC_PARTY_ADD;
	p.pid = dwPID;
	memset(p.name, 0, CHARACTER_NAME_MAX_LEN + 1);
	for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
	{
		if (it->second.pCharacter && it->second.pCharacter->GetDesc())
		{
			if (it->second.pCharacter->GetDungeon())
				it->second.pCharacter->GetDungeon()->ExitAllToStartPosition();
			else
				it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
		}
	}
}

 

  • Love 1
Link to comment
Share on other sites

6 hours ago, Tasho said:

 


void CParty::UpdateOfflineState(DWORD dwPID)
{
	TPacketGCPartyAdd p;
	p.header = HEADER_GC_PARTY_ADD;
	p.pid = dwPID;
	memset(p.name, 0, CHARACTER_NAME_MAX_LEN + 1);
	for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
	{
		if (it->second.pCharacter && it->second.pCharacter->GetDesc())
		{
			if (it->second.pCharacter->GetDungeon())
				it->second.pCharacter->GetDungeon()->ExitAllToStartPosition();
			else
				it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
		}
	}
}

 

Wow, you removed some parentheses, very useful contribution indeed. 

  • Love 4

Enough is enough

Link to comment
Share on other sites

  • Premium
59 minutes ago, Socialized said:

This isn't a proper fix for the issue.
Just debug the issue with gdb and you'll see, that it isn't that big of a deal.

"Dont understand the trashtalking." - September, 2016. 

Why don't you share a better and improved idea? Anyone can rant, but none can give something back.

Great idea M2Bob, I still love people like you who share their ideas and experience with others(most don't appreciate it, Socialized). Although can't say if it works or not since haven't tested it yet, and can't since I don't have groups on my server. Thanks.

  • Love 1
Link to comment
Share on other sites

On 28.06.2017 at 11:54 PM, RatCatcher said:

Wow, you removed some parentheses, very useful contribution indeed. 

I think you don't know to read c++ code, the contribution doesn't was the "removed some parentheses" was this:

	LPDUNGEON dung=it->second.pCharacter->GetDungeon();
	dung->ExitAllToStartPosition();

To this:

	it->second.pCharacter->GetDungeon()->ExitAllToStartPosition();

There we speak about good practice code, if you don't understand, not speak.

 

EDIT: Why you need to do a spam for this? You just make +1 without do something, just speak about me and have child behavior, i do shortened the code and show you the good practices.

Quote

I have probably more experience with c++ than you

Show us your skills if you are better then, at the moment you just speak without sense, people what say "i'm better then you", they are more low.

Link to comment
Share on other sites

2 hours ago, Tasho said:

I think you don't know to read c++ code, the contribution doesn't was the "removed some parentheses" was this:


	LPDUNGEON dung=it->second.pCharacter->GetDungeon();
	dung->ExitAllToStartPosition();

To this:


	it->second.pCharacter->GetDungeon()->ExitAllToStartPosition();

There we speak about good practice code, if you don't understand, not speak.

I have probably more experience with c++ than you will ever have but whatever, you still haven't done shit, only shortened the code.

Enough is enough

Link to comment
Share on other sites

You're playing a multiplayer game. The member might lose his connection sometimes because of the internet provider or unknown packets. You can't pay this to the party members. If you do, most people are going to insult you in the game. Anyway, thanks for sharing with us.

Best Regards

Ken

  • Love 3

Do not be sorry, be better.

Link to comment
Share on other sites

  • Bot
9 hours ago, Ken said:

You're playing a multiplayer game. The member might lose his connection sometimes because of the internet provider or unknown packets. You can't pay this to the party members. If you do, most people are going to insult you in the game. Anyway, thanks for sharing with us.

Best Regards

Ken

Exactly. But without this server will crash.

6 hours ago, Dobrescu Sebastian said:

I never had this problem and at me don't work. On what source is this problem ?

MAINLINE_SG

english_banner.gif

Link to comment
Share on other sites

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.