Jump to content

Recommended Posts

  • Honorable Member

@ DemOnJR & @ TAUMP
You just need to block the second action in uiInventory.py

	def __CanUseSrcItemToDstItem(self, srcItemVnum, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
		if srcSlotWindow == dstSlotWindow and srcSlotPos == dstSlotPos:
			return False

		if self.interface.IsShowDlgQuestionWindow():
			return False

or, if you are not using the latest root files like so:

	def __CanUseSrcItemToDstItem(self, srcItemVnum, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
		if srcSlotWindow == dstSlotWindow and srcSlotPos == dstSlotPos:
			return False

		if self.attachMetinDialog and self.attachMetinDialog.IsShow():
			return False

 

I noticed and fixed it long time ago, but I didn't care about the topic anymore, due the many many different files, systems, environment etc.
I gave the ingredients, so everyone should bake the bird for themselves. /sometimes it needs some salt./

  • Metin2 Dev 1
  • Love 1
  • Love 2
  • 1 year later...

On a Martysama 5.8 client this doesn't work. Code compiles, there are no system errors both on client and server. I added logs to see if any items are getting marked as "Unusable" and they are but there is no visual effect at all.


 

0518 23:37:04932 :: [DEBUG] SetUsableSlotOnTopWnd called for slot 1
0518 23:37:04932 :: [DEBUG] SetUnusableSlotOnTopWnd called for slot 2
0518 23:37:04932 :: [DEBUG] SetUsableSlotOnTopWnd called for slot 3
0518 23:37:04932 :: [DEBUG] SetUsableSlotOnTopWnd called for slot 4
0518 23:37:04932 :: [DEBUG] SetUnusableSlotOnTopWnd called for slot 5
#ifdef WJ_ENABLE_TRADABLE_ICON
void CSlotWindow::SetCanMouseEventSlot(DWORD dwIndex)
{
    TSlot* pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
    {
        sys_err("[DEBUG] SetCanMouseEventSlot(%u) failed: invalid slot pointer\n", dwIndex);
        return;
    }

    sys_err("[DEBUG] SetCanMouseEventSlot called for slot %u\n", dwIndex);
    REMOVE_BIT(pSlot->dwState, SLOT_STATE_CANT_MOUSE_EVENT);
}

void CSlotWindow::SetCantMouseEventSlot(DWORD dwIndex)
{
    TSlot* pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
    {
        sys_err("[DEBUG] SetCantMouseEventSlot(%u) failed: invalid slot pointer\n", dwIndex);
        return;
    }

    sys_err("[DEBUG] SetCantMouseEventSlot called for slot %u\n", dwIndex);
    SET_BIT(pSlot->dwState, SLOT_STATE_CANT_MOUSE_EVENT);
}

void CSlotWindow::SetUsableSlotOnTopWnd(DWORD dwIndex)
{
    TSlot* pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
    {
        sys_err("[DEBUG] SetUsableSlotOnTopWnd(%u) failed: invalid slot pointer\n", dwIndex);
        return;
    }

    sys_err("[DEBUG] SetUsableSlotOnTopWnd called for slot %u\n", dwIndex);
    REMOVE_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE);
}

void CSlotWindow::SetUnusableSlotOnTopWnd(DWORD dwIndex)
{
    TSlot* pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
    {
        sys_err("[DEBUG] SetUnusableSlotOnTopWnd(%u) failed: invalid slot pointer\n", dwIndex);
        return;
    }

    sys_err("[DEBUG] SetUnusableSlotOnTopWnd called for slot %u\n", dwIndex);
    SET_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE);
}
#endif

spacer.png

Edited by Metin2 Dev International
Core X - External 2 Internal
  • 4 weeks later...

Can't edit my own post but I found the issue in my code. I placed the code wrongly in void CSlotWindow::OnRender(). Make sure to follow carefully where it says to place after `if (IS_SET(rSlot.dwState, SLOT_STATE_DISABLE))` in `PythonSlotWindow.cpp`

Edited by Hyu
  • 6 months later...

If you only copy-paste the codes from the tutorial could it cause syserr's like these?

0104 20:39:37401 :: Phase Game does not handle this header (header: 81, last: 45, 81)
0104 20:39:37416 :: Unknown packet header: 102, last: 45 81
0104 20:39:37434 :: Unknown packet header: 102, last: 45 81
0104 20:39:37449 :: Unknown packet header: 102, last: 45 81
[... endlessly repeating this ...]

Or:

1218 22:33:34356 :: Phase Game does not handle this header (header: 81, last: 45, 81)
1218 22:33:34389 :: Unknown packet header: 101, last: 45 81
1218 22:33:34405 :: Unknown packet header: 101, last: 45 81
1218 22:33:34422 :: Unknown packet header: 101, last: 45 81
[... endlessly repeating this ...]

After teleporting the character stays half-transparent, you couldn't interact with anything (like when your internet connection is interrupted), but the server receives packets from the client anyway, so if I use my self-buff skills in a warrior character the client stays in this frozen state, the effect like Aura of the sword don't applied to my sword client side, but it's registered in server side, i saw in the LOG-s, serverside there is not any syserr at all.

Maybe the cause is this line at the tutorial PythonNetworkStreamPhaseGame.cpp part:

CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (WORD)exchange_packet.arg3);

I compared the files to the original source and I saw it should look like this (space between the (WORD) and the exchange_packet.arg3):

CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3);


Or maybe the disabled _IMPROVED_PACKET_ENCRYPTION_ could cause errors like this?
Typically happens at Wi-Fi network, never at LAN connection.
I saw someone else has similar problem like mine:

https://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/4057251-fix-phase-game-does-not-handle-header-header-81-last-45-81-a.html


Any suggestion is welcomed!

  • 5 months later...
  • Active Member
On 11/4/2023 at 6:52 PM, xP3NG3Rx said:

@ DemOnJR & @ TAUMP
You just need to block the second action in uiInventory.py

	def __CanUseSrcItemToDstItem(self, srcItemVnum, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
		if srcSlotWindow == dstSlotWindow and srcSlotPos == dstSlotPos:
			return False

		if self.interface.IsShowDlgQuestionWindow():
			return False

or, if you are not using the latest root files like so:

	def __CanUseSrcItemToDstItem(self, srcItemVnum, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
		if srcSlotWindow == dstSlotWindow and srcSlotPos == dstSlotPos:
			return False

		if self.attachMetinDialog and self.attachMetinDialog.IsShow():
			return False

 

I noticed and fixed it long time ago, but I didn't care about the topic anymore, due the many many different files, systems, environment etc.
I gave the ingredients, so everyone should bake the bird for themselves. /sometimes it needs some salt./

Unfortunately, also with this correction (in my case the second one), if you try to add more gems to multiple items and then click “No” or close the window, the previous items will remain locked until you move something in your inventory

  • Premium
4 hours ago, 4peppe said:

Unfortunately, also with this correction (in my case the second one), if you try to add more gems to multiple items and then click “No” or close the window, the previous items will remain locked until you move something in your inventory

No issues, can you show video? 


 

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.