Bot Metin2 Dev 4881 Posted June 27, 2017 Bot Share Posted June 27, 2017 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)); } } } } 4 Link to comment Share on other sites More sharing options...
Xerneas 10 Posted June 28, 2017 Share Posted June 28, 2017 Good Job 1 Link to comment Share on other sites More sharing options...
Tasho 243 Posted June 28, 2017 Share Posted June 28, 2017 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)); } } } 1 Link to comment Share on other sites More sharing options...
RatCatcher 77 Posted June 28, 2017 Share Posted June 28, 2017 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. 4 Enough is enough Link to comment Share on other sites More sharing options...
Endymion 320 Posted June 29, 2017 Share Posted June 29, 2017 are you serious???? XDD 1 Link to comment Share on other sites More sharing options...
Socialized 42 Posted June 29, 2017 Share Posted June 29, 2017 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. Link to comment Share on other sites More sharing options...
Premium Adrian2 16 Posted June 29, 2017 Premium Share Posted June 29, 2017 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. 1 Link to comment Share on other sites More sharing options...
Endymion 320 Posted June 29, 2017 Share Posted June 29, 2017 Maybe it's good time to start using d.new_jump_party to open dungeons for parties. 2 Link to comment Share on other sites More sharing options...
Tasho 243 Posted June 29, 2017 Share Posted June 29, 2017 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 More sharing options...
RatCatcher 77 Posted June 29, 2017 Share Posted June 29, 2017 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 More sharing options...
Ken 904 Posted June 30, 2017 Share Posted June 30, 2017 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 3 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted June 30, 2017 Premium Share Posted June 30, 2017 I never had this problem and at me don't work. On what source is this problem ? Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4881 Posted June 30, 2017 Author Bot Share Posted June 30, 2017 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 Link to comment Share on other sites More sharing options...
Recommended Posts