Jump to content

Forums

  1. Metin2 Dev

    1. Announcements

      Community updates and announcements...

      474
      posts
    2. Community Rules Marketplace Rules Ranks Top Metin2 Github Docs Pillory Discord
  2. Community

    1. Member Representations

      Here is the area where you can talk about yourself...

      258
      posts
    2. Off Topic

      Is there life beyond Metin2?

      2.4k
      posts
  3. Miscellaneous

    1. Metin2

      Everything about Metin2...

      1.5k
      posts
    2. Showcase

      Showcase allows you to post your latest works in this forum.
      This isn't the Marketplace / Third Party - Providers Directory.
      No sales attempt or your contact details are tolerated!

      1.9k
      posts
    3. File Requests

      Looking for files?
      Tell us your request in this forum...

      594
      posts
    4. Community Support - Questions & Answers

      You need help? Post your problems in this forum.
      Help is offered for free by members of the community.
      No paid service and you must explain how your problem was resolved!

      81.7k
      posts
    5. Paid Support / Searching / Recruiting

      Post your problems or searches in this forum, only if you want to pay.
      Are you looking for a collaborator in your team? Tell us your request in this forum.
      Also, consult our sellers within the Marketplace to search for a third-party service.
      Search for paid services and search for collaborators only!

      4.8k
      posts
    6. Marketplace - Sales & Services Community Rules Marketplace Rules Pillory Marketplace Dashboard
  4. Metin2 Development

    1. Basic Tutorials / Beginners

      Basic Tutorials for Beginners on Metin2!

      243
      posts
    2. Guides & HowTo

      Guides on Metin2!

      3.1k
      posts
    3. Binaries

      Binaries, Source Files, Client Files, Server Files...

      4k
      posts
    4. 15.6k
      posts
    5. Web Development & Scripts / Systems

      Share your scripts here: PHP, JS, CMS, Websites... All about the World Wide Web

      435
      posts
    6. Tools & Programs

      You created a tool that could be usefull for others? Share it to them to improve their experience with Metin2!

      2.1k
      posts
    7. Maps

      1 Map, 2 Maps, 3 Maps...
      You have enough maps to dress up your server!

      594
      posts
    8. Quests

      The quest that will make all the difference?
      She is here!

      711
      posts
    9. 1.7k
      posts
    10. 2D Graphics

      A facelift, what do you think?

      780
      posts
    11. Operating Systems

      FreeBSD, Windows...

      282
      posts
    12. Miscellaneous

      Resources & Stuff

      81
      posts
  5. Private Servers

    1. Private Servers

      Introduce us to your Metin2 p-server!
      You can also register your Metin2 private server on our top list → Top Metin2!

      331
      posts
    2. 864
      votes
    3. 109
      votes
    4. 17
      votes
  6. Uncategorized

    1. Drafts

      This forum allows you to create draft topics without being visible to other members of the community.

      • No posts here yet
    2. Trash

      Topics are visible only to team members and if you are the author.
      Deletion requests will therefore be ignored.

      • No posts here yet
    3. Archive

      Topics are visible only to team members and if you are the author.
      Deletion requests will therefore be ignored.

    4. Temporary

      This forum will be used to temporarily move unusable releases... Dead links...

      4.8k
      posts
    5. Metin2 Download

      This forum is dedicated to the automatic publication of @Metin2 Download.

      • No posts here yet

