Matteo 46 Posted May 21, 2022 Share Posted May 21, 2022 (edited) Hi, I have a core crash, i dont really understand whats the problem. https://metin2.download/picture/09K0qsj0xP9ZPje3FnmmsRF4533Ccrii/.png https://metin2.download/picture/fRR4xS3Br06pviwr0vQVIZP3K7S4Ec0E/.png https://metin2.download/picture/w0M4XtvtxK5O3RMxIXNmvV2aLVLxaQCw/.png https://metin2.download/picture/3CwK6PPz5cxPX857jIsG4MRdxS82Mj0v/.png Corresponding code lines: item.cpp #ifdef ENABLE_EXTENDED_ITEMNAME_ON_GROUND const char* CItem::GetName() { # ifdef ENABLE_MULTI_LANGUAGE_SYSTEM BYTE bLocale = (GetOwner() && GetOwner()->GetDesc()) ? GetOwner()->GetDesc()->GetLanguage() : LOCALE_DEFAULT; # endif static char szItemName[128]; memset(szItemName, 0, sizeof(szItemName)); if (GetProto()) { int len = 0; switch (GetType()) { case ITEM_POLYMORPH: { const DWORD dwMobVnum = GetSocket(0); const CMob* pMob = CMobManager::instance().Get(dwMobVnum); if (pMob) { # ifdef ENABLE_MULTI_LANGUAGE_SYSTEM len = snprintf(szItemName, sizeof(szItemName), "%s", LC_LOCALE_MOB_TEXT(dwMobVnum, bLocale)); # else len = snprintf(szItemName, sizeof(szItemName), "%s", pMob->m_table.szLocaleName); # endif } break; } case ITEM_SKILLBOOK: https://metin2.download/picture/9I16e553nCZNCl5Ha0irx2kP2T5pzWW3/.png item_manager.cpp if(!item->GetName()) { sys_err("SaveSingleItem: item->GetName NULL"); return; } if (!item->GetOwner()) { DWORD dwID = item->GetID(); DWORD dwOwnerID = item->GetLastOwnerPID(); //sys_log(0, "item->GetOwner NULL - Name: %s dwID: %d dwOwnerID: %d",item->GetName(), dwID, dwOwnerID); db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_DESTROY, 0, sizeof(DWORD) + sizeof(DWORD)); db_clientdesc->Packet(&dwID, sizeof(DWORD)); db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD)); //sys_log(1, "ITEM_DELETE %s:%u", item->GetName(), dwID); return; } //sys_log(1, "ITEM_SAVE %s:%d in %s window %d", item->GetName(), item->GetID(), item->GetOwner()->GetName(), item->GetWindow()); TPlayerItem t; Thanks. Spoiler Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal System Administrator @ Hungarian Government System Administrator @ Vibestro Freelancer Developer @ Various projects Link to comment Share on other sites More sharing options...
Active Member iMerv3 766 Posted May 21, 2022 Active Member Share Posted May 21, 2022 The crash is not about the codes u put. Is because you have a invalid item in the flush delayed map, maybe not erased properly. Link to comment Share on other sites More sharing options...
Denizeri24 35 Posted May 21, 2022 Share Posted May 21, 2022 check your item_proto Link to comment Share on other sites More sharing options...
DeYaN. 29 Posted October 31, 2022 Share Posted October 31, 2022 UPP Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted November 1, 2022 Premium Share Posted November 1, 2022 if(!item->GetName()) { sys_err("SaveSingleItem: item->GetName NULL"); return; } lol Link to comment Share on other sites More sharing options...
DeYaN. 29 Posted November 1, 2022 Share Posted November 1, 2022 8 hours ago, WeedHex said: if(!item->GetName()) { sys_err("SaveSingleItem: item->GetName NULL"); return; } lol Yes,i dont have this .. now i added in void ITEM_MANAGER::SaveSingleItem(LPITEM item) .. it`s ok ? thanks Quote void ITEM_MANAGER::SaveSingleItem(LPITEM item) { if (!item->GetName()) { sys_err("SaveSingleItem: item->GetName NULL") return; } if (!item->GetOwner()) { DWORD dwID = item->GetID(); DWORD dwOwnerID = item->GetLastOwnerPID(); db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_DESTROY, 0, sizeof(DWORD) + sizeof(DWORD)); db_clientdesc->Packet(&dwID, sizeof(DWORD)); db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD)); sys_log(1, "ITEM_DELETE %s:%u", item->GetName(), dwID); return; } sys_log(1, "ITEM_SAVE %s:%d in %s window %d", item->GetName(), item->GetID(), item->GetOwner()->GetName(), item->GetWindow()); TPlayerItem t; t.id = item->GetID(); t.window = item->GetWindow(); t.pos = t.window == EQUIPMENT ? item->GetCell() - INVENTORY_MAX_NUM : item->GetCell(); t.count = item->GetCount(); t.vnum = item->GetOriginalVnum(); t.owner = (t.window == SAFEBOX || t.window == MALL) ? item->GetOwner()->GetDesc()->GetAccountTable().id : item->GetOwner()->GetPlayerID(); thecore_memcpy(t.alSockets, item->GetSockets(), sizeof(t.alSockets)); thecore_memcpy(t.aAttr, item->GetAttributes(), sizeof(t.aAttr)); db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_SAVE, 0, sizeof(TPlayerItem)); db_clientdesc->Packet(&t, sizeof(TPlayerItem)); } Link to comment Share on other sites More sharing options...
DeYaN. 29 Posted November 1, 2022 Share Posted November 1, 2022 20 hours ago, WeedHex said: if(!item->GetName()) { sys_err("SaveSingleItem: item->GetName NULL"); return; } lol I added that, the server doesn't crash anymore, but it causes big problems in the database and makes online players lose their items. I see that the problem has been exposed in the past here: but I can't find the real cause. I also have his great offline shop and I have the impression that someone is playing with me because it doesn't do it all the time but only at time intervals when there are many people online. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now