Jump to content
×
×
  • Create New...
  • 0

Cannot Find Item - Visual Bug Shop Offline Add/Remove item /Change Price


Elyps

Question

  • Premium

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.

dovadashopoff.jpg

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 ?

Link to comment

11 answers to this question

Recommended Posts

  • 0
  • Premium

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 by Elyps
Link to comment
  • 0
  • Moon

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));
	}
}

 

 

  • Love 2
Link to comment
  • 0
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


  • Read our Rules
  • Activity

    1. 3

      Quest Craft

    2. 3

      Quest Craft

    3. 414

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    4. 11

      Metin2 Patcher with Electron

    5. 17

      I Want Find freebsd 11.4 with remove unnecessary codes

    6. 17

      I Want Find freebsd 11.4 with remove unnecessary codes

    7. 3

      Quest Craft

  • Recently Browsing

    • No registered users viewing this page.

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.