Jump to content

Recommended Posts

hello everyone

I added k inventory but

I can sell anything from normal inventory to NPC but If we sell any item from the k inventory to NPC,throws it to the login screen.

game syserr

Quote

Process: UNKNOWN HEADER: 115, LAST HEADER: 0(1), REMAIN BYTES: 3, fd: 19

packet.h

Quote

HEADER_CG_LOGIN4 = 115, HEADER_GC_NPC_POSITION = 115,

I think there is an bug in the input_main file

	case SHOP_SUBHEADER_CG_SELL:
	{
#ifdef ENABLE_SPECIAL_STORAGE
		if (uiBytes < sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE))
			return -1;

		const BYTE wPos = *reinterpret_cast<const BYTE*>(c_pData);
		const BYTE bCount = *(c_pData + sizeof(BYTE));
		const BYTE bType = *(c_pData + sizeof(BYTE) + sizeof(BYTE));

		sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());

		CShopManager::instance().Sell(ch, wPos, bCount, bType);
		return sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE);
#else
		if (uiBytes < sizeof(BYTE))
			return -1;

		BYTE pos = *c_pData;

		sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());
		CShopManager::instance().Sell(ch, pos);
		return sizeof(BYTE);
#endif
	}

	case SHOP_SUBHEADER_CG_SELL2:
	{
#ifdef ENABLE_SPECIAL_STORAGE
		if (uiBytes < sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE))
			return -1;

		const BYTE wPos = *reinterpret_cast<const BYTE*>(c_pData);
		const BYTE bCount = *(c_pData + sizeof(BYTE));
		const BYTE bType = *(c_pData + sizeof(BYTE) + sizeof(BYTE));

		sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());

		CShopManager::instance().Sell(ch, wPos, bCount, bType);
		return sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE);
#else
		if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
			return -1;

		BYTE pos = *(c_pData++);
		BYTE count = *(c_pData);

		sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
		CShopManager::instance().Sell(ch, pos, count);
		return sizeof(BYTE) + sizeof(BYTE);
#endif

help me pls

Edited by sixsa
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

13 hours ago, sixsa said:

hello everyone

I added k inventory but

I can sell anything from normal inventory to NPC but If we sell any item from the k inventory to NPC,throws it to the login screen.

game syserr

packet.h

I think there is an bug in the input_main file

	case SHOP_SUBHEADER_CG_SELL:
	{
#ifdef ENABLE_SPECIAL_STORAGE
		if (uiBytes < sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE))
			return -1;

		const BYTE wPos = *reinterpret_cast<const BYTE*>(c_pData);
		const BYTE bCount = *(c_pData + sizeof(BYTE));
		const BYTE bType = *(c_pData + sizeof(BYTE) + sizeof(BYTE));

		sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());

		CShopManager::instance().Sell(ch, wPos, bCount, bType);
		return sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE);
#else
		if (uiBytes < sizeof(BYTE))
			return -1;

		BYTE pos = *c_pData;

		sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());
		CShopManager::instance().Sell(ch, pos);
		return sizeof(BYTE);
#endif
	}

	case SHOP_SUBHEADER_CG_SELL2:
	{
#ifdef ENABLE_SPECIAL_STORAGE
		if (uiBytes < sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE))
			return -1;

		const BYTE wPos = *reinterpret_cast<const BYTE*>(c_pData);
		const BYTE bCount = *(c_pData + sizeof(BYTE));
		const BYTE bType = *(c_pData + sizeof(BYTE) + sizeof(BYTE));

		sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());

		CShopManager::instance().Sell(ch, wPos, bCount, bType);
		return sizeof(BYTE) + sizeof(BYTE) + sizeof(BYTE);
#else
		if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
			return -1;

		BYTE pos = *(c_pData++);
		BYTE count = *(c_pData);

		sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
		CShopManager::instance().Sell(ch, pos, count);
		return sizeof(BYTE) + sizeof(BYTE);
#endif

help me pls

 

the first sell should not be touched, only touch the second, and do the same step in the source client

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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