Jump to content

Recommended Posts

Hello forum Metin2Dev

 

My problem is that I try to extract x1 items and x2 items come out next to items

in essence, double items come out

How to fix ?

 

Video for understant

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

 

0% Syser

0% errorlog

0% log

I dont have syser or error in client/server

 

Thanks for all forum <<<Metin2Dev>>>

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Contributor

I would really help you since i have nothing to do in quarantine but you did not attached your code so it is impossible.

Idk if special storage and normal storage uses the same python, but if so, your problem will be in either binary or game source.


The default code from uiinventory.py to binary and finally in game (linearly to the process):

Spoiler

 


			elif app.IsPressed(app.DIK_LSHIFT):
				itemCount = player.GetItemCount(itemSlotIndex)
				
				if itemCount > 1:
					self.dlgPickMoney.SetTitleName(localeinfo.PICK_ITEM_TITLE)
					self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
					self.dlgPickMoney.Open(itemCount)
					self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
				#else:
					#selectedItemVNum = player.GetItemIndex(itemSlotIndex)
					#mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum)

	def OnPickItem(self, count):
		itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex
		selectedItemVNum = player.GetItemIndex(itemSlotIndex)
		mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)

	def SelectEmptySlot(self, selectedSlotPos):
		if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
			return

		selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)

		if mouseModule.mouseController.isAttached():

			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
			attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()

			if player.SLOT_TYPE_INVENTORY == attachedSlotType:
				itemCount = player.GetItemCount(attachedSlotPos)
				attachedCount = mouseModule.mouseController.GetAttachedItemCount()
				self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)

				if item.IsRefineScroll(attachedItemIndex):
					self.wndItem.SetUseMode(FALSE)

			elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
				mouseModule.mouseController.RunCallBack("INVENTORY")

			elif player.SLOT_TYPE_SHOP == attachedSlotType:
				net.SendShopBuyPacket(attachedSlotPos)

			elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:

				if player.ITEM_MONEY == attachedItemIndex:
					net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
					snd.PlaySound("sound/ui/money.wav")

				else:
					net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)

			elif player.SLOT_TYPE_MALL == attachedSlotType:
				net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)

			mouseModule.mouseController.DeattachObject()

	def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
		# °łŔλóÁˇ ż­°í ŔÖ´Â µżľČ ľĆŔĚĹŰ »çżë ąćÁö
		if uiPrivateShopBuilder.IsBuildingPrivateShop():
			chat.AppendChat(chat.CHAT_TYPE_INFO, localeinfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
			return

		net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)

PythonNetWorkStreamModule.cpp:


PyObject* netSendItemMovePacket(PyObject* poSelf, PyObject* poArgs)
{
	TItemPos Cell;
	TItemPos ChangeCell;
	int num;

	switch (PyTuple_Size(poArgs))
	{
	case 3:
		if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
			return Py_BuildException();
		if (!PyTuple_GetInteger(poArgs, 1, &ChangeCell.cell))
			return Py_BuildException();
		if (!PyTuple_GetInteger(poArgs, 2, &num))
			return Py_BuildException();
		break;
	case 5:
		{
			if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
				return Py_BuildException();
			if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
				return Py_BuildException();
			if (!PyTuple_GetByte(poArgs, 2, &ChangeCell.window_type))
				return Py_BuildException();
			if (!PyTuple_GetInteger(poArgs, 3, &ChangeCell.cell))
				return Py_BuildException();
			if (!PyTuple_GetInteger(poArgs, 4, &num))
				return Py_BuildException();
		}
		break;
	default:
		return Py_BuildException();
	}

	CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
	rkNetStream.SendItemMovePacket(Cell, ChangeCell, (WORD) num);
	return Py_BuildNone();
}

 

PythonNetworkStreamPhaseGameItem.cpp:


bool CPythonNetworkStream::SendItemMovePacket(TItemPos pos, TItemPos change_pos, WORD num)
{	
	if (!__CanActMainInstance())
		return true;
	
	if (__IsEquipItemInSlot(pos))
	{
		if (CPythonExchange::Instance().isTrading())
		{
			if (pos.IsEquipCell() || change_pos.IsEquipCell())
			{
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AppendNotifyMessage", Py_BuildValue("(s)", "CANNOT_EQUIP_EXCHANGE"));
				return true;
			}
		}

		if (CPythonShop::Instance().IsOpen())
		{
			if (pos.IsEquipCell() || change_pos.IsEquipCell())
			{
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AppendNotifyMessage", Py_BuildValue("(s)", "CANNOT_EQUIP_SHOP"));
				return true;
			}
		}

		if (__IsPlayerAttacking())
			return true;
	}

	__PlayInventoryItemDropSound(pos);

	TPacketCGItemMove	itemMovePacket;
	itemMovePacket.header = HEADER_CG_ITEM_MOVE;
	itemMovePacket.pos = pos;
	itemMovePacket.change_pos = change_pos;
	itemMovePacket.num = num;

	if (!Send(sizeof(TPacketCGItemMove), &itemMovePacket))
	{
		Tracen("SendItemMovePacket Error");
		return false;
	}

	return SendSequence();
}

