Active Member Draveniou1 716 Posted November 14, 2021 Active Member Share Posted November 14, 2021 Hello. Today we fixed the item-shop in a normal item market Now you can use the item-shop normally and not with ItemAwardManager.cpp We tried on a server with about 190 people online I think it works on a server with more players online CHANGES: 1) OPEN IN DB FOLDER 2) SEARCH CACHE.CPP 3) OPEN SEARCH: if (m_data.vnum == 0) // vnum이 0이면 삭제하라고 표시된 것이다. { char szQuery[QUERY_MAX_LEN]; snprintf(szQuery, sizeof(szQuery), "DELETE FROM item%s WHERE id=%u", GetTablePostfix(), m_data.id); CDBManager::instance().ReturnQuery(szQuery, QID_ITEM_DESTROY, 0, NULL); if (g_test_server) sys_log(0, "ItemCache::Flush : DELETE %u %s", m_data.id, szQuery); } CHANGE WITH: if (m_data.vnum == 0) // vnum이 0이면 삭제하라고 표시된 것이다. { if (g_test_server) { } } WARNING #01 It does not work on all files but try to work on your own files 99% WORKING YOU CHECK UP 1 1 1 6 2 Link to comment Share on other sites More sharing options...
Management AZICKO 7351 Posted November 14, 2021 Management Share Posted November 14, 2021 Hi, The condition is empty, it should be deleted, right? 1 Scamming ? Reselling ? metin2.download | metin2.dev | fr.metin2.dev | metin2dev.org | metin2.top | top-metin2.org Link to comment Share on other sites More sharing options...
Active Member Draveniou1 716 Posted November 14, 2021 Author Active Member Share Posted November 14, 2021 Just now, ASIKOO said: Hi, The condition is empty, it should be deleted, right? Better to stay that way so that you do not get a db.core It has to stay that way Link to comment Share on other sites More sharing options...
Management Karbust 4888 Posted November 14, 2021 Management Share Posted November 14, 2021 (edited) 5 minutes ago, Draveniou1 said: Better to stay that way so that you do not get a db.core It has to stay that way Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 13 Link to comment Share on other sites More sharing options...
Active Member Draveniou1 716 Posted November 14, 2021 Author Active Member Share Posted November 14, 2021 (edited) 4 minutes ago, Karbust said: I mean this should stay that way so that the server does not get into error if (m_data.vnum == 0) // vnum이 0이면 삭제하라고 표시된 것이다. { if (g_test_server) { } } Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Management Karbust 4888 Posted November 14, 2021 Management Share Posted November 14, 2021 54 minutes ago, Draveniou1 said: I mean this should stay that way so that the server does not get into error if (m_data.vnum == 0) // vnum이 0이면 삭제하라고 표시된 것이다. { if (g_test_server) { } } You probably should figure out the why it breaks instead leaving a stupid and useless if... It doesn't return anything, so it literally goes through the if and executes whatever code comes after it. 1 Link to comment Share on other sites More sharing options...
Active Member Draveniou1 716 Posted November 14, 2021 Author Active Member Share Posted November 14, 2021 2 minutes ago, Karbust said: You probably should figure out the why it breaks instead leaving a stupid and useless if... It doesn't return anything, so it literally goes through the if and executes whatever code comes after it. you can change and you will eat a nice db.core 5 Link to comment Share on other sites More sharing options...
Contributor TMP4 11002 Posted November 15, 2021 Contributor Share Posted November 15, 2021 (edited) @ Draveniou1 I hope you don't take it as an insult, I just want to explain this itemshop problem to you. The non-item_award item_shop's problem are not coming from the DB, but the itemshop(.php) itself. To solve the problem you have to do 2 things: Checking your item id range in db/conf.txt Inserting with a random id BUT outside of that vnum range in your itemshop.php Doing that way, you'll never have id conflict even if you skip item_award. Official chinese/hongkong server actually did this long time ago before item_award was a thing. (M2H conversation about this.) Item_award was made to solve this problem, so I really not understand people who want to skip using it. --------------------------------------------------------------------------------------- 19 hours ago, ASIKOO said: Hi, The condition is empty, it should be deleted, right? He didn't delete it because there is an else right after that and he probably didn't know what to do in this situation so he left it blank. His code would look like this in the right formatting: void CItemCache::OnFlush() { if (m_data.vnum != 0) // not equal instead of equal { [...] // this is the former else statement content! } [...] } But as I said, the problem lies in the itemshop.php, not in the db, so I do not advise to edit this. Edited November 15, 2021 by TMP4 2 1 4 Link to comment Share on other sites More sharing options...
TheLionIK 4 Posted November 16, 2021 Share Posted November 16, 2021 Or...use item award like a normal human being. Thanks. Link to comment Share on other sites More sharing options...
Active Member Draveniou1 716 Posted November 16, 2021 Author Active Member Share Posted November 16, 2021 1 hour ago, TheLionIK said: Or...use item award like a normal human being. Thanks. I agree, but I also tried to make the regular item-shop -------------------------------------------------------------- The problem with the normal item-shop is that items are deleted from memory after a time limit -------------------------- char szQuery[QUERY_MAX_LEN]; snprintf(szQuery, sizeof(szQuery), "DELETE FROM item%s WHERE id=%u", GetTablePostfix(), m_data.id); CDBManager::instance().ReturnQuery(szQuery, QID_ITEM_DESTROY, 0, NULL); -------------------------------------------------------------- Link to comment Share on other sites More sharing options...
PetePeter 36 Posted November 16, 2021 Share Posted November 16, 2021 53 minutes ago, Draveniou1 said: I agree, but I also tried to make the regular item-shop -------------------------------------------------------------- The problem with the normal item-shop is that items are deleted from memory after a time limit -------------------------- char szQuery[QUERY_MAX_LEN]; snprintf(szQuery, sizeof(szQuery), "DELETE FROM item%s WHERE id=%u", GetTablePostfix(), m_data.id); CDBManager::instance().ReturnQuery(szQuery, QID_ITEM_DESTROY, 0, NULL); -------------------------------------------------------------- Because it's not means to be used this way ... item_award exist for a reason, touching the item table while the game is running it's stupid (unless you modify no cache items like safebox) 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts