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

dc to buy something that was sold


MORTE

Question

For example, select an item in the store to buy, come and buy another, then when I buy gives dc, I saw that the official displays a message

 

SHOP_SOLDOUT   Sold

Someone help me get to show the message, instead of closing the game?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
  • Honorable Member

Server\game\src\shop.cpp > "int CShop::Buy(LPCHARACTER ch, BYTE pos)"

Search and replace this:

	if (IsPCShop())
	{
		if (!pkSelectedItem)
		{
			sys_log(0, "Shop::Buy : Critical: This user seems to be a hacker : invalid pcshop item : BuyerPID:%d SellerPID:%d",
					ch->GetPlayerID(),
					m_pkPC->GetPlayerID());

			return false;
		}

		if ((pkSelectedItem->GetOwner() != m_pkPC))
		{
			sys_log(0, "Shop::Buy : Critical: This user seems to be a hacker : invalid pcshop item : BuyerPID:%d SellerPID:%d",
					ch->GetPlayerID(),
					m_pkPC->GetPlayerID());

			return false;
		}
	}

With this:

	if (IsPCShop())
	{
		if (!pkSelectedItem)
		{
			sys_log(0, "Shop::Buy1 : Critical: This user seems to be a hacker : invalid pcshop item : BuyerPID:%d SellerPID:%d",
					ch->GetPlayerID(),
					m_pkPC->GetPlayerID());

			return SHOP_SUBHEADER_GC_SOLDOUT;
		}

		if ((pkSelectedItem->GetOwner() != m_pkPC))
		{
			sys_log(0, "Shop::Buy2 : Critical: This user seems to be a hacker : invalid pcshop item : BuyerPID:%d SellerPID:%d",
					ch->GetPlayerID(),
					m_pkPC->GetPlayerID());

			return SHOP_SUBHEADER_GC_SOLDOUT;
		}
	}

You could remove the sys_log about hacker thing because it not necessary.

	if (IsPCShop() && (!pkSelectedItem || pkSelectedItem->GetOwner() != m_pkPC))
		return SHOP_SUBHEADER_GC_SOLDOUT;

Edited by xP3NG3Rx
  • Love 1
Link to comment
Share on other sites

  • 0
if (IsPCShop())
	{
		if (!pkSelectedItem)
		{
			sys_log(0, "Shop::Buy : Critical: This user seems to be a hacker : invalid pcshop item : BuyerPID:%d SellerPID:%d",
					ch->GetPlayerID(),
					m_pkPC->GetPlayerID());

			return false;
		}

		if ((pkSelectedItem->GetOwner() != m_pkPC))
		{
			sys_log(0, "Shop::Buy : Critical: This user seems to be a hacker : invalid pcshop item : BuyerPID:%d SellerPID:%d",
					ch->GetPlayerID(),
					m_pkPC->GetPlayerID());

			return false;
		}
	}

to 
 

if (IsPCShop() && (!pkSelectedItem || pkSelectedItem->GetOwner() != m_pkPC))
		return SHOP_SUBHEADER_GC_SOLDOUT;

replace it?

Link to comment
Share on other sites

  • 0
  • Honorable Member

If you do not want to see that "seems hacker" message in the syslog, yes.

Hidden Content

    Give reaction to this post to see the hidden content.

Edited by xP3NG3Rx
preview add
  • Love 1
Link to comment
Share on other sites

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


  • Activity

    1. 4

      Ludus2: a metin2-like browser game

    2. 6
    3. 9

      Help in implementing a switch bot

    4. 0

      Special Inventory System Can't Sell To Npc's

    5. 0

      ROV2.GLOBAL | International | Server start 14.05.2022

    6. 75

      Services - System Ard [C ++ / Python / Lua]

    7. 76

      Chatting Window Renewal (Mini Version)

    8. 2

      ItemShop GM ZONE TAB

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