Jump to content
  • Register Now

    Sign up and take advantage of the features of our community! Some forums are only accessible to our members!

  • 0

Bugg invertory


perfect

Question

Recommended Posts

  • 0

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 (see edit history)
Link to post
  • 0

Well if he can't do it with the provided code to track down where it goes wrong.. yeah i'm wasting :DI usually wasting but f..., i have a lot of time these days.

When i will not have, i'm not gonna write a reply to such threads.

Edited by TMP4 (see edit history)
  • Love 1
Link to post
  • 0

Common, if he had some knowledge of these stuff he would be able to debug it by himself without asking for help. But since he posted such a simple bug im guessing he cant do the stuff you told him.

Link to post
  • 0

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 post
  • 0

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 (see edit history)
Link to post
  • 0

You doesn't even understand me :(

You're creating the syserr to check if the count is ok or not.

 

A syserr can be used for debug too even if you wonder :D

 

Edit: Then enable it or use sys_log.

Edited by TMP4 (see edit history)
Link to post
  • 0

@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 post
  • 0

Gia tetoia bugs den tha ebena kan sto kopo na kano post, einai apta pio eukola fixes efoson kseris pos dulevoun ta system pou exis. Alla na fantasto auta pou exeis einai kapoio leaked version. Oso gia to clean, den einai apo tin stigmi pou exis auta ta bugs. Kali tixi

Link to post
  • 0

@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 post
  • 0

@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 post
Guest
This topic is now closed to further replies.


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