Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...
  • 0

Problème de shop


Link

Question

Bonsoir à tous,

 

J'ai un problème avec mes shops les items a l'intérieur sont tous bug 

Hidden Content

    Give reaction to this post to see the hidden content.
 dernier ajout fait dans le serveur est le système de projection sa fais 3 jours que j'essaie tant bien que mal de trouver une solution mais rien aboutie voici le système que j'utilise : 

Hidden Content

    Give reaction to this post to see the hidden content.
 alors, si quelqu'un sait comment régler sa pourrai m'en faire part ? Je continue les recherches/tests de mon coté bien entendu, je remercie d'avance la personne qui ce dévouera pour m'aider ! :)

 

Une save a était procédé pour pas que je reste bloqué sur l'avancement d'un projet certains dans le futur.

 

Cordialement, Link. 

Modifié par Funky Emulation
Core X - External 2 Internal
  • Metin2 Dev 1
Lien vers le commentaire
Partager sur d’autres sites

Messages recommandés

  • 0

Yop, désolé du retard manque de temps voici la fonction complète : 

bool CPythonNetworkStream::RecvShopPacket()
{
	std::vector<char> vecBuffer;
	vecBuffer.clear();

    TPacketGCShop  packet_shop;
	if (!Recv(sizeof(packet_shop), &packet_shop))
		return false;

	int iSize = packet_shop.size - sizeof(packet_shop);
	if (iSize > 0)
	{
		vecBuffer.resize(iSize);
		if (!Recv(iSize, &vecBuffer[0]))
			return false;
	}

	switch (packet_shop.subheader)
	{
		case SHOP_SUBHEADER_GC_START:
			{
				CPythonShop::Instance().Clear();

				DWORD dwVID = *(DWORD *)&vecBuffer[0];

				TPacketGCShopStart * pShopStartPacket = (TPacketGCShopStart *)&vecBuffer[4];
				for (BYTE iItemIndex = 0; iItemIndex < SHOP_HOST_ITEM_MAX_NUM; ++iItemIndex)
				{
					CPythonShop::Instance().SetItemData(iItemIndex, pShopStartPacket->items[iItemIndex]);
				}

				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "StartShop", Py_BuildValue("(i)", dwVID));
			}
			break;

		case SHOP_SUBHEADER_GC_START_EX:
			{
				CPythonShop::Instance().Clear();

				TPacketGCShopStartEx * pShopStartPacket = (TPacketGCShopStartEx *)&vecBuffer[0];
				size_t read_point = sizeof(TPacketGCShopStartEx);

				DWORD dwVID = pShopStartPacket->owner_vid;
				BYTE shop_tab_count = pShopStartPacket->shop_tab_count;

				CPythonShop::instance().SetTabCount(shop_tab_count);
				
				for (size_t i = 0; i < shop_tab_count; i++)
				{
					TPacketGCShopStartEx::TSubPacketShopTab* pPackTab = (TPacketGCShopStartEx::TSubPacketShopTab*)&vecBuffer[read_point];
					read_point += sizeof(TPacketGCShopStartEx::TSubPacketShopTab);
					
					CPythonShop::instance().SetTabCoinType(i, pPackTab->coin_type);
					CPythonShop::instance().SetTabName(i, pPackTab->name);

					struct packet_shop_item* item = &pPackTab->items[0];
					
					for (BYTE j = 0; j < SHOP_HOST_ITEM_MAX_NUM; j++)
					{
						TShopItemData* itemData = (item + j);
						CPythonShop::Instance().SetItemData(i, j, *itemData);
					}
				}

				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "StartShop", Py_BuildValue("(i)", dwVID));
			}
			break;


		case SHOP_SUBHEADER_GC_END:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "EndShop", Py_BuildValue("()"));
			break;

		case SHOP_SUBHEADER_GC_UPDATE_ITEM:
			{
				TPacketGCShopUpdateItem * pShopUpdateItemPacket = (TPacketGCShopUpdateItem *)&vecBuffer[0];
				CPythonShop::Instance().SetItemData(pShopUpdateItemPacket->pos, pShopUpdateItemPacket->item);
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "RefreshShop", Py_BuildValue("()"));
			}
			break;

		case SHOP_SUBHEADER_GC_UPDATE_PRICE:
		{
			PyObject *args = PyTuple_New(1);
			PyTuple_SetItem(args, 0, PyLong_FromLongLong(*(long long *)&vecBuffer[0]));
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetShopSellingPrice", args);
		}
			break;
			
		case SHOP_SUBHEADER_GC_NOT_ENOUGH_MONEY:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnShopError", Py_BuildValue("(s)", "NOT_ENOUGH_MONEY"));
			break;

		case SHOP_SUBHEADER_GC_NOT_ENOUGH_MONEY_EX:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnShopError", Py_BuildValue("(s)", "NOT_ENOUGH_MONEY_EX"));
			break;

		case SHOP_SUBHEADER_GC_SOLDOUT:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnShopError", Py_BuildValue("(s)", "SOLDOUT"));
			break;

		case SHOP_SUBHEADER_GC_INVENTORY_FULL:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnShopError", Py_BuildValue("(s)", "INVENTORY_FULL"));
			break;

		case SHOP_SUBHEADER_GC_INVALID_POS:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnShopError", Py_BuildValue("(s)", "INVALID_POS"));
			break;

		default:
			TraceError("CPythonNetworkStream::RecvShopPacket: Unknown subheader\n");
			break;
	}

	return true;
}

 