Announcements



  • Discord Widget
  • Current Donation Goals

  • News

  • Releases

  • Activity

    1. 6

      Lunaris2 - Become a Legend | Return on 1 June 2024 | LVL MAX 105 | International

    2. 18

      VIVY-WORLD2 - FARM TO THE TOP

    3. 0

      Key to invoke switchbot

  • Questions & Answers

    • Hello, I'm testing Mijago's swhitcbot to make it functional via the inventory button. I created the link for the new button following the base of other buttons. But when I try to open it, it doesn't call me that function. Anyone who can help me fix it?  I'll leave you the script of the inventorywindows and uiInventory Thank you   uiinventoy.py inventorywindow.py  
    • update 999, seems like after adding 3 bonuses on an item it is succesfuly inserted into the db, but client instantly crashes with no syserr when a item with the 3rd bonus is present on the char Do you guys have any advice on where I should add them on client side to be visible? I m expecting some range on python side or something like that but not sure where Fixed the unprocessed packets too, seems like having null attrs in db is not ok fixed the client problem too, had to increase ITEM_ATTRIBUTE_SLOT_RARE_NUM on client side
    • So I'm trying to add 5 extra bonuses (6/7, but till 10) But with a catch too First 3 bonuses should be added from item_attr_rare table, last 2 from item_attr_rare_pvp (so i added a new table, duplicate from item attr rare) Then I proceeded to increase the item bonus count and limits: enum EItemMisc { ITEM_NAME_MAX_LEN = 24, ITEM_VALUES_MAX_NUM = 6, ITEM_SMALL_DESCR_MAX_LEN = 256, ITEM_LIMIT_MAX_NUM = 2, ITEM_APPLY_MAX_NUM = 3, ITEM_SOCKET_MAX_NUM = 3, ITEM_MAX_COUNT = 200, ITEM_ATTRIBUTE_NORM_NUM = 5, ITEM_ATTRIBUTE_RARE_NUM = 3, #ifdef BETTER_67 ITEM_ATTRIBUTE_RARE_PVP_NUM = 2, #endif ITEM_ATTRIBUTE_NORM_START = 0, ITEM_ATTRIBUTE_NORM_END = ITEM_ATTRIBUTE_NORM_START + ITEM_ATTRIBUTE_NORM_NUM, ITEM_ATTRIBUTE_RARE_START = ITEM_ATTRIBUTE_NORM_END, ITEM_ATTRIBUTE_RARE_END = ITEM_ATTRIBUTE_RARE_START + ITEM_ATTRIBUTE_RARE_NUM, #ifdef BETTER_67 ITEM_ATTRIBUTE_RARE_PVP_START = ITEM_ATTRIBUTE_RARE_END, #endif #ifdef BETTER_67 ITEM_ATTRIBUTE_RARE_PVP_END = ITEM_ATTRIBUTE_RARE_PVP_START + ITEM_ATTRIBUTE_RARE_PVP_NUM, ITEM_ATTRIBUTE_MAX_NUM = ITEM_ATTRIBUTE_RARE_PVP_END, // 7 #else ITEM_ATTRIBUTE_MAX_NUM = ITEM_ATTRIBUTE_RARE_END, // 7 #endif ITEM_ATTRIBUTE_MAX_LEVEL = 5, ITEM_AWARD_WHY_MAX_LEN = 50, REFINE_MATERIAL_MAX_NUM = 5, ITEM_ELK_VNUM = 50026, }; Created a new vector to store these new bonuses:   std::vector<TItemAttrTable> m_vec_itemRarePvpTable; // New vector to store item_attr_rare_pvp data And now i read from the db, and for each row create a TItemAttrTable object, which i then add to the above vector:   #ifdef BETTER_67 bool CClientManager::InitializeItemRarePvpTable() { char query[4096]; snprintf(query, sizeof(query), "SELECT apply, apply+0, prob, lv1, lv2, lv3, lv4, lv5, weapon, body, wrist, foots, neck, head, shield, ear " #ifdef ENABLE_ITEM_ATTR_COSTUME ", costume_body, costume_hair" #if defined(ENABLE_ITEM_ATTR_COSTUME) && defined(ENABLE_WEAPON_COSTUME_SYSTEM) ", costume_weapon" #endif #endif #ifdef ENABLE_PENDANT_SYSTEM ", pendant" #endif #ifdef ENABLE_GLOVE_SYSTEM ", glove" #endif " FROM item_attr_rare_pvp%s ORDER BY apply", GetTablePostfix()); auto pkMsg(CDBManager::instance().DirectQuery(query)); SQLResult *pRes = pkMsg->Get(); if (!pRes->uiNumRows) { sys_err("no result from item_attr_rare_pvp"); return false; } if (!m_vec_itemRarePvpTable.empty()) { sys_log(0, "RELOAD: item_attr_rare_pvp"); m_vec_itemRarePvpTable.clear(); } m_vec_itemRarePvpTable.reserve(pRes->uiNumRows); MYSQL_ROW data; while ((data = mysql_fetch_row(pRes->pSQLResult))) { TItemAttrTable t{}; int col = 0; strlcpy(t.szApply, data[col++], sizeof(t.szApply)); str_to_number(t.dwApplyIndex, data[col++]); str_to_number(t.dwProb, data[col++]); str_to_number(t.lValues[0], data[col++]); str_to_number(t.lValues[1], data[col++]); str_to_number(t.lValues[2], data[col++]); str_to_number(t.lValues[3], data[col++]); str_to_number(t.lValues[4], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_WEAPON], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_BODY], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_WRIST], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_FOOTS], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_NECK], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_HEAD], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_EAR], data[col++]); #ifdef ENABLE_ITEM_ATTR_COSTUME str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_COSTUME_BODY], data[col++]); str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_COSTUME_HAIR], data[col++]); #if defined(ENABLE_ITEM_ATTR_COSTUME) && defined(ENABLE_WEAPON_COSTUME_SYSTEM) str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_COSTUME_WEAPON], data[col++]); #endif #endif #ifdef ENABLE_PENDANT_SYSTEM str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_PENDANT], data[col++]); #endif #ifdef ENABLE_GLOVE_SYSTEM str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_GLOVE], data[col++]); #endif sys_log(0, "ITEM_RARE_PVP: %-20s %4lu { %3d %3d %3d %3d %3d } { %d %d %d %d %d %d %d" #ifdef ENABLE_ITEM_ATTR_COSTUME " %d %d" #if defined(ENABLE_ITEM_ATTR_COSTUME) && defined(ENABLE_WEAPON_COSTUME_SYSTEM) " %d" #endif #endif #ifdef ENABLE_PENDANT_SYSTEM " %d" #endif #ifdef ENABLE_GLOVE_SYSTEM " %d" #endif " }", t.szApply, t.dwProb, t.lValues[0], t.lValues[1], t.lValues[2], t.lValues[3], t.lValues[4], t.bMaxLevelBySet[ATTRIBUTE_SET_WEAPON], t.bMaxLevelBySet[ATTRIBUTE_SET_BODY], t.bMaxLevelBySet[ATTRIBUTE_SET_WRIST], t.bMaxLevelBySet[ATTRIBUTE_SET_FOOTS], t.bMaxLevelBySet[ATTRIBUTE_SET_NECK], t.bMaxLevelBySet[ATTRIBUTE_SET_HEAD], t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD], t.bMaxLevelBySet[ATTRIBUTE_SET_EAR] #ifdef ENABLE_ITEM_ATTR_COSTUME , t.bMaxLevelBySet[ATTRIBUTE_SET_COSTUME_BODY], t.bMaxLevelBySet[ATTRIBUTE_SET_COSTUME_HAIR] #if defined(ENABLE_ITEM_ATTR_COSTUME) && defined(ENABLE_WEAPON_COSTUME_SYSTEM) , t.bMaxLevelBySet[ATTRIBUTE_SET_COSTUME_WEAPON] #endif #endif #ifdef ENABLE_PENDANT_SYSTEM , t.bMaxLevelBySet[ATTRIBUTE_SET_PENDANT] #endif #ifdef ENABLE_GLOVE_SYSTEM , t.bMaxLevelBySet[ATTRIBUTE_SET_GLOVE] #endif ); m_vec_itemRarePvpTable.emplace_back(t); } return true; } #endif // BETTER_67 Initialization seem to pass all ok   #ifdef BETTER_67 // Initialize the new table if (!InitializeItemRarePvpTable()) { sys_err("InitializeItemRarePvpTable FAILED"); return false; } else { sys_err("Succesfully initialized ItemRarePvpTable"); } #endif The syserr log is temporary, just so I am convinced it worked, or atleast returned true, which it does But the problem is, now it seems that it fails to load items, db core dump, displayed using bt only:   (gdb) #0 thr_kill () at thr_kill.S:4 #1 0x20a1fa8b in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x20ac9beb in abort () at /usr/src/lib/libc/stdlib/abort.c:67 #3 0x0042ab87 in emergency_sig (sig=11) at Main.cpp:53 #4 0x209760b9 in handle_signal (actp=<optimized out>, sig=<optimized out>, info=0xffffd1c0, ucp=0xffffcf00) at /usr/src/lib/libthr/thread/thr_sig.c:303 #5 0x20975660 in thr_sighandler (sig=11, info=0xffffd1c0, _ucp=0xffffcf00) at /usr/src/lib/libthr/thread/thr_sig.c:246 #6 <signal handler called> #7 0x004428c4 in str_to_number (out=@0x2299a531: 0, in=0x30323033 <error: Cannot access memory at address 0x30323033>) at ./../../common/utils.h:48 #8 CreateItemTableFromRes (res=0x22fa7240, pVec=0x4ab978 <CClientManager::RESULT_ITEM_LOAD(CPeer*, st_mysql_res*, unsigned int, unsigned int)::s_items>, dwPID=17) at ClientManagerPlayer.cpp:64 #9 0x00444177 in CClientManager::RESULT_ITEM_LOAD (this=0xffffd410, peer=0x20bef600, pRes=0x22fa7240, dwHandle=4, dwPID=17) at ClientManagerPlayer.cpp:692 #10 0x00443f4c in CClientManager::RESULT_COMPOSITE_PLAYER (this=0xffffd410, peer=0x20bef600, pMsg=0x20bc4570, dwQID=1) at ClientManagerPlayer.cpp:587 #11 0x00431e4e in CClientManager::AnalyzeQueryResult (this=0xffffd410, msg=0x20bc4570) at ClientManager.cpp:2887 #12 0x004318b0 in CClientManager::MainLoop (this=0xffffd410) at ClientManager.cpp:314 #13 0x0042ac99 in main () at Main.cpp:84 I changed nothing in `RESULT_ITEM_LOAD` or any other place, double checked in git pr view, no accidents there neither, I assume changing the bonus range has other several cascading effects and necessary changes? If so, could anybody point me in the right direction? Update, here, fixed the core crash, but I guess something didn't go as planned, altered item table, added the other columns for the new attrs, but somewhere i fucked up bcs now, inventory dosen't work, items are duplicated and alot of other things broke For cache i changed the fush method a bit   void CItemCache::OnFlush() { if (m_data.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); } else { TPlayerItem *p = &m_data; const auto setQuery = fmt::format(FMT_COMPILE("id={}, owner_id={}, `window`={}, pos={}, count={}, vnum={}, socket0={}, socket1={}, socket2={}, " "attrtype0={}, attrvalue0={}, " "attrtype1={}, attrvalue1={}, " "attrtype2={}, attrvalue2={}, " "attrtype3={}, attrvalue3={}, " "attrtype4={}, attrvalue4={}, " "attrtype5={}, attrvalue5={}, " "attrtype6={}, attrvalue6={} " #ifdef BETTER_67 ", attrtype7={}, attrvalue7={}, " "attrtype8={}, attrvalue8={}, " "attrtype9={}, attrvalue9={} " #endif ), p->id, p->owner, p->window, p->pos, p->count, p->vnum, p->alSockets[0], p->alSockets[1], p->alSockets[2], p->aAttr[0].bType, p->aAttr[0].sValue, p->aAttr[1].bType, p->aAttr[1].sValue, p->aAttr[2].bType, p->aAttr[2].sValue, p->aAttr[3].bType, p->aAttr[3].sValue, p->aAttr[4].bType, p->aAttr[4].sValue, p->aAttr[5].bType, p->aAttr[5].sValue, p->aAttr[6].bType, p->aAttr[6].sValue #ifdef BETTER_67 , p->aAttr[7].bType, p->aAttr[7].sValue, p->aAttr[8].bType, p->aAttr[8].sValue, p->aAttr[9].bType, p->aAttr[9].sValue #endif ); // @fixme205 const auto itemQuery = fmt::format(FMT_COMPILE("INSERT INTO item{} SET {} ON DUPLICATE KEY UPDATE {}"), GetTablePostfix(), setQuery, setQuery); if (g_test_server) sys_log(0, "ItemCache::Flush :REPLACE (%s)", itemQuery.c_str()); CDBManager::instance().ReturnQuery(itemQuery.c_str(), QID_ITEM_SAVE, 0, NULL); ++g_item_count; } m_bNeedQuery = false; } Is there any other place i gotta change caching? What basically happens now, client seems to not understand anything anymore, chat dosent work after the things start bugging out But hopefully i think i understand i m missing something on client side too bcs there are some chat packets that are being raised after moving items around in the inv 0528 13:29:18383 :: Unprocessed packet header 137, state Game 0528 13:29:19900 :: Unprocessed packet header 73, state Game 0528 13:29:24570 :: Unknown packet header: 102, last: 61 124 https://giphy.com/gifs/r4qrhqbxdqVwnrLrKW
    • How can i make Spirit Stones or any item Enchantable?
  • Popular Contributors

  • Upcoming Events

×
×
  • 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.