Premium P1nGu1n 4 Posted October 13, 2019 Premium Share Posted October 13, 2019 (edited) Spoiler Hello M2Dev i have one big problem about one crash. if somebody know how i can fix this , please say me in pm or reply with skype/discord id for contact i pay for this fix (how much you want) . Please , just if you know fix. item_manager.cpp void ITEM_MANAGER::DelayedSave(LPITEM item) { if (item->GetID() != 0) m_set_pkItemForDelayedSave.insert(item); } void ITEM_MANAGER::FlushDelayedSave(LPITEM item) { TR1_NS::unordered_set<LPITEM>::iterator it = m_set_pkItemForDelayedSave.find(item); if (it == m_set_pkItemForDelayedSave.end()) { return; } m_set_pkItemForDelayedSave.erase(it); SaveSingleItem(item); } void ITEM_MANAGER::SaveSingleItem(LPITEM item) { if(!item) { sys_err("item from SaveSingleItem is NULL!!!"); //return; } //if(!item->GetID()) // return; if (!item->GetOwner()) //if (!item->GetOwner() || !item->GetCount()) { 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(); #ifdef TRANSMUTE_SYSTEM t.look = item->GetLook(); #endif 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)); } void ITEM_MANAGER::Update() { TR1_NS::unordered_set<LPITEM>::iterator it = m_set_pkItemForDelayedSave.begin(); TR1_NS::unordered_set<LPITEM>::iterator this_it; while (it != m_set_pkItemForDelayedSave.end()) { this_it = it++; LPITEM item = *this_it; // SLOW_QUERY 플래그가 있는 것은 종료시에만 저장한다. if (item->GetOwner() && IS_SET(item->GetFlag(), ITEM_FLAG_SLOW_QUERY)) continue; SaveSingleItem(item); m_set_pkItemForDelayedSave.erase(this_it); } } void ITEM_MANAGER::RemoveItem(LPITEM item, const char * c_pszReason) { LPCHARACTER o; if ((o = item->GetOwner())) { #ifdef __NEW_PET_SYSTEM_SCALING__ if(item->GetVnum() >= 53041 && item->GetVnum() <= 53048 && o) { CScalingPetSystem* petsys = o->GetScalingPetSystem(); if(petsys->GetScalingPetActor()) { petsys->Unsummon(); } } #endif char szHint[64]; snprintf(szHint, sizeof(szHint), "%s %u ", item->GetName(), item->GetCount()); LogManager::instance().ItemLog(o, item, c_pszReason ? c_pszReason : "REMOVE", szHint); if (item->GetWindow() == MALL || item->GetWindow() == SAFEBOX) { CSafebox* pSafebox = item->GetWindow() == MALL ? o->GetMall() : o->GetSafebox(); if (pSafebox) { pSafebox->Remove(item->GetCell()); } } else { o->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255); item->RemoveFromCharacter(); } } M2_DESTROY_ITEM(item); } item.cpp Spoiler DWORD CItem::GetCount() { #ifdef ENABLE_CHEQUE_SYSTEM if (GetType() == ITEM_ELK || GetType() == ITEM_CHEQUE) return MIN(m_dwCount, INT_MAX); #else if (GetType() == ITEM_ELK) return MIN(m_dwCount, INT_MAX); #endif else { return MIN(m_dwCount, 200); } } bool CItem::SetCount(DWORD count) { #ifdef ENABLE_CHEQUE_SYSTEM if (GetType() == ITEM_ELK || GetType() == ITEM_CHEQUE) #else if (GetType() == ITEM_ELK) #endif { m_dwCount = MIN(count, INT_MAX); } else { m_dwCount = MIN(count, ITEM_MAX_COUNT); } if (count == 0 && m_pOwner) { if (GetSubType() == USE_ABILITY_UP || GetSubType() == USE_POTION || GetVnum() == 70020) { LPCHARACTER pOwner = GetOwner(); WORD wCell = GetCell(); RemoveFromCharacter(); if (!IsDragonSoul()) { LPITEM pItem = pOwner->FindSpecifyItem(GetVnum()); if (NULL != pItem) { pOwner->ChainQuickslotItem(pItem, QUICKSLOT_TYPE_ITEM, wCell); } else { pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, wCell, 255); } } M2_DESTROY_ITEM(this); } else { if (!IsDragonSoul()) { m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, m_wCell, 255); } M2_DESTROY_ITEM(RemoveFromCharacter()); } return false; } UpdatePacket(); Save(); return true; } db when crash , appear this item... edit: i don't know when crash or how crash. shop offline from great. Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted October 14, 2019 Premium Share Posted October 14, 2019 Is it from a public server? If yes, someone is having fun with your bad codes. Link to comment Share on other sites More sharing options...
Active+ Member enisina 173 Posted October 14, 2019 Active+ Member Share Posted October 14, 2019 which files are you using ? Link to comment Share on other sites More sharing options...
AegonKhami 3 Posted October 14, 2019 Share Posted October 14, 2019 ++ Link to comment Share on other sites More sharing options...
ali4242 15 Posted October 14, 2019 Share Posted October 14, 2019 Discord: ulubey4242#6713 Link to comment Share on other sites More sharing options...
Contributor Rakancito 4864 Posted October 15, 2019 Contributor Share Posted October 15, 2019 You have an error with the data types which don't support a value higher than the one marked.Example: int -> 2 ^ 32 = -2147483648, 2147483647, if you want your game not to be crashed, you must handle intermediate values to those that I have just given you if that is the case :), on the other hand I would advise you to check if not You have more objects in the database that can cause such conflict or check that all assignments are correct.Example:GetSocket in item.h and you check your source code because in the functions you just placed you have no errors, more than the fact that in some cases it is necessary to check if there is a problem of "NULL", on the contrary everything is fine and there would be no point in rectifying that the candidates are superior. That is to say that everything returns a correct value, because if not all the variables are assigned, the system will simply save the memory address or NULL. Link to comment Share on other sites More sharing options...
Premium P1nGu1n 4 Posted October 15, 2019 Author Premium Share Posted October 15, 2019 bump Link to comment Share on other sites More sharing options...
Endymion 323 Posted October 15, 2019 Share Posted October 15, 2019 Show us these functions: char.cpp :: CHARACTER::OpenShop(DWORD id, const char *name, bool onboot) char.cpp :: CHARACTER::UpdateShopItems() Link to comment Share on other sites More sharing options...
AegonKhami 3 Posted October 15, 2019 Share Posted October 15, 2019 ++ original great offline shop Link to comment Share on other sites More sharing options...
Seryov 17 Posted October 15, 2019 Share Posted October 15, 2019 I had the same problem with the paid version of the great offline shop. Link to comment Share on other sites More sharing options...
Premium P1nGu1n 4 Posted October 16, 2019 Author Premium Share Posted October 16, 2019 not solve bump. error is not from shop offline !!! Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted October 16, 2019 Premium Share Posted October 16, 2019 Someone is having fun with your bad codes. Syserr item dup? Link to comment Share on other sites More sharing options...
Premium P1nGu1n 4 Posted October 19, 2019 Author Premium Share Posted October 19, 2019 problem solved nobody don't know problem from ctrl+z (instant pickup item drop) Link to comment Share on other sites More sharing options...
DeYaN. 29 Posted November 1, 2022 Share Posted November 1, 2022 uppp !! I have the same problem and I think someone is playing with me I also have great's offline shop system. 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