Lien vers le commentaire
Partager sur d’autres sites

  • 0

j'le rajoute ou j'le modifie ?

 

EDIT: je l'ai rajouter juste au dessus du default c'est bon ? 

		case SHOP_SUBHEADER_GC_SOLD_OUT:
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnShopError", Py_BuildValue("(s)", "SOLD_OUT"));
			break;

 

EDIT2: Une fois rendu IG j'ai plus l'erreur des sources client mais maintenant quand je vais acheter une coiffure par exemple j'ai une erreur en jeu directement : 

Hidden Content

    Give reaction to this post to see the hidden content.

 Mes shops c'est toujours anarchique : 

Hidden Content

    Give reaction to this post to see the hidden content.

  Et mon syserr client toujours des "cannot find by item"

0905 19:46:21386 :: Cannot find item by 51200
0905 19:46:21386 :: Cannot find item by 51200
0905 19:46:21390 :: Cannot find item by 12801024
0905 19:46:21390 :: Cannot find item by 12801024
0905 19:46:21390 :: Cannot find item by 65536
0905 19:46:21390 :: Cannot find item by 65536
0905 19:46:21394 :: Cannot find item by -1811939327
0905 19:46:21394 :: Cannot find item by -1811939327
0905 19:46:21394 :: Cannot find item by 361627648
0905 19:46:21394 :: Cannot find item by 361627648
0905 19:46:22355 :: Cannot find item by -1811939327
0905 19:46:22489 :: Cannot find item by 361627648
0905 19:46:24697 :: Cannot find item by -1811939327
0905 19:46:28075 :: Cannot find item by 65536
0905 19:46:28260 :: Cannot find item by 12801024
0905 19:47:30668 :: Cannot find item by 65536
0905 19:47:30952 :: Cannot find item by 51200
0905 19:47:33310 :: Cannot find item by 12801024
0905 19:47:35301 :: Cannot find item by 51200
0905 19:47:50713 :: Cannot find item by 42496
0905 19:47:50713 :: Cannot find item by 42496
0905 19:47:51190 :: Cannot find item by 42496
0905 19:47:51524 :: Cannot find item by 42496
0905 19:47:55371 :: Cannot find item by 42496
0905 19:48:03977 :: Cannot find item by 42496
0905 19:48:05315 :: Cannot find item by 42496
0905 19:49:42179 :: Cannot find item by 51200
0905 19:49:42179 :: Cannot find item by 51200
0905 19:49:42179 :: Cannot find item by 12801024
0905 19:49:42179 :: Cannot find item by 12801024
0905 19:49:42179 :: Cannot find item by 65536
0905 19:49:42179 :: Cannot find item by 65536
0905 19:49:42179 :: Cannot find item by -1811939327
0905 19:49:42179 :: Cannot find item by -1811939327
0905 19:49:42179 :: Cannot find item by 361627648
0905 19:49:42179 :: Cannot find item by 361627648
0905 19:49:44921 :: Cannot find item by 65536

 

Modifié par Funky Emulation
Core X - External 2 Internal
Lien vers le commentaire
Partager sur d’autres sites

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.


  • brilliantdiscord_widget
  • Flux d'Activité

    1. 6

      problème de connexion à mon serveur local (je suis débutant dans ce genre d'entreprise )

    2. 2

      problème de lancement serveur

    3. 9
    4. 0

      [PVM/PVP] ATLAX2 - EASY PLAY

    5. 2

      problème de lancement serveur

Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.