Premium Elyps 3 Posted January 16, 2017 Premium Share Posted January 16, 2017 (edited) Hello i have a visual bug with Shop Offline , when someone try to add or remove item , change price in Shop Offline , it's bugged like in photo , and they need to close shop and remake him. I think it's something from client src or root . Or is because i have 40x Slot Max in Original Shop and Inventory , and in Offline Shop 120x Slots ? Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
iRazer 9 Posted January 16, 2017 Share Posted January 16, 2017 I think that you've done a wrong increase of slot. Link to comment Share on other sites More sharing options...
Premium Elyps 3 Posted January 16, 2017 Author Premium Share Posted January 16, 2017 SHOP_HOST_ITEM_MAX_NUM = 40, OFFLINE_SHOP_HOST_ITEM_MAX_NUM = 120, I need to put at Offline shop = 40 ? Link to comment Share on other sites More sharing options...
iRazer 9 Posted January 16, 2017 Share Posted January 16, 2017 Not. If do you want 120, don't change it. Check Client-Source too. Link to comment Share on other sites More sharing options...
Premium Elyps 3 Posted January 16, 2017 Author Premium Share Posted January 16, 2017 (edited) Really i don't know what function can refresh to make this bug. I think i've missed some lines or functions ? Edit1 : I've checked all files from client and source , and looks fine... Edited January 16, 2017 by Elyps Link to comment Share on other sites More sharing options...
AlexxD 124 Posted January 16, 2017 Share Posted January 16, 2017 check item count. Maybe you have WORD type and offline has BYTE. "Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch" Link to comment Share on other sites More sharing options...
Premium Elyps 3 Posted January 16, 2017 Author Premium Share Posted January 16, 2017 Thank's i will check. PS: I'm not the best dev in RO , i was still offline about 1-2 years Link to comment Share on other sites More sharing options...
Premium North 1175 Posted January 16, 2017 Premium Share Posted January 16, 2017 Post some snippets about that part of code or we cant guess it for you, both client and serverside Link to comment Share on other sites More sharing options...
Premium Elyps 3 Posted January 17, 2017 Author Premium Share Posted January 17, 2017 When i'm at CH1 Visual Shop dissapear , and if i'm at CH2 appear. It's something from config channels shop offline. Link to comment Share on other sites More sharing options...
Active+ Member Abel(Tiger) 1196 Posted January 20, 2017 Active+ Member Share Posted January 20, 2017 In offlineshop_manager.cpp replace Refresh function with that: Spoiler void COfflineShopManager::Refresh(LPCHARACTER ch) { if (!ch) return; LPCHARACTER npc = CHARACTER_MANAGER::Instance().Find(FindMyOfflineShop(ch->GetPlayerID())); if (npc) { LPOFFLINESHOP pkOfflineShop = npc->GetOfflineShop(); if (!pkOfflineShop) return; pkOfflineShop->Refresh(ch); return; } TPacketGCShop pack; pack.header = HEADER_GC_OFFLINE_SHOP; pack.subheader = SHOP_SUBHEADER_GC_UPDATE_ITEM2; TPacketGCOfflineShopStart pack2; memset(&pack2, 0, sizeof(pack2)); pack2.owner_vid = 0; char szQuery[1024]; snprintf(szQuery, sizeof(szQuery), "SELECT pos, count, vnum, price, socket0, socket1, socket2, " "attrtype0, attrvalue0, " "attrtype1, attrvalue1, " "attrtype2, attrvalue2, " "attrtype3, attrvalue3, " "attrtype4, attrvalue4, " "attrtype5, attrvalue5, " "attrtype6, attrvalue6 " #ifdef USE_LENTS_SHOULDER_SASH ", applytype0, applyvalue0, " "applytype1, applyvalue1, " "applytype2, applyvalue2, " "applytype3, applyvalue3, " "applytype4, applyvalue4, " "applytype5, applyvalue5, " "applytype6, applyvalue6, " "applytype7, applyvalue7 " #endif "FROM %soffline_shop_item WHERE owner_id = %u and status = 0", get_table_postfix(), ch->GetPlayerID()); std::auto_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery(szQuery)); if (pMsg->Get()->uiNumRows == 0) memset(&pack2, 0, sizeof(pack2)); else { for (int i = 0; i < mysql_num_rows(pMsg->Get()->pSQLResult); ++i) { MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult); int cur = 0; BYTE bPos = 0; str_to_number(bPos, row[cur++]); str_to_number(pack2.items[bPos].count, row[cur++]); str_to_number(pack2.items[bPos].vnum, row[cur++]); str_to_number(pack2.items[bPos].price, row[cur++]); for (BYTE j = 0; j < ITEM_SOCKET_MAX_NUM; j++) str_to_number(pack2.items[bPos].alSockets[j], row[cur++]); for (BYTE n = 0; n < ITEM_ATTRIBUTE_MAX_NUM; n++) { str_to_number(pack2.items[bPos].aAttr[n].bType, row[cur++]); str_to_number(pack2.items[bPos].aAttr[n].sValue, row[cur++]); } } } pack.size = sizeof(pack) + sizeof(pack2); if (ch->GetDesc()) { ch->GetDesc()->BufferedPacket(&pack, sizeof(TPacketGCShop)); ch->GetDesc()->Packet(&pack2, sizeof(TPacketGCOfflineShopStart)); } } 2 Link to comment Share on other sites More sharing options...
DeYaN. 29 Posted January 20, 2017 Share Posted January 20, 2017 15 hours ago, Abel(Tiger) said: In offlineshop_manager.cpp replace Refresh function with that: Reveal hidden contents void COfflineShopManager::Refresh(LPCHARACTER ch) { if (!ch) return; LPCHARACTER npc = CHARACTER_MANAGER::Instance().Find(FindMyOfflineShop(ch->GetPlayerID())); if (npc) { LPOFFLINESHOP pkOfflineShop = npc->GetOfflineShop(); if (!pkOfflineShop) return; pkOfflineShop->Refresh(ch); return; } TPacketGCShop pack; pack.header = HEADER_GC_OFFLINE_SHOP; pack.subheader = SHOP_SUBHEADER_GC_UPDATE_ITEM2; TPacketGCOfflineShopStart pack2; memset(&pack2, 0, sizeof(pack2)); pack2.owner_vid = 0; char szQuery[1024]; snprintf(szQuery, sizeof(szQuery), "SELECT pos, count, vnum, price, socket0, socket1, socket2, " "attrtype0, attrvalue0, " "attrtype1, attrvalue1, " "attrtype2, attrvalue2, " "attrtype3, attrvalue3, " "attrtype4, attrvalue4, " "attrtype5, attrvalue5, " "attrtype6, attrvalue6 " #ifdef USE_LENTS_SHOULDER_SASH ", applytype0, applyvalue0, " "applytype1, applyvalue1, " "applytype2, applyvalue2, " "applytype3, applyvalue3, " "applytype4, applyvalue4, " "applytype5, applyvalue5, " "applytype6, applyvalue6, " "applytype7, applyvalue7 " #endif "FROM %soffline_shop_item WHERE owner_id = %u and status = 0", get_table_postfix(), ch->GetPlayerID()); std::auto_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery(szQuery)); if (pMsg->Get()->uiNumRows == 0) memset(&pack2, 0, sizeof(pack2)); else { for (int i = 0; i < mysql_num_rows(pMsg->Get()->pSQLResult); ++i) { MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult); int cur = 0; BYTE bPos = 0; str_to_number(bPos, row[cur++]); str_to_number(pack2.items[bPos].count, row[cur++]); str_to_number(pack2.items[bPos].vnum, row[cur++]); str_to_number(pack2.items[bPos].price, row[cur++]); for (BYTE j = 0; j < ITEM_SOCKET_MAX_NUM; j++) str_to_number(pack2.items[bPos].alSockets[j], row[cur++]); for (BYTE n = 0; n < ITEM_ATTRIBUTE_MAX_NUM; n++) { str_to_number(pack2.items[bPos].aAttr[n].bType, row[cur++]); str_to_number(pack2.items[bPos].aAttr[n].sValue, row[cur++]); } } } pack.size = sizeof(pack) + sizeof(pack2); if (ch->GetDesc()) { ch->GetDesc()->BufferedPacket(&pack, sizeof(TPacketGCShop)); ch->GetDesc()->Packet(&pack2, sizeof(TPacketGCOfflineShopStart)); } } Thx you Abel, is working great xD Link to comment Share on other sites More sharing options...
Premium Elyps 3 Posted January 21, 2017 Author Premium Share Posted January 21, 2017 Thank you bro. T.c !!! 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