game/input_main.cpp:


void CInputMain::ItemMove(LPCHARACTER ch, const char * data)
{
	struct command_item_move * pinfo = (struct command_item_move *) data;

	if (ch)
		ch->MoveItem(pinfo->Cell, pinfo->CellTo, pinfo->count);
}

 

 

Do not replace yours with this, use it for compare.

 

If i were you, i would track down the count with

Chat.AppendChat(str(itemCount)) #example

if your problem is created in python. (uiinventory.py)

 

If not, then i would write the count from binary to the syserr.txt to check there next. (pythonnetworkstreammodule.cpp)

#define sys_err TraceError
#define sys_log //(n, format, ...) Tracenf(format, __VA_ARGS__)
sys_err("Count: %d", num); //num is count if i'm not wrong

If not, then go the serverside and do the same. (input_main.cpp)

sys_err("Count in serverside %d", pinfo->count);

 

With that tracking you can easily find out where it goes wrong.

Let me know where the count is go wrong and provide your code.

Edited by TMP4
Link to comment
Share on other sites

  • Contributor

It's just a copy paste really :(

Spoiler


Quote

If i were you, i would track down the count with



Chat.AppendChat(str(itemCount)) #example

if your problem is created in python. (uiinventory.py)

 

If not, then i would write the count from binary to the syserr.txt to check there next. (pythonnetworkstreammodule.cpp)



#define sys_err TraceError
#define sys_log //(n, format, ...) Tracenf(format, __VA_ARGS__)
sys_err("Count: %d", num); //num is count if i'm not wrong

If not, then go the serverside and do the same. (input_main.cpp)



sys_err("Count in serverside %d", pinfo->count);


 

 

Btw he wrote me a PM asking to add him in Discord, i said "no sorry i'm not doing private help" and he wrote me again with "You can add me, i'm not fake"

So i have doubt with him, don't worry :D

Link to comment
Share on other sites

  • Contributor

Track down where it goes wrong as i said:

Quote

 

If i were you, i would track down the count with


Chat.AppendChat(str(itemCount)) #example

if your problem is created in python. (uiinventory.py)

 

If not, then i would write the count from binary to the syserr.txt to check there next. (pythonnetworkstreammodule.cpp)


#define sys_err TraceError
#define sys_log //(n, format, ...) Tracenf(format, __VA_ARGS__)
sys_err("Count: %d", num); //num is count if i'm not wrong

If not, then go the serverside and do the same. (input_main.cpp)


sys_err("Count in serverside %d", pinfo->count);

 


 
Edited by TMP4
Link to comment
Share on other sites

@TMP4 now i have provlem in extra invertory :(  i will buck up   @Denis ine kapia pragmata perierga pou emfanizonte proti fora ston kosmo tou metin2 dev exis di pouthena auto to provlima pou exo ego  ? ta arxia mou ine martysama 4.6 ke exo ftiaksi 99% ton bugg monos mou xoris na rotao sta forum ala pragmatika auto pou exo to provlima den iparxi kan sto google eftiaksa idika logs to idio pragma egine den vgazi error to eftiaksa ala tora vgazi bugg alou ke ekana ena buck up :P  esi nomizis ine eukolo na ftiaxti ala den ine :) exo kathara client arxia 100% clean pou ine idanika sto na dimiourgis 1 server :)  

Link to comment
Share on other sites

@Denis re file na po oti ipirxe sto google auto to bugg i oti to ixe kialos auto to bugg na po entaksi apo tin stigmi pou ine 2020 bugg pou thes na ksero pou travai? mpori na ine mia litourgia alagmeni ala xoris na vgazi syser thes na mou pis oti esi ta ftiaxnis ta 2020 bugg etsi xoris na kseris i na exoun paraponethi kiala atoma ?

@Denis kita de me niazi kiolas sta tetia mou auto to pragma to afino ketsi de me enoxli isos tha vrethi stin sinexia ke to ftiaxno den me xalaei ke poli

Link to comment
Share on other sites

@TMP4 @Denis    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif    bugg solver fixxed :D   @Denis  to provlima epilithike me epitixia 26/6/2020 :D auto elipe na to afina etsi des video https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif 

 

@TMP4 @Denis  euxaristo pantos pou prosferthikate na me voithisete gg web

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

@Denis  prota apo ola auto to bugg den iparxi pouthena se kanenan logiko na katalavo oti ine 2020 bug :) an ipirxe sto google to bugg auto tote tha elega den ime o monos  ke akoma iparxoun nea bugg apo tis neas genias ton serverfiles pou auta tha ta poune i megalo programatistes to 2022 ke meta otan vgaloun xrima ke stamatisoun na vgazoun xrima tote tha ta poun ta 2020 bugg opos ginete panta

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



